diff --git a/Deploy/metadata/V1/CloudDeploy.php b/Deploy/metadata/V1/CloudDeploy.php
index f45ab390eda7..c9a2be1637a2 100644
Binary files a/Deploy/metadata/V1/CloudDeploy.php and b/Deploy/metadata/V1/CloudDeploy.php differ
diff --git a/Deploy/src/V1/AdvanceRolloutRequest.php b/Deploy/src/V1/AdvanceRolloutRequest.php
index dd584135c39b..f8c39a9f3dba 100644
--- a/Deploy/src/V1/AdvanceRolloutRequest.php
+++ b/Deploy/src/V1/AdvanceRolloutRequest.php
@@ -28,13 +28,6 @@ class AdvanceRolloutRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
protected $phase_id = '';
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $name Required. Name of the Rollout. Format is
@@ -64,9 +57,6 @@ public static function build(string $name, string $phaseId): self
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
* @type string $phase_id
* Required. The phase ID to advance the `Rollout` to.
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -128,33 +118,5 @@ public function setPhaseId($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/ApproveRolloutRequest.php b/Deploy/src/V1/ApproveRolloutRequest.php
index c0e44d90c61f..4f881df0b1c2 100644
--- a/Deploy/src/V1/ApproveRolloutRequest.php
+++ b/Deploy/src/V1/ApproveRolloutRequest.php
@@ -28,13 +28,6 @@ class ApproveRolloutRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field bool approved = 2 [(.google.api.field_behavior) = REQUIRED];
*/
protected $approved = false;
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $name Required. Name of the Rollout. Format is
@@ -62,9 +55,6 @@ public static function build(string $name): self
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
* @type bool $approved
* Required. True = approve; false = reject
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -126,33 +116,5 @@ public function setApproved($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/AutomationRun.php b/Deploy/src/V1/AutomationRun.php
index fcf3e4b3941e..3db70ad3d274 100644
--- a/Deploy/src/V1/AutomationRun.php
+++ b/Deploy/src/V1/AutomationRun.php
@@ -80,13 +80,6 @@ class AutomationRun extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string state_description = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
protected $state_description = '';
- /**
- * Output only. Contains information about what policies prevented the
- * `AutomationRun` to proceed.
- *
- * Generated from protobuf field .google.cloud.deploy.v1.PolicyViolation policy_violation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
- */
- protected $policy_violation = null;
/**
* Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
* after 14 days from its creation date.
@@ -148,9 +141,6 @@ class AutomationRun extends \Google\Protobuf\Internal\Message
* @type string $state_description
* Output only. Explains the current state of the `AutomationRun`. Present
* only when an explanation is needed.
- * @type \Google\Cloud\Deploy\V1\PolicyViolation $policy_violation
- * Output only. Contains information about what policies prevented the
- * `AutomationRun` to proceed.
* @type \Google\Protobuf\Timestamp $expire_time
* Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
* after 14 days from its creation date.
@@ -456,44 +446,6 @@ public function setStateDescription($var)
return $this;
}
- /**
- * Output only. Contains information about what policies prevented the
- * `AutomationRun` to proceed.
- *
- * Generated from protobuf field .google.cloud.deploy.v1.PolicyViolation policy_violation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
- * @return \Google\Cloud\Deploy\V1\PolicyViolation|null
- */
- public function getPolicyViolation()
- {
- return $this->policy_violation;
- }
-
- public function hasPolicyViolation()
- {
- return isset($this->policy_violation);
- }
-
- public function clearPolicyViolation()
- {
- unset($this->policy_violation);
- }
-
- /**
- * Output only. Contains information about what policies prevented the
- * `AutomationRun` to proceed.
- *
- * Generated from protobuf field .google.cloud.deploy.v1.PolicyViolation policy_violation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
- * @param \Google\Cloud\Deploy\V1\PolicyViolation $var
- * @return $this
- */
- public function setPolicyViolation($var)
- {
- GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PolicyViolation::class);
- $this->policy_violation = $var;
-
- return $this;
- }
-
/**
* Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
* after 14 days from its creation date.
diff --git a/Deploy/src/V1/CancelRolloutRequest.php b/Deploy/src/V1/CancelRolloutRequest.php
index 540f9ddb48dd..3ae1d6f52a6f 100644
--- a/Deploy/src/V1/CancelRolloutRequest.php
+++ b/Deploy/src/V1/CancelRolloutRequest.php
@@ -22,13 +22,6 @@ class CancelRolloutRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
protected $name = '';
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $name Required. Name of the Rollout. Format is
@@ -54,9 +47,6 @@ public static function build(string $name): self
* @type string $name
* Required. Name of the Rollout. Format is
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -92,33 +82,5 @@ public function setName($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/Client/CloudDeployClient.php b/Deploy/src/V1/Client/CloudDeployClient.php
index 48adb7913db0..6bb7d99f935d 100644
--- a/Deploy/src/V1/Client/CloudDeployClient.php
+++ b/Deploy/src/V1/Client/CloudDeployClient.php
@@ -50,7 +50,6 @@
use Google\Cloud\Deploy\V1\CreateAutomationRequest;
use Google\Cloud\Deploy\V1\CreateCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\CreateDeployPolicyRequest;
use Google\Cloud\Deploy\V1\CreateReleaseRequest;
use Google\Cloud\Deploy\V1\CreateRolloutRequest;
use Google\Cloud\Deploy\V1\CreateTargetRequest;
@@ -58,16 +57,13 @@
use Google\Cloud\Deploy\V1\DeleteAutomationRequest;
use Google\Cloud\Deploy\V1\DeleteCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\DeleteDeployPolicyRequest;
use Google\Cloud\Deploy\V1\DeleteTargetRequest;
use Google\Cloud\Deploy\V1\DeliveryPipeline;
-use Google\Cloud\Deploy\V1\DeployPolicy;
use Google\Cloud\Deploy\V1\GetAutomationRequest;
use Google\Cloud\Deploy\V1\GetAutomationRunRequest;
use Google\Cloud\Deploy\V1\GetConfigRequest;
use Google\Cloud\Deploy\V1\GetCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\GetDeployPolicyRequest;
use Google\Cloud\Deploy\V1\GetJobRunRequest;
use Google\Cloud\Deploy\V1\GetReleaseRequest;
use Google\Cloud\Deploy\V1\GetRolloutRequest;
@@ -79,7 +75,6 @@
use Google\Cloud\Deploy\V1\ListAutomationsRequest;
use Google\Cloud\Deploy\V1\ListCustomTargetTypesRequest;
use Google\Cloud\Deploy\V1\ListDeliveryPipelinesRequest;
-use Google\Cloud\Deploy\V1\ListDeployPoliciesRequest;
use Google\Cloud\Deploy\V1\ListJobRunsRequest;
use Google\Cloud\Deploy\V1\ListReleasesRequest;
use Google\Cloud\Deploy\V1\ListRolloutsRequest;
@@ -96,7 +91,6 @@
use Google\Cloud\Deploy\V1\UpdateAutomationRequest;
use Google\Cloud\Deploy\V1\UpdateCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\UpdateDeployPolicyRequest;
use Google\Cloud\Deploy\V1\UpdateTargetRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
@@ -130,21 +124,18 @@
* @method PromiseInterface createAutomationAsync(CreateAutomationRequest $request, array $optionalArgs = [])
* @method PromiseInterface createCustomTargetTypeAsync(CreateCustomTargetTypeRequest $request, array $optionalArgs = [])
* @method PromiseInterface createDeliveryPipelineAsync(CreateDeliveryPipelineRequest $request, array $optionalArgs = [])
- * @method PromiseInterface createDeployPolicyAsync(CreateDeployPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface createReleaseAsync(CreateReleaseRequest $request, array $optionalArgs = [])
* @method PromiseInterface createRolloutAsync(CreateRolloutRequest $request, array $optionalArgs = [])
* @method PromiseInterface createTargetAsync(CreateTargetRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteAutomationAsync(DeleteAutomationRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteCustomTargetTypeAsync(DeleteCustomTargetTypeRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteDeliveryPipelineAsync(DeleteDeliveryPipelineRequest $request, array $optionalArgs = [])
- * @method PromiseInterface deleteDeployPolicyAsync(DeleteDeployPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteTargetAsync(DeleteTargetRequest $request, array $optionalArgs = [])
* @method PromiseInterface getAutomationAsync(GetAutomationRequest $request, array $optionalArgs = [])
* @method PromiseInterface getAutomationRunAsync(GetAutomationRunRequest $request, array $optionalArgs = [])
* @method PromiseInterface getConfigAsync(GetConfigRequest $request, array $optionalArgs = [])
* @method PromiseInterface getCustomTargetTypeAsync(GetCustomTargetTypeRequest $request, array $optionalArgs = [])
* @method PromiseInterface getDeliveryPipelineAsync(GetDeliveryPipelineRequest $request, array $optionalArgs = [])
- * @method PromiseInterface getDeployPolicyAsync(GetDeployPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface getJobRunAsync(GetJobRunRequest $request, array $optionalArgs = [])
* @method PromiseInterface getReleaseAsync(GetReleaseRequest $request, array $optionalArgs = [])
* @method PromiseInterface getRolloutAsync(GetRolloutRequest $request, array $optionalArgs = [])
@@ -154,7 +145,6 @@
* @method PromiseInterface listAutomationsAsync(ListAutomationsRequest $request, array $optionalArgs = [])
* @method PromiseInterface listCustomTargetTypesAsync(ListCustomTargetTypesRequest $request, array $optionalArgs = [])
* @method PromiseInterface listDeliveryPipelinesAsync(ListDeliveryPipelinesRequest $request, array $optionalArgs = [])
- * @method PromiseInterface listDeployPoliciesAsync(ListDeployPoliciesRequest $request, array $optionalArgs = [])
* @method PromiseInterface listJobRunsAsync(ListJobRunsRequest $request, array $optionalArgs = [])
* @method PromiseInterface listReleasesAsync(ListReleasesRequest $request, array $optionalArgs = [])
* @method PromiseInterface listRolloutsAsync(ListRolloutsRequest $request, array $optionalArgs = [])
@@ -165,7 +155,6 @@
* @method PromiseInterface updateAutomationAsync(UpdateAutomationRequest $request, array $optionalArgs = [])
* @method PromiseInterface updateCustomTargetTypeAsync(UpdateCustomTargetTypeRequest $request, array $optionalArgs = [])
* @method PromiseInterface updateDeliveryPipelineAsync(UpdateDeliveryPipelineRequest $request, array $optionalArgs = [])
- * @method PromiseInterface updateDeployPolicyAsync(UpdateDeployPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface updateTargetAsync(UpdateTargetRequest $request, array $optionalArgs = [])
* @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = [])
* @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = [])
@@ -414,25 +403,6 @@ public static function deliveryPipelineName(string $project, string $location, s
]);
}
- /**
- * Formats a string containing the fully-qualified path to represent a
- * deploy_policy resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deployPolicy
- *
- * @return string The formatted deploy_policy resource.
- */
- public static function deployPolicyName(string $project, string $location, string $deployPolicy): string
- {
- return self::getPathTemplate('deployPolicy')->render([
- 'project' => $project,
- 'location' => $location,
- 'deploy_policy' => $deployPolicy,
- ]);
- }
-
/**
* Formats a string containing the fully-qualified path to represent a job
* resource.
@@ -665,7 +635,6 @@ public static function workerPoolName(string $project, string $location, string
* - config: projects/{project}/locations/{location}/config
* - customTargetType: projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}
* - deliveryPipeline: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}
- * - deployPolicy: projects/{project}/locations/{location}/deployPolicies/{deploy_policy}
* - 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}
@@ -984,32 +953,6 @@ public function createDeliveryPipeline(
return $this->startApiCall('CreateDeliveryPipeline', $request, $callOptions)->wait();
}
- /**
- * Creates a new DeployPolicy in a given project and location.
- *
- * The async variant is {@see CloudDeployClient::createDeployPolicyAsync()} .
- *
- * @example samples/V1/CloudDeployClient/create_deploy_policy.php
- *
- * @param CreateDeployPolicyRequest $request A request to house fields associated with the call.
- * @param array $callOptions {
- * 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 OperationResponse
- *
- * @throws ApiException Thrown if the API call fails.
- */
- public function createDeployPolicy(CreateDeployPolicyRequest $request, array $callOptions = []): OperationResponse
- {
- return $this->startApiCall('CreateDeployPolicy', $request, $callOptions)->wait();
- }
-
/**
* Creates a new Release in a given project and location.
*
@@ -1170,32 +1113,6 @@ public function deleteDeliveryPipeline(
return $this->startApiCall('DeleteDeliveryPipeline', $request, $callOptions)->wait();
}
- /**
- * Deletes a single DeployPolicy.
- *
- * The async variant is {@see CloudDeployClient::deleteDeployPolicyAsync()} .
- *
- * @example samples/V1/CloudDeployClient/delete_deploy_policy.php
- *
- * @param DeleteDeployPolicyRequest $request A request to house fields associated with the call.
- * @param array $callOptions {
- * 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 OperationResponse
- *
- * @throws ApiException Thrown if the API call fails.
- */
- public function deleteDeployPolicy(DeleteDeployPolicyRequest $request, array $callOptions = []): OperationResponse
- {
- return $this->startApiCall('DeleteDeployPolicy', $request, $callOptions)->wait();
- }
-
/**
* Deletes a single Target.
*
@@ -1352,32 +1269,6 @@ public function getDeliveryPipeline(GetDeliveryPipelineRequest $request, array $
return $this->startApiCall('GetDeliveryPipeline', $request, $callOptions)->wait();
}
- /**
- * Gets details of a single DeployPolicy.
- *
- * The async variant is {@see CloudDeployClient::getDeployPolicyAsync()} .
- *
- * @example samples/V1/CloudDeployClient/get_deploy_policy.php
- *
- * @param GetDeployPolicyRequest $request A request to house fields associated with the call.
- * @param array $callOptions {
- * 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 DeployPolicy
- *
- * @throws ApiException Thrown if the API call fails.
- */
- public function getDeployPolicy(GetDeployPolicyRequest $request, array $callOptions = []): DeployPolicy
- {
- return $this->startApiCall('GetDeployPolicy', $request, $callOptions)->wait();
- }
-
/**
* Gets details of a single JobRun.
*
@@ -1616,32 +1507,6 @@ public function listDeliveryPipelines(
return $this->startApiCall('ListDeliveryPipelines', $request, $callOptions);
}
- /**
- * Lists DeployPolicies in a given project and location.
- *
- * The async variant is {@see CloudDeployClient::listDeployPoliciesAsync()} .
- *
- * @example samples/V1/CloudDeployClient/list_deploy_policies.php
- *
- * @param ListDeployPoliciesRequest $request A request to house fields associated with the call.
- * @param array $callOptions {
- * 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 PagedListResponse
- *
- * @throws ApiException Thrown if the API call fails.
- */
- public function listDeployPolicies(ListDeployPoliciesRequest $request, array $callOptions = []): PagedListResponse
- {
- return $this->startApiCall('ListDeployPolicies', $request, $callOptions);
- }
-
/**
* Lists JobRuns in a given project and location.
*
@@ -1906,32 +1771,6 @@ public function updateDeliveryPipeline(
return $this->startApiCall('UpdateDeliveryPipeline', $request, $callOptions)->wait();
}
- /**
- * Updates the parameters of a single DeployPolicy.
- *
- * The async variant is {@see CloudDeployClient::updateDeployPolicyAsync()} .
- *
- * @example samples/V1/CloudDeployClient/update_deploy_policy.php
- *
- * @param UpdateDeployPolicyRequest $request A request to house fields associated with the call.
- * @param array $callOptions {
- * 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 OperationResponse
- *
- * @throws ApiException Thrown if the API call fails.
- */
- public function updateDeployPolicy(UpdateDeployPolicyRequest $request, array $callOptions = []): OperationResponse
- {
- return $this->startApiCall('UpdateDeployPolicy', $request, $callOptions)->wait();
- }
-
/**
* Updates the parameters of a single Target.
*
diff --git a/Deploy/src/V1/CreateReleaseRequest.php b/Deploy/src/V1/CreateReleaseRequest.php
index 06f287273d32..27e81a1e44db 100644
--- a/Deploy/src/V1/CreateReleaseRequest.php
+++ b/Deploy/src/V1/CreateReleaseRequest.php
@@ -58,13 +58,6 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
protected $validate_only = false;
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $parent Required. The parent collection in which the `Release` is created.
@@ -115,9 +108,6 @@ public static function build(string $parent, \Google\Cloud\Deploy\V1\Release $re
* @type bool $validate_only
* 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 array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -291,33 +281,5 @@ public function setValidateOnly($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/CreateRolloutRequest.php b/Deploy/src/V1/CreateRolloutRequest.php
index f8ce1968ee03..30f1bc25d5d7 100644
--- a/Deploy/src/V1/CreateRolloutRequest.php
+++ b/Deploy/src/V1/CreateRolloutRequest.php
@@ -58,13 +58,6 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
protected $validate_only = false;
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
* will start at the first phase.
@@ -122,9 +115,6 @@ public static function build(string $parent, \Google\Cloud\Deploy\V1\Rollout $ro
* @type bool $validate_only
* 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 array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* @type string $starting_phase_id
* Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
* will start at the first phase.
@@ -301,34 +291,6 @@ public function setValidateOnly($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
/**
* Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
* will start at the first phase.
diff --git a/Deploy/src/V1/IgnoreJobRequest.php b/Deploy/src/V1/IgnoreJobRequest.php
index d191c4db127a..094701d85774 100644
--- a/Deploy/src/V1/IgnoreJobRequest.php
+++ b/Deploy/src/V1/IgnoreJobRequest.php
@@ -34,13 +34,6 @@ class IgnoreJobRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED];
*/
protected $job_id = '';
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $rollout Required. Name of the Rollout. Format is
@@ -74,9 +67,6 @@ public static function build(string $rollout, string $phaseId, string $jobId): s
* Required. The phase ID the Job to ignore belongs to.
* @type string $job_id
* Required. The job ID for the Job to ignore.
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -164,33 +154,5 @@ public function setJobId($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/RetryJobRequest.php b/Deploy/src/V1/RetryJobRequest.php
index 398162c57ca6..eb2ecc465174 100644
--- a/Deploy/src/V1/RetryJobRequest.php
+++ b/Deploy/src/V1/RetryJobRequest.php
@@ -34,13 +34,6 @@ class RetryJobRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED];
*/
protected $job_id = '';
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $rollout Required. Name of the Rollout. Format is
@@ -74,9 +67,6 @@ public static function build(string $rollout, string $phaseId, string $jobId): s
* Required. The phase ID the Job to retry belongs to.
* @type string $job_id
* Required. The job ID for the Job to retry.
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -164,33 +154,5 @@ public function setJobId($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/RollbackTargetRequest.php b/Deploy/src/V1/RollbackTargetRequest.php
index f7208f661a50..d4ec8143210e 100644
--- a/Deploy/src/V1/RollbackTargetRequest.php
+++ b/Deploy/src/V1/RollbackTargetRequest.php
@@ -63,13 +63,6 @@ class RollbackTargetRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field bool validate_only = 7 [(.google.api.field_behavior) = OPTIONAL];
*/
protected $validate_only = false;
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
@@ -117,9 +110,6 @@ public static function build(string $name, string $targetId, string $rolloutId):
* @type bool $validate_only
* Optional. If set to true, the request is validated and the user is provided
* with a `RollbackTargetResponse`.
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
* }
*/
public function __construct($data = NULL) {
@@ -331,33 +321,5 @@ public function setValidateOnly($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/TerminateJobRunRequest.php b/Deploy/src/V1/TerminateJobRunRequest.php
index ce381fdbb945..4264a7361286 100644
--- a/Deploy/src/V1/TerminateJobRunRequest.php
+++ b/Deploy/src/V1/TerminateJobRunRequest.php
@@ -22,13 +22,6 @@ class TerminateJobRunRequest extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
protected $name = '';
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- */
- private $override_deploy_policy;
/**
* @param string $name Required. Name of the `JobRun`. Format must be
@@ -54,9 +47,6 @@ public static function build(string $name): self
* @type string $name
* Required. Name of the `JobRun`. Format must be
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
- * @type array|\Google\Protobuf\Internal\RepeatedField $override_deploy_policy
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
* }
*/
public function __construct($data = NULL) {
@@ -92,33 +82,5 @@ public function setName($var)
return $this;
}
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOverrideDeployPolicy()
- {
- return $this->override_deploy_policy;
- }
-
- /**
- * Optional. Deploy policies to override. Format is
- * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
- *
- * Generated from protobuf field repeated string override_deploy_policy = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
- * @param array|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOverrideDeployPolicy($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
- $this->override_deploy_policy = $arr;
-
- return $this;
- }
-
}
diff --git a/Deploy/src/V1/gapic_metadata.json b/Deploy/src/V1/gapic_metadata.json
index cc25967ba57d..4fb04e21a05b 100644
--- a/Deploy/src/V1/gapic_metadata.json
+++ b/Deploy/src/V1/gapic_metadata.json
@@ -50,11 +50,6 @@
"createDeliveryPipeline"
]
},
- "CreateDeployPolicy": {
- "methods": [
- "createDeployPolicy"
- ]
- },
"CreateRelease": {
"methods": [
"createRelease"
@@ -85,11 +80,6 @@
"deleteDeliveryPipeline"
]
},
- "DeleteDeployPolicy": {
- "methods": [
- "deleteDeployPolicy"
- ]
- },
"DeleteTarget": {
"methods": [
"deleteTarget"
@@ -120,11 +110,6 @@
"getDeliveryPipeline"
]
},
- "GetDeployPolicy": {
- "methods": [
- "getDeployPolicy"
- ]
- },
"GetJobRun": {
"methods": [
"getJobRun"
@@ -170,11 +155,6 @@
"listDeliveryPipelines"
]
},
- "ListDeployPolicies": {
- "methods": [
- "listDeployPolicies"
- ]
- },
"ListJobRuns": {
"methods": [
"listJobRuns"
@@ -225,11 +205,6 @@
"updateDeliveryPipeline"
]
},
- "UpdateDeployPolicy": {
- "methods": [
- "updateDeployPolicy"
- ]
- },
"UpdateTarget": {
"methods": [
"updateTarget"
diff --git a/Deploy/src/V1/resources/cloud_deploy_client_config.json b/Deploy/src/V1/resources/cloud_deploy_client_config.json
index 89a03316253f..344ed8b2d90a 100644
--- a/Deploy/src/V1/resources/cloud_deploy_client_config.json
+++ b/Deploy/src/V1/resources/cloud_deploy_client_config.json
@@ -78,11 +78,6 @@
"retry_codes_name": "no_retry_1_codes",
"retry_params_name": "no_retry_1_params"
},
- "CreateDeployPolicy": {
- "timeout_millis": 60000,
- "retry_codes_name": "no_retry_1_codes",
- "retry_params_name": "no_retry_1_params"
- },
"CreateRelease": {
"timeout_millis": 60000,
"retry_codes_name": "no_retry_1_codes",
@@ -113,11 +108,6 @@
"retry_codes_name": "no_retry_1_codes",
"retry_params_name": "no_retry_1_params"
},
- "DeleteDeployPolicy": {
- "timeout_millis": 60000,
- "retry_codes_name": "no_retry_1_codes",
- "retry_params_name": "no_retry_1_params"
- },
"DeleteTarget": {
"timeout_millis": 60000,
"retry_codes_name": "no_retry_1_codes",
@@ -148,11 +138,6 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
- "GetDeployPolicy": {
- "timeout_millis": 60000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- },
"GetJobRun": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -198,11 +183,6 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
- "ListDeployPolicies": {
- "timeout_millis": 60000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- },
"ListJobRuns": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -253,11 +233,6 @@
"retry_codes_name": "no_retry_1_codes",
"retry_params_name": "no_retry_1_params"
},
- "UpdateDeployPolicy": {
- "timeout_millis": 60000,
- "retry_codes_name": "no_retry_1_codes",
- "retry_params_name": "no_retry_1_params"
- },
"UpdateTarget": {
"timeout_millis": 60000,
"retry_codes_name": "no_retry_1_codes",
diff --git a/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php b/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php
index 9842887d33c3..1b7b7bbc3ac4 100644
--- a/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php
+++ b/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php
@@ -80,25 +80,6 @@
],
],
],
- 'CreateDeployPolicy' => [
- 'longRunning' => [
- 'operationReturnType' => '\Google\Cloud\Deploy\V1\DeployPolicy',
- 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata',
- 'initialPollDelayMillis' => '500',
- 'pollDelayMultiplier' => '1.5',
- 'maxPollDelayMillis' => '5000',
- 'totalPollTimeoutMillis' => '300000',
- ],
- 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL,
- 'headerParams' => [
- [
- 'keyName' => 'parent',
- 'fieldAccessors' => [
- 'getParent',
- ],
- ],
- ],
- ],
'CreateRelease' => [
'longRunning' => [
'operationReturnType' => '\Google\Cloud\Deploy\V1\Release',
@@ -213,25 +194,6 @@
],
],
],
- 'DeleteDeployPolicy' => [
- 'longRunning' => [
- 'operationReturnType' => '\Google\Protobuf\GPBEmpty',
- 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata',
- 'initialPollDelayMillis' => '500',
- 'pollDelayMultiplier' => '1.5',
- 'maxPollDelayMillis' => '5000',
- 'totalPollTimeoutMillis' => '300000',
- ],
- 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL,
- 'headerParams' => [
- [
- 'keyName' => 'name',
- 'fieldAccessors' => [
- 'getName',
- ],
- ],
- ],
- ],
'DeleteTarget' => [
'longRunning' => [
'operationReturnType' => '\Google\Protobuf\GPBEmpty',
@@ -311,26 +273,6 @@
],
],
],
- 'UpdateDeployPolicy' => [
- 'longRunning' => [
- 'operationReturnType' => '\Google\Cloud\Deploy\V1\DeployPolicy',
- 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata',
- 'initialPollDelayMillis' => '500',
- 'pollDelayMultiplier' => '1.5',
- 'maxPollDelayMillis' => '5000',
- 'totalPollTimeoutMillis' => '300000',
- ],
- 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL,
- 'headerParams' => [
- [
- 'keyName' => 'deploy_policy.name',
- 'fieldAccessors' => [
- 'getDeployPolicy',
- 'getName',
- ],
- ],
- ],
- ],
'UpdateTarget' => [
'longRunning' => [
'operationReturnType' => '\Google\Cloud\Deploy\V1\Target',
@@ -471,18 +413,6 @@
],
],
],
- 'GetDeployPolicy' => [
- 'callType' => \Google\ApiCore\Call::UNARY_CALL,
- 'responseType' => 'Google\Cloud\Deploy\V1\DeployPolicy',
- 'headerParams' => [
- [
- 'keyName' => 'name',
- 'fieldAccessors' => [
- 'getName',
- ],
- ],
- ],
- ],
'GetJobRun' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\Deploy\V1\JobRun',
@@ -623,26 +553,6 @@
],
],
],
- 'ListDeployPolicies' => [
- 'pageStreaming' => [
- 'requestPageTokenGetMethod' => 'getPageToken',
- 'requestPageTokenSetMethod' => 'setPageToken',
- 'requestPageSizeGetMethod' => 'getPageSize',
- 'requestPageSizeSetMethod' => 'setPageSize',
- 'responsePageTokenGetMethod' => 'getNextPageToken',
- 'resourcesGetMethod' => 'getDeployPolicies',
- ],
- 'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
- 'responseType' => 'Google\Cloud\Deploy\V1\ListDeployPoliciesResponse',
- 'headerParams' => [
- [
- 'keyName' => 'parent',
- 'fieldAccessors' => [
- 'getParent',
- ],
- ],
- ],
- ],
'ListJobRuns' => [
'pageStreaming' => [
'requestPageTokenGetMethod' => 'getPageToken',
@@ -840,7 +750,6 @@
'config' => 'projects/{project}/locations/{location}/config',
'customTargetType' => 'projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}',
'deliveryPipeline' => 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}',
- 'deployPolicy' => 'projects/{project}/locations/{location}/deployPolicies/{deploy_policy}',
'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}',
diff --git a/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php b/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php
index 0391c32a6344..febaff6b324f 100644
--- a/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php
+++ b/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php
@@ -128,21 +128,6 @@
'delivery_pipeline_id',
],
],
- 'CreateDeployPolicy' => [
- 'method' => 'post',
- 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/deployPolicies',
- 'body' => 'deploy_policy',
- 'placeholders' => [
- 'parent' => [
- 'getters' => [
- 'getParent',
- ],
- ],
- ],
- 'queryParams' => [
- 'deploy_policy_id',
- ],
- ],
'CreateRelease' => [
'method' => 'post',
'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases',
@@ -221,17 +206,6 @@
],
],
],
- 'DeleteDeployPolicy' => [
- 'method' => 'delete',
- 'uriTemplate' => '/v1/{name=projects/*/locations/*/deployPolicies/*}',
- 'placeholders' => [
- 'name' => [
- 'getters' => [
- 'getName',
- ],
- ],
- ],
- ],
'DeleteTarget' => [
'method' => 'delete',
'uriTemplate' => '/v1/{name=projects/*/locations/*/targets/*}',
@@ -298,17 +272,6 @@
],
],
],
- 'GetDeployPolicy' => [
- 'method' => 'get',
- 'uriTemplate' => '/v1/{name=projects/*/locations/*/deployPolicies/*}',
- 'placeholders' => [
- 'name' => [
- 'getters' => [
- 'getName',
- ],
- ],
- ],
- ],
'GetJobRun' => [
'method' => 'get',
'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}',
@@ -409,17 +372,6 @@
],
],
],
- 'ListDeployPolicies' => [
- 'method' => 'get',
- 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/deployPolicies',
- 'placeholders' => [
- 'parent' => [
- 'getters' => [
- 'getParent',
- ],
- ],
- ],
- ],
'ListJobRuns' => [
'method' => 'get',
'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns',
@@ -548,22 +500,6 @@
'update_mask',
],
],
- 'UpdateDeployPolicy' => [
- 'method' => 'patch',
- 'uriTemplate' => '/v1/{deploy_policy.name=projects/*/locations/*/deployPolicies/*}',
- 'body' => 'deploy_policy',
- 'placeholders' => [
- 'deploy_policy.name' => [
- 'getters' => [
- 'getDeployPolicy',
- 'getName',
- ],
- ],
- ],
- 'queryParams' => [
- 'update_mask',
- ],
- ],
'UpdateTarget' => [
'method' => 'patch',
'uriTemplate' => '/v1/{target.name=projects/*/locations/*/targets/*}',
diff --git a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php
index afb8c134eed8..f0572c7f722d 100644
--- a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php
+++ b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php
@@ -44,7 +44,6 @@
use Google\Cloud\Deploy\V1\CreateAutomationRequest;
use Google\Cloud\Deploy\V1\CreateCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\CreateDeployPolicyRequest;
use Google\Cloud\Deploy\V1\CreateReleaseRequest;
use Google\Cloud\Deploy\V1\CreateRolloutRequest;
use Google\Cloud\Deploy\V1\CreateTargetRequest;
@@ -52,16 +51,13 @@
use Google\Cloud\Deploy\V1\DeleteAutomationRequest;
use Google\Cloud\Deploy\V1\DeleteCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\DeleteDeployPolicyRequest;
use Google\Cloud\Deploy\V1\DeleteTargetRequest;
use Google\Cloud\Deploy\V1\DeliveryPipeline;
-use Google\Cloud\Deploy\V1\DeployPolicy;
use Google\Cloud\Deploy\V1\GetAutomationRequest;
use Google\Cloud\Deploy\V1\GetAutomationRunRequest;
use Google\Cloud\Deploy\V1\GetConfigRequest;
use Google\Cloud\Deploy\V1\GetCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\GetDeployPolicyRequest;
use Google\Cloud\Deploy\V1\GetJobRunRequest;
use Google\Cloud\Deploy\V1\GetReleaseRequest;
use Google\Cloud\Deploy\V1\GetRolloutRequest;
@@ -77,8 +73,6 @@
use Google\Cloud\Deploy\V1\ListCustomTargetTypesResponse;
use Google\Cloud\Deploy\V1\ListDeliveryPipelinesRequest;
use Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse;
-use Google\Cloud\Deploy\V1\ListDeployPoliciesRequest;
-use Google\Cloud\Deploy\V1\ListDeployPoliciesResponse;
use Google\Cloud\Deploy\V1\ListJobRunsRequest;
use Google\Cloud\Deploy\V1\ListJobRunsResponse;
use Google\Cloud\Deploy\V1\ListReleasesRequest;
@@ -99,7 +93,6 @@
use Google\Cloud\Deploy\V1\UpdateAutomationRequest;
use Google\Cloud\Deploy\V1\UpdateCustomTargetTypeRequest;
use Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest;
-use Google\Cloud\Deploy\V1\UpdateDeployPolicyRequest;
use Google\Cloud\Deploy\V1\UpdateTargetRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
@@ -970,160 +963,6 @@ public function createDeliveryPipelineExceptionTest()
$this->assertTrue($operationsTransport->isExhausted());
}
- /** @test */
- public function createDeployPolicyTest()
- {
- $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/createDeployPolicyTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $suspended = false;
- $etag = 'etag3123477';
- $expectedResponse = new DeployPolicy();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setSuspended($suspended);
- $expectedResponse->setEtag($etag);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createDeployPolicyTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $deployPolicyId = 'deployPolicyId1355226608';
- $deployPolicy = new DeployPolicy();
- $deployPolicySelectors = [];
- $deployPolicy->setSelectors($deployPolicySelectors);
- $deployPolicyRules = [];
- $deployPolicy->setRules($deployPolicyRules);
- $request = (new CreateDeployPolicyRequest())
- ->setParent($formattedParent)
- ->setDeployPolicyId($deployPolicyId)
- ->setDeployPolicy($deployPolicy);
- $response = $gapicClient->createDeployPolicy($request);
- $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/CreateDeployPolicy', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getDeployPolicyId();
- $this->assertProtobufEquals($deployPolicyId, $actualValue);
- $actualValue = $actualApiRequestObject->getDeployPolicy();
- $this->assertProtobufEquals($deployPolicy, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createDeployPolicyTest');
- $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 createDeployPolicyExceptionTest()
- {
- $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/createDeployPolicyTest');
- $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]');
- $deployPolicyId = 'deployPolicyId1355226608';
- $deployPolicy = new DeployPolicy();
- $deployPolicySelectors = [];
- $deployPolicy->setSelectors($deployPolicySelectors);
- $deployPolicyRules = [];
- $deployPolicy->setRules($deployPolicyRules);
- $request = (new CreateDeployPolicyRequest())
- ->setParent($formattedParent)
- ->setDeployPolicyId($deployPolicyId)
- ->setDeployPolicy($deployPolicy);
- $response = $gapicClient->createDeployPolicy($request);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createDeployPolicyTest');
- 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()
{
@@ -1948,128 +1787,6 @@ public function deleteDeliveryPipelineExceptionTest()
$this->assertTrue($operationsTransport->isExhausted());
}
- /** @test */
- public function deleteDeployPolicyTest()
- {
- $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/deleteDeployPolicyTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $expectedResponse = new GPBEmpty();
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/deleteDeployPolicyTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedName = $gapicClient->deployPolicyName('[PROJECT]', '[LOCATION]', '[DEPLOY_POLICY]');
- $request = (new DeleteDeployPolicyRequest())->setName($formattedName);
- $response = $gapicClient->deleteDeployPolicy($request);
- $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/DeleteDeployPolicy', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteDeployPolicyTest');
- $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 deleteDeployPolicyExceptionTest()
- {
- $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/deleteDeployPolicyTest');
- $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->deployPolicyName('[PROJECT]', '[LOCATION]', '[DEPLOY_POLICY]');
- $request = (new DeleteDeployPolicyRequest())->setName($formattedName);
- $response = $gapicClient->deleteDeployPolicy($request);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteDeployPolicyTest');
- 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()
{
@@ -2567,79 +2284,6 @@ public function getDeliveryPipelineExceptionTest()
$this->assertTrue($transport->isExhausted());
}
- /** @test */
- public function getDeployPolicyTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $suspended = false;
- $etag = 'etag3123477';
- $expectedResponse = new DeployPolicy();
- $expectedResponse->setName($name2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setSuspended($suspended);
- $expectedResponse->setEtag($etag);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->deployPolicyName('[PROJECT]', '[LOCATION]', '[DEPLOY_POLICY]');
- $request = (new GetDeployPolicyRequest())->setName($formattedName);
- $response = $gapicClient->getDeployPolicy($request);
- $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/GetDeployPolicy', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getDeployPolicyExceptionTest()
- {
- $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->deployPolicyName('[PROJECT]', '[LOCATION]', '[DEPLOY_POLICY]');
- $request = (new GetDeployPolicyRequest())->setName($formattedName);
- try {
- $gapicClient->getDeployPolicy($request);
- // 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()
{
@@ -3347,77 +2991,6 @@ public function listDeliveryPipelinesExceptionTest()
$this->assertTrue($transport->isExhausted());
}
- /** @test */
- public function listDeployPoliciesTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $deployPoliciesElement = new DeployPolicy();
- $deployPolicies = [$deployPoliciesElement];
- $expectedResponse = new ListDeployPoliciesResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setDeployPolicies($deployPolicies);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListDeployPoliciesRequest())->setParent($formattedParent);
- $response = $gapicClient->listDeployPolicies($request);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getDeployPolicies()[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/ListDeployPolicies', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listDeployPoliciesExceptionTest()
- {
- $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]');
- $request = (new ListDeployPoliciesRequest())->setParent($formattedParent);
- try {
- $gapicClient->listDeployPolicies($request);
- // 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()
{
@@ -4387,150 +3960,6 @@ public function updateDeliveryPipelineExceptionTest()
$this->assertTrue($operationsTransport->isExhausted());
}
- /** @test */
- public function updateDeployPolicyTest()
- {
- $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/updateDeployPolicyTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $suspended = false;
- $etag = 'etag3123477';
- $expectedResponse = new DeployPolicy();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setSuspended($suspended);
- $expectedResponse->setEtag($etag);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/updateDeployPolicyTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $updateMask = new FieldMask();
- $deployPolicy = new DeployPolicy();
- $deployPolicySelectors = [];
- $deployPolicy->setSelectors($deployPolicySelectors);
- $deployPolicyRules = [];
- $deployPolicy->setRules($deployPolicyRules);
- $request = (new UpdateDeployPolicyRequest())->setUpdateMask($updateMask)->setDeployPolicy($deployPolicy);
- $response = $gapicClient->updateDeployPolicy($request);
- $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/UpdateDeployPolicy', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getUpdateMask();
- $this->assertProtobufEquals($updateMask, $actualValue);
- $actualValue = $actualApiRequestObject->getDeployPolicy();
- $this->assertProtobufEquals($deployPolicy, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateDeployPolicyTest');
- $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 updateDeployPolicyExceptionTest()
- {
- $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/updateDeployPolicyTest');
- $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();
- $deployPolicy = new DeployPolicy();
- $deployPolicySelectors = [];
- $deployPolicy->setSelectors($deployPolicySelectors);
- $deployPolicyRules = [];
- $deployPolicy->setRules($deployPolicyRules);
- $request = (new UpdateDeployPolicyRequest())->setUpdateMask($updateMask)->setDeployPolicy($deployPolicy);
- $response = $gapicClient->updateDeployPolicy($request);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateDeployPolicyTest');
- 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()
{