diff --git a/Config/metadata/V1/Config.php b/Config/metadata/V1/Config.php
index 28e38eee8039..60d2b172d494 100644
Binary files a/Config/metadata/V1/Config.php and b/Config/metadata/V1/Config.php differ
diff --git a/Config/samples/V1/ConfigClient/get_terraform_version.php b/Config/samples/V1/ConfigClient/get_terraform_version.php
new file mode 100644
index 000000000000..1985808c019a
--- /dev/null
+++ b/Config/samples/V1/ConfigClient/get_terraform_version.php
@@ -0,0 +1,77 @@
+setName($formattedName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var TerraformVersion $response */
+ $response = $configClient->getTerraformVersion($request);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+
+/**
+ * Helper to execute the sample.
+ *
+ * This sample has been automatically generated and should be regarded as a code
+ * template only. It will require modifications to work:
+ * - It may require correct/in-range values for request initialization.
+ * - It may require specifying regional endpoints when creating the service client,
+ * please see the apiEndpoint client configuration option for more details.
+ */
+function callSample(): void
+{
+ $formattedName = ConfigClient::terraformVersionName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[TERRAFORM_VERSION]'
+ );
+
+ get_terraform_version_sample($formattedName);
+}
+// [END config_v1_generated_Config_GetTerraformVersion_sync]
diff --git a/Config/samples/V1/ConfigClient/list_terraform_versions.php b/Config/samples/V1/ConfigClient/list_terraform_versions.php
new file mode 100644
index 000000000000..5dfc2095ef22
--- /dev/null
+++ b/Config/samples/V1/ConfigClient/list_terraform_versions.php
@@ -0,0 +1,79 @@
+setParent($formattedParent);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $configClient->listTerraformVersions($request);
+
+ /** @var TerraformVersion $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+
+/**
+ * Helper to execute the sample.
+ *
+ * This sample has been automatically generated and should be regarded as a code
+ * template only. It will require modifications to work:
+ * - It may require correct/in-range values for request initialization.
+ * - It may require specifying regional endpoints when creating the service client,
+ * please see the apiEndpoint client configuration option for more details.
+ */
+function callSample(): void
+{
+ $formattedParent = ConfigClient::locationName('[PROJECT]', '[LOCATION]');
+
+ list_terraform_versions_sample($formattedParent);
+}
+// [END config_v1_generated_Config_ListTerraformVersions_sync]
diff --git a/Config/src/V1/Client/ConfigClient.php b/Config/src/V1/Client/ConfigClient.php
index 9154a84317ed..1f968019050e 100644
--- a/Config/src/V1/Client/ConfigClient.php
+++ b/Config/src/V1/Client/ConfigClient.php
@@ -50,17 +50,20 @@
use Google\Cloud\Config\V1\GetPreviewRequest;
use Google\Cloud\Config\V1\GetResourceRequest;
use Google\Cloud\Config\V1\GetRevisionRequest;
+use Google\Cloud\Config\V1\GetTerraformVersionRequest;
use Google\Cloud\Config\V1\ImportStatefileRequest;
use Google\Cloud\Config\V1\ListDeploymentsRequest;
use Google\Cloud\Config\V1\ListPreviewsRequest;
use Google\Cloud\Config\V1\ListResourcesRequest;
use Google\Cloud\Config\V1\ListRevisionsRequest;
+use Google\Cloud\Config\V1\ListTerraformVersionsRequest;
use Google\Cloud\Config\V1\LockDeploymentRequest;
use Google\Cloud\Config\V1\LockInfo;
use Google\Cloud\Config\V1\Preview;
use Google\Cloud\Config\V1\Resource;
use Google\Cloud\Config\V1\Revision;
use Google\Cloud\Config\V1\Statefile;
+use Google\Cloud\Config\V1\TerraformVersion;
use Google\Cloud\Config\V1\UnlockDeploymentRequest;
use Google\Cloud\Config\V1\UpdateDeploymentRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
@@ -99,11 +102,13 @@
* @method PromiseInterface getPreviewAsync(GetPreviewRequest $request, array $optionalArgs = [])
* @method PromiseInterface getResourceAsync(GetResourceRequest $request, array $optionalArgs = [])
* @method PromiseInterface getRevisionAsync(GetRevisionRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface getTerraformVersionAsync(GetTerraformVersionRequest $request, array $optionalArgs = [])
* @method PromiseInterface importStatefileAsync(ImportStatefileRequest $request, array $optionalArgs = [])
* @method PromiseInterface listDeploymentsAsync(ListDeploymentsRequest $request, array $optionalArgs = [])
* @method PromiseInterface listPreviewsAsync(ListPreviewsRequest $request, array $optionalArgs = [])
* @method PromiseInterface listResourcesAsync(ListResourcesRequest $request, array $optionalArgs = [])
* @method PromiseInterface listRevisionsAsync(ListRevisionsRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface listTerraformVersionsAsync(ListTerraformVersionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface lockDeploymentAsync(LockDeploymentRequest $request, array $optionalArgs = [])
* @method PromiseInterface unlockDeploymentAsync(UnlockDeploymentRequest $request, array $optionalArgs = [])
* @method PromiseInterface updateDeploymentAsync(UpdateDeploymentRequest $request, array $optionalArgs = [])
@@ -313,6 +318,25 @@ public static function serviceAccountName(string $project, string $serviceAccoun
]);
}
+ /**
+ * Formats a string containing the fully-qualified path to represent a
+ * terraform_version resource.
+ *
+ * @param string $project
+ * @param string $location
+ * @param string $terraformVersion
+ *
+ * @return string The formatted terraform_version resource.
+ */
+ public static function terraformVersionName(string $project, string $location, string $terraformVersion): string
+ {
+ return self::getPathTemplate('terraformVersion')->render([
+ 'project' => $project,
+ 'location' => $location,
+ 'terraform_version' => $terraformVersion,
+ ]);
+ }
+
/**
* Formats a string containing the fully-qualified path to represent a worker_pool
* resource.
@@ -342,6 +366,7 @@ public static function workerPoolName(string $project, string $location, string
* - resource: projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}
* - revision: projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}
* - serviceAccount: projects/{project}/serviceAccounts/{service_account}
+ * - terraformVersion: projects/{project}/locations/{location}/terraformVersions/{terraform_version}
* - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool}
*
* The optional $template argument can be supplied to specify a particular pattern,
@@ -775,6 +800,33 @@ public function getRevision(GetRevisionRequest $request, array $callOptions = []
return $this->startApiCall('GetRevision', $request, $callOptions)->wait();
}
+ /**
+ * Gets details about a
+ * [TerraformVersion][google.cloud.config.v1.TerraformVersion].
+ *
+ * The async variant is {@see ConfigClient::getTerraformVersionAsync()} .
+ *
+ * @example samples/V1/ConfigClient/get_terraform_version.php
+ *
+ * @param GetTerraformVersionRequest $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 TerraformVersion
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function getTerraformVersion(GetTerraformVersionRequest $request, array $callOptions = []): TerraformVersion
+ {
+ return $this->startApiCall('GetTerraformVersion', $request, $callOptions)->wait();
+ }
+
/**
* Imports Terraform state file in a given deployment. The state file does not
* take effect until the Deployment has been unlocked.
@@ -908,6 +960,35 @@ public function listRevisions(ListRevisionsRequest $request, array $callOptions
return $this->startApiCall('ListRevisions', $request, $callOptions);
}
+ /**
+ * Lists [TerraformVersion][google.cloud.config.v1.TerraformVersion]s in a
+ * given project and location.
+ *
+ * The async variant is {@see ConfigClient::listTerraformVersionsAsync()} .
+ *
+ * @example samples/V1/ConfigClient/list_terraform_versions.php
+ *
+ * @param ListTerraformVersionsRequest $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 listTerraformVersions(
+ ListTerraformVersionsRequest $request,
+ array $callOptions = []
+ ): PagedListResponse {
+ return $this->startApiCall('ListTerraformVersions', $request, $callOptions);
+ }
+
/**
* Locks a deployment.
*
diff --git a/Config/src/V1/Deployment.php b/Config/src/V1/Deployment.php
index ffbc0ffb36c4..d5297bcbd612 100644
--- a/Config/src/V1/Deployment.php
+++ b/Config/src/V1/Deployment.php
@@ -150,6 +150,28 @@ class Deployment extends \Google\Protobuf\Internal\Message
* Generated from protobuf field .google.cloud.config.v1.Deployment.LockState lock_state = 20 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
protected $lock_state = 0;
+ /**
+ * Optional. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ *
+ * Generated from protobuf field optional string tf_version_constraint = 21 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $tf_version_constraint = null;
+ /**
+ * Output only. The current Terraform version set on the deployment.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ *
+ * Generated from protobuf field string tf_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $tf_version = '';
+ /**
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.QuotaValidation quota_validation = 23 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $quota_validation = 0;
protected $blueprint;
/**
@@ -223,6 +245,16 @@ class Deployment extends \Google\Protobuf\Internal\Message
* used.
* @type int $lock_state
* Output only. Current lock state of the deployment.
+ * @type string $tf_version_constraint
+ * Optional. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ * @type string $tf_version
+ * Output only. The current Terraform version set on the deployment.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ * @type int $quota_validation
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
* }
*/
public function __construct($data = NULL) {
@@ -853,6 +885,102 @@ public function setLockState($var)
return $this;
}
+ /**
+ * Optional. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ *
+ * Generated from protobuf field optional string tf_version_constraint = 21 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getTfVersionConstraint()
+ {
+ return isset($this->tf_version_constraint) ? $this->tf_version_constraint : '';
+ }
+
+ public function hasTfVersionConstraint()
+ {
+ return isset($this->tf_version_constraint);
+ }
+
+ public function clearTfVersionConstraint()
+ {
+ unset($this->tf_version_constraint);
+ }
+
+ /**
+ * Optional. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ *
+ * Generated from protobuf field optional string tf_version_constraint = 21 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setTfVersionConstraint($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->tf_version_constraint = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. The current Terraform version set on the deployment.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ *
+ * Generated from protobuf field string tf_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return string
+ */
+ public function getTfVersion()
+ {
+ return $this->tf_version;
+ }
+
+ /**
+ * Output only. The current Terraform version set on the deployment.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ *
+ * Generated from protobuf field string tf_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param string $var
+ * @return $this
+ */
+ public function setTfVersion($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->tf_version = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.QuotaValidation quota_validation = 23 [(.google.api.field_behavior) = OPTIONAL];
+ * @return int
+ */
+ public function getQuotaValidation()
+ {
+ return $this->quota_validation;
+ }
+
+ /**
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.QuotaValidation quota_validation = 23 [(.google.api.field_behavior) = OPTIONAL];
+ * @param int $var
+ * @return $this
+ */
+ public function setQuotaValidation($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\Config\V1\QuotaValidation::class);
+ $this->quota_validation = $var;
+
+ return $this;
+ }
+
/**
* @return string
*/
diff --git a/Config/src/V1/DeploymentOperationMetadata/DeploymentStep.php b/Config/src/V1/DeploymentOperationMetadata/DeploymentStep.php
index 2f57bb05e72f..bed4ae8eca70 100644
--- a/Config/src/V1/DeploymentOperationMetadata/DeploymentStep.php
+++ b/Config/src/V1/DeploymentOperationMetadata/DeploymentStep.php
@@ -80,6 +80,18 @@ class DeploymentStep
* Generated from protobuf enum FAILED = 10;
*/
const FAILED = 10;
+ /**
+ * Validating the provided repository.
+ *
+ * Generated from protobuf enum VALIDATING_REPOSITORY = 11;
+ */
+ const VALIDATING_REPOSITORY = 11;
+ /**
+ * Running quota validation
+ *
+ * Generated from protobuf enum RUNNING_QUOTA_VALIDATION = 12;
+ */
+ const RUNNING_QUOTA_VALIDATION = 12;
private static $valueToName = [
self::DEPLOYMENT_STEP_UNSPECIFIED => 'DEPLOYMENT_STEP_UNSPECIFIED',
@@ -93,6 +105,8 @@ class DeploymentStep
self::UNLOCKING_DEPLOYMENT => 'UNLOCKING_DEPLOYMENT',
self::SUCCEEDED => 'SUCCEEDED',
self::FAILED => 'FAILED',
+ self::VALIDATING_REPOSITORY => 'VALIDATING_REPOSITORY',
+ self::RUNNING_QUOTA_VALIDATION => 'RUNNING_QUOTA_VALIDATION',
];
public static function name($value)
diff --git a/Config/src/V1/GetTerraformVersionRequest.php b/Config/src/V1/GetTerraformVersionRequest.php
new file mode 100644
index 000000000000..3808e68209da
--- /dev/null
+++ b/Config/src/V1/GetTerraformVersionRequest.php
@@ -0,0 +1,86 @@
+google.cloud.config.v1.GetTerraformVersionRequest
+ */
+class GetTerraformVersionRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The name of the TerraformVersion. Format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $name = '';
+
+ /**
+ * @param string $name Required. The name of the TerraformVersion. Format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
+ * Please see {@see ConfigClient::terraformVersionName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\Config\V1\GetTerraformVersionRequest
+ *
+ * @experimental
+ */
+ public static function build(string $name): self
+ {
+ return (new self())
+ ->setName($name);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Required. The name of the TerraformVersion. Format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Config\V1\Config::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The name of the TerraformVersion. Format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Required. The name of the TerraformVersion. Format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/Config/src/V1/ListDeploymentsRequest.php b/Config/src/V1/ListDeploymentsRequest.php
index 2b95752ce25c..b5aca6b46201 100644
--- a/Config/src/V1/ListDeploymentsRequest.php
+++ b/Config/src/V1/ListDeploymentsRequest.php
@@ -23,8 +23,8 @@ class ListDeploymentsRequest extends \Google\Protobuf\Internal\Message
protected $parent = '';
/**
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
*/
@@ -94,8 +94,8 @@ public static function build(string $parent): self
* 'projects/{project_id}/locations/{location}'.
* @type int $page_size
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
* @type string $page_token
* Token returned by previous call to 'ListDeployments' which specifies the
* position in the list from where to continue listing the resources.
@@ -159,8 +159,8 @@ public function setParent($var)
/**
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
* @return int
@@ -172,8 +172,8 @@ public function getPageSize()
/**
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
* @param int $var
diff --git a/Config/src/V1/ListPreviewsRequest.php b/Config/src/V1/ListPreviewsRequest.php
index fc6b8c0867dd..a1f19e2cae2d 100644
--- a/Config/src/V1/ListPreviewsRequest.php
+++ b/Config/src/V1/ListPreviewsRequest.php
@@ -24,8 +24,8 @@ class ListPreviewsRequest extends \Google\Protobuf\Internal\Message
protected $parent = '';
/**
* Optional. When requesting a page of resources, 'page_size' specifies number
- * of resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
@@ -94,8 +94,8 @@ public static function build(string $parent): self
* value is in the format: 'projects/{project_id}/locations/{location}'.
* @type int $page_size
* Optional. When requesting a page of resources, 'page_size' specifies number
- * of resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
* @type string $page_token
* Optional. Token returned by previous call to 'ListDeployments' which
* specifies the position in the list from where to continue listing the
@@ -158,8 +158,8 @@ public function setParent($var)
/**
* Optional. When requesting a page of resources, 'page_size' specifies number
- * of resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
* @return int
@@ -171,8 +171,8 @@ public function getPageSize()
/**
* Optional. When requesting a page of resources, 'page_size' specifies number
- * of resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
* @param int $var
diff --git a/Config/src/V1/ListResourcesRequest.php b/Config/src/V1/ListResourcesRequest.php
index 19d85031885e..a85db19b3c23 100644
--- a/Config/src/V1/ListResourcesRequest.php
+++ b/Config/src/V1/ListResourcesRequest.php
@@ -25,8 +25,8 @@ class ListResourcesRequest extends \Google\Protobuf\Internal\Message
protected $parent = '';
/**
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
*/
@@ -90,8 +90,8 @@ public static function build(string $parent): self
* 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
* @type int $page_size
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
* @type string $page_token
* Token returned by previous call to 'ListResources' which specifies the
* position in the list from where to continue listing the resources.
@@ -149,8 +149,8 @@ public function setParent($var)
/**
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
* @return int
@@ -162,8 +162,8 @@ public function getPageSize()
/**
* When requesting a page of resources, 'page_size' specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
* @param int $var
diff --git a/Config/src/V1/ListRevisionsRequest.php b/Config/src/V1/ListRevisionsRequest.php
index 07095f52928b..017b31cc9b52 100644
--- a/Config/src/V1/ListRevisionsRequest.php
+++ b/Config/src/V1/ListRevisionsRequest.php
@@ -25,8 +25,8 @@ class ListRevisionsRequest extends \Google\Protobuf\Internal\Message
protected $parent = '';
/**
* When requesting a page of resources, `page_size` specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
*/
@@ -96,8 +96,8 @@ public static function build(string $parent): self
* 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
* @type int $page_size
* When requesting a page of resources, `page_size` specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
* @type string $page_token
* Token returned by previous call to 'ListRevisions' which specifies the
* position in the list from where to continue listing the resources.
@@ -161,8 +161,8 @@ public function setParent($var)
/**
* When requesting a page of resources, `page_size` specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
* @return int
@@ -174,8 +174,8 @@ public function getPageSize()
/**
* When requesting a page of resources, `page_size` specifies number of
- * resources to return. If unspecified or set to 0, all resources will be
- * returned.
+ * resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
*
* Generated from protobuf field int32 page_size = 2;
* @param int $var
diff --git a/Config/src/V1/ListTerraformVersionsRequest.php b/Config/src/V1/ListTerraformVersionsRequest.php
new file mode 100644
index 000000000000..d396c7211a6e
--- /dev/null
+++ b/Config/src/V1/ListTerraformVersionsRequest.php
@@ -0,0 +1,271 @@
+google.cloud.config.v1.ListTerraformVersionsRequest
+ */
+class ListTerraformVersionsRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The parent in whose context the TerraformVersions are listed. The
+ * parent value is in the format:
+ * 'projects/{project_id}/locations/{location}'.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $parent = '';
+ /**
+ * Optional. When requesting a page of resources, 'page_size' specifies number
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
+ *
+ * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $page_size = 0;
+ /**
+ * Optional. Token returned by previous call to 'ListTerraformVersions' which
+ * specifies the position in the list from where to continue listing the
+ * resources.
+ *
+ * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $page_token = '';
+ /**
+ * Optional. Lists the TerraformVersions that match the filter expression. A
+ * filter expression filters the resources listed in the response. The
+ * expression must be of the form '{field} {operator} {value}' where
+ * operators: '<', '>',
+ * '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
+ * operator which is roughly synonymous with equality). {field} can refer to a
+ * proto or JSON field, or a synthetic field. Field names can be camelCase or
+ * snake_case.
+ *
+ * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $filter = '';
+ /**
+ * Optional. Field to use to sort the list.
+ *
+ * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $order_by = '';
+
+ /**
+ * @param string $parent Required. The parent in whose context the TerraformVersions are listed. The
+ * parent value is in the format:
+ * 'projects/{project_id}/locations/{location}'. Please see
+ * {@see ConfigClient::locationName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\Config\V1\ListTerraformVersionsRequest
+ *
+ * @experimental
+ */
+ public static function build(string $parent): self
+ {
+ return (new self())
+ ->setParent($parent);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $parent
+ * Required. The parent in whose context the TerraformVersions are listed. The
+ * parent value is in the format:
+ * 'projects/{project_id}/locations/{location}'.
+ * @type int $page_size
+ * Optional. When requesting a page of resources, 'page_size' specifies number
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
+ * @type string $page_token
+ * Optional. Token returned by previous call to 'ListTerraformVersions' which
+ * specifies the position in the list from where to continue listing the
+ * resources.
+ * @type string $filter
+ * Optional. Lists the TerraformVersions that match the filter expression. A
+ * filter expression filters the resources listed in the response. The
+ * expression must be of the form '{field} {operator} {value}' where
+ * operators: '<', '>',
+ * '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
+ * operator which is roughly synonymous with equality). {field} can refer to a
+ * proto or JSON field, or a synthetic field. Field names can be camelCase or
+ * snake_case.
+ * @type string $order_by
+ * Optional. Field to use to sort the list.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Config\V1\Config::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The parent in whose context the TerraformVersions are listed. The
+ * parent value is in the format:
+ * 'projects/{project_id}/locations/{location}'.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Required. The parent in whose context the TerraformVersions are listed. The
+ * parent value is in the format:
+ * 'projects/{project_id}/locations/{location}'.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setParent($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->parent = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. When requesting a page of resources, 'page_size' specifies number
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
+ *
+ * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ * @return int
+ */
+ public function getPageSize()
+ {
+ return $this->page_size;
+ }
+
+ /**
+ * Optional. When requesting a page of resources, 'page_size' specifies number
+ * of resources to return. If unspecified, at most 500 will be returned. The
+ * maximum value is 1000.
+ *
+ * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ * @param int $var
+ * @return $this
+ */
+ public function setPageSize($var)
+ {
+ GPBUtil::checkInt32($var);
+ $this->page_size = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Token returned by previous call to 'ListTerraformVersions' which
+ * specifies the position in the list from where to continue listing the
+ * resources.
+ *
+ * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getPageToken()
+ {
+ return $this->page_token;
+ }
+
+ /**
+ * Optional. Token returned by previous call to 'ListTerraformVersions' which
+ * specifies the position in the list from where to continue listing the
+ * resources.
+ *
+ * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setPageToken($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->page_token = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Lists the TerraformVersions that match the filter expression. A
+ * filter expression filters the resources listed in the response. The
+ * expression must be of the form '{field} {operator} {value}' where
+ * operators: '<', '>',
+ * '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
+ * operator which is roughly synonymous with equality). {field} can refer to a
+ * proto or JSON field, or a synthetic field. Field names can be camelCase or
+ * snake_case.
+ *
+ * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getFilter()
+ {
+ return $this->filter;
+ }
+
+ /**
+ * Optional. Lists the TerraformVersions that match the filter expression. A
+ * filter expression filters the resources listed in the response. The
+ * expression must be of the form '{field} {operator} {value}' where
+ * operators: '<', '>',
+ * '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
+ * operator which is roughly synonymous with equality). {field} can refer to a
+ * proto or JSON field, or a synthetic field. Field names can be camelCase or
+ * snake_case.
+ *
+ * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setFilter($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->filter = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Field to use to sort the list.
+ *
+ * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getOrderBy()
+ {
+ return $this->order_by;
+ }
+
+ /**
+ * Optional. Field to use to sort the list.
+ *
+ * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setOrderBy($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->order_by = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/Config/src/V1/ListTerraformVersionsResponse.php b/Config/src/V1/ListTerraformVersionsResponse.php
new file mode 100644
index 000000000000..db79ce1618bf
--- /dev/null
+++ b/Config/src/V1/ListTerraformVersionsResponse.php
@@ -0,0 +1,139 @@
+google.cloud.config.v1.ListTerraformVersionsResponse
+ */
+class ListTerraformVersionsResponse extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
+ *
+ * Generated from protobuf field repeated .google.cloud.config.v1.TerraformVersion terraform_versions = 1;
+ */
+ private $terraform_versions;
+ /**
+ * Token to be supplied to the next ListTerraformVersions request via
+ * `page_token` to obtain the next set of results.
+ *
+ * Generated from protobuf field string next_page_token = 2;
+ */
+ protected $next_page_token = '';
+ /**
+ * Unreachable resources, if any.
+ *
+ * Generated from protobuf field repeated string unreachable = 3;
+ */
+ private $unreachable;
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type array<\Google\Cloud\Config\V1\TerraformVersion>|\Google\Protobuf\Internal\RepeatedField $terraform_versions
+ * List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
+ * @type string $next_page_token
+ * Token to be supplied to the next ListTerraformVersions request via
+ * `page_token` to obtain the next set of results.
+ * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable
+ * Unreachable resources, if any.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Config\V1\Config::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
+ *
+ * Generated from protobuf field repeated .google.cloud.config.v1.TerraformVersion terraform_versions = 1;
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getTerraformVersions()
+ {
+ return $this->terraform_versions;
+ }
+
+ /**
+ * List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
+ *
+ * Generated from protobuf field repeated .google.cloud.config.v1.TerraformVersion terraform_versions = 1;
+ * @param array<\Google\Cloud\Config\V1\TerraformVersion>|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setTerraformVersions($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Config\V1\TerraformVersion::class);
+ $this->terraform_versions = $arr;
+
+ return $this;
+ }
+
+ /**
+ * Token to be supplied to the next ListTerraformVersions request via
+ * `page_token` to obtain the next set of results.
+ *
+ * Generated from protobuf field string next_page_token = 2;
+ * @return string
+ */
+ public function getNextPageToken()
+ {
+ return $this->next_page_token;
+ }
+
+ /**
+ * Token to be supplied to the next ListTerraformVersions request via
+ * `page_token` to obtain the next set of results.
+ *
+ * Generated from protobuf field string next_page_token = 2;
+ * @param string $var
+ * @return $this
+ */
+ public function setNextPageToken($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->next_page_token = $var;
+
+ return $this;
+ }
+
+ /**
+ * Unreachable resources, if any.
+ *
+ * Generated from protobuf field repeated string unreachable = 3;
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getUnreachable()
+ {
+ return $this->unreachable;
+ }
+
+ /**
+ * Unreachable resources, if any.
+ *
+ * Generated from protobuf field repeated string unreachable = 3;
+ * @param array|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setUnreachable($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+ $this->unreachable = $arr;
+
+ return $this;
+ }
+
+}
+
diff --git a/Config/src/V1/Preview.php b/Config/src/V1/Preview.php
index 340fef8e81e3..e2ee4206c55c 100644
--- a/Config/src/V1/Preview.php
+++ b/Config/src/V1/Preview.php
@@ -59,9 +59,9 @@ class Preview extends \Google\Protobuf\Internal\Message
*/
protected $preview_mode = 0;
/**
- * Optional. Optional service account. If omitted, the deployment resource
- * reference must be provided, and the service account attached to the
- * deployment will be used.
+ * Optional. User-specified Service Account (SA) credentials to be used when
+ * previewing resources.
+ * Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
*
* Generated from protobuf field string service_account = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
*/
@@ -165,9 +165,9 @@ class Preview extends \Google\Protobuf\Internal\Message
* @type int $preview_mode
* Optional. Current mode of preview.
* @type string $service_account
- * Optional. Optional service account. If omitted, the deployment resource
- * reference must be provided, and the service account attached to the
- * deployment will be used.
+ * Optional. User-specified Service Account (SA) credentials to be used when
+ * previewing resources.
+ * Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
* @type string $artifacts_gcs_bucket
* Optional. User-defined location of Cloud Build logs, artifacts, and
* in Google Cloud Storage.
@@ -418,9 +418,9 @@ public function setPreviewMode($var)
}
/**
- * Optional. Optional service account. If omitted, the deployment resource
- * reference must be provided, and the service account attached to the
- * deployment will be used.
+ * Optional. User-specified Service Account (SA) credentials to be used when
+ * previewing resources.
+ * Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
*
* Generated from protobuf field string service_account = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
* @return string
@@ -431,9 +431,9 @@ public function getServiceAccount()
}
/**
- * Optional. Optional service account. If omitted, the deployment resource
- * reference must be provided, and the service account attached to the
- * deployment will be used.
+ * Optional. User-specified Service Account (SA) credentials to be used when
+ * previewing resources.
+ * Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
*
* Generated from protobuf field string service_account = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
* @param string $var
diff --git a/Config/src/V1/PreviewOperationMetadata/PreviewStep.php b/Config/src/V1/PreviewOperationMetadata/PreviewStep.php
index 6f239aeb989c..fc21d2504c2b 100644
--- a/Config/src/V1/PreviewOperationMetadata/PreviewStep.php
+++ b/Config/src/V1/PreviewOperationMetadata/PreviewStep.php
@@ -74,6 +74,12 @@ class PreviewStep
* Generated from protobuf enum FAILED = 9;
*/
const FAILED = 9;
+ /**
+ * Validating the provided repository.
+ *
+ * Generated from protobuf enum VALIDATING_REPOSITORY = 10;
+ */
+ const VALIDATING_REPOSITORY = 10;
private static $valueToName = [
self::PREVIEW_STEP_UNSPECIFIED => 'PREVIEW_STEP_UNSPECIFIED',
@@ -86,6 +92,7 @@ class PreviewStep
self::UNLOCKING_DEPLOYMENT => 'UNLOCKING_DEPLOYMENT',
self::SUCCEEDED => 'SUCCEEDED',
self::FAILED => 'FAILED',
+ self::VALIDATING_REPOSITORY => 'VALIDATING_REPOSITORY',
];
public static function name($value)
diff --git a/Config/src/V1/QuotaValidation.php b/Config/src/V1/QuotaValidation.php
new file mode 100644
index 000000000000..60210b30d50c
--- /dev/null
+++ b/Config/src/V1/QuotaValidation.php
@@ -0,0 +1,66 @@
+google.cloud.config.v1.QuotaValidation
+ */
+class QuotaValidation
+{
+ /**
+ * The default value.
+ * QuotaValidation on terraform configuration files will be disabled in
+ * this case.
+ *
+ * Generated from protobuf enum QUOTA_VALIDATION_UNSPECIFIED = 0;
+ */
+ const QUOTA_VALIDATION_UNSPECIFIED = 0;
+ /**
+ * Enable computing quotas for resources in terraform configuration files to
+ * get visibility on resources with insufficient quotas.
+ *
+ * Generated from protobuf enum ENABLED = 1;
+ */
+ const ENABLED = 1;
+ /**
+ * Enforce quota checks so deployment fails if there isn't sufficient quotas
+ * available to deploy resources in terraform configuration files.
+ *
+ * Generated from protobuf enum ENFORCED = 2;
+ */
+ const ENFORCED = 2;
+
+ private static $valueToName = [
+ self::QUOTA_VALIDATION_UNSPECIFIED => 'QUOTA_VALIDATION_UNSPECIFIED',
+ self::ENABLED => 'ENABLED',
+ self::ENFORCED => 'ENFORCED',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
diff --git a/Config/src/V1/Revision.php b/Config/src/V1/Revision.php
index e90790a233f7..d59d20bacce5 100644
--- a/Config/src/V1/Revision.php
+++ b/Config/src/V1/Revision.php
@@ -124,6 +124,36 @@ class Revision extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string worker_pool = 17 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
protected $worker_pool = '';
+ /**
+ * Output only. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ *
+ * Generated from protobuf field string tf_version_constraint = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $tf_version_constraint = '';
+ /**
+ * Output only. The version of Terraform used to create the Revision.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ *
+ * Generated from protobuf field string tf_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $tf_version = '';
+ /**
+ * Output only. Cloud Storage path containing quota validation results. This
+ * field is set when a user sets Deployment.quota_validation field to ENABLED
+ * or ENFORCED. Format: `gs://{bucket}/{object}`.
+ *
+ * Generated from protobuf field string quota_validation_results = 29 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $quota_validation_results = '';
+ /**
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.QuotaValidation quota_validation = 20 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $quota_validation = 0;
protected $blueprint;
/**
@@ -182,6 +212,20 @@ class Revision extends \Google\Protobuf\Internal\Message
* `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
* If this field is unspecified, the default Cloud Build worker pool will be
* used.
+ * @type string $tf_version_constraint
+ * Output only. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ * @type string $tf_version
+ * Output only. The version of Terraform used to create the Revision.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ * @type string $quota_validation_results
+ * Output only. Cloud Storage path containing quota validation results. This
+ * field is set when a user sets Deployment.quota_validation field to ENABLED
+ * or ENFORCED. Format: `gs://{bucket}/{object}`.
+ * @type int $quota_validation
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
* }
*/
public function __construct($data = NULL) {
@@ -676,6 +720,122 @@ public function setWorkerPool($var)
return $this;
}
+ /**
+ * Output only. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ *
+ * Generated from protobuf field string tf_version_constraint = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return string
+ */
+ public function getTfVersionConstraint()
+ {
+ return $this->tf_version_constraint;
+ }
+
+ /**
+ * Output only. The user-specified Terraform version constraint.
+ * Example: "=1.3.10".
+ *
+ * Generated from protobuf field string tf_version_constraint = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param string $var
+ * @return $this
+ */
+ public function setTfVersionConstraint($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->tf_version_constraint = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. The version of Terraform used to create the Revision.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ *
+ * Generated from protobuf field string tf_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return string
+ */
+ public function getTfVersion()
+ {
+ return $this->tf_version;
+ }
+
+ /**
+ * Output only. The version of Terraform used to create the Revision.
+ * It is in the format of "Major.Minor.Patch", for example, "1.3.10".
+ *
+ * Generated from protobuf field string tf_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param string $var
+ * @return $this
+ */
+ public function setTfVersion($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->tf_version = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. Cloud Storage path containing quota validation results. This
+ * field is set when a user sets Deployment.quota_validation field to ENABLED
+ * or ENFORCED. Format: `gs://{bucket}/{object}`.
+ *
+ * Generated from protobuf field string quota_validation_results = 29 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return string
+ */
+ public function getQuotaValidationResults()
+ {
+ return $this->quota_validation_results;
+ }
+
+ /**
+ * Output only. Cloud Storage path containing quota validation results. This
+ * field is set when a user sets Deployment.quota_validation field to ENABLED
+ * or ENFORCED. Format: `gs://{bucket}/{object}`.
+ *
+ * Generated from protobuf field string quota_validation_results = 29 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param string $var
+ * @return $this
+ */
+ public function setQuotaValidationResults($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->quota_validation_results = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.QuotaValidation quota_validation = 20 [(.google.api.field_behavior) = OPTIONAL];
+ * @return int
+ */
+ public function getQuotaValidation()
+ {
+ return $this->quota_validation;
+ }
+
+ /**
+ * Optional. Input to control quota checks for resources in terraform
+ * configuration files. There are limited resources on which quota validation
+ * applies.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.QuotaValidation quota_validation = 20 [(.google.api.field_behavior) = OPTIONAL];
+ * @param int $var
+ * @return $this
+ */
+ public function setQuotaValidation($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\Config\V1\QuotaValidation::class);
+ $this->quota_validation = $var;
+
+ return $this;
+ }
+
/**
* @return string
*/
diff --git a/Config/src/V1/Revision/ErrorCode.php b/Config/src/V1/Revision/ErrorCode.php
index 396aa64ddd3a..3c53f564698b 100644
--- a/Config/src/V1/Revision/ErrorCode.php
+++ b/Config/src/V1/Revision/ErrorCode.php
@@ -39,12 +39,20 @@ class ErrorCode
* Generated from protobuf enum APPLY_BUILD_RUN_FAILED = 5;
*/
const APPLY_BUILD_RUN_FAILED = 5;
+ /**
+ * quota validation failed for one or more resources in terraform
+ * configuration files.
+ *
+ * Generated from protobuf enum QUOTA_VALIDATION_FAILED = 7;
+ */
+ const QUOTA_VALIDATION_FAILED = 7;
private static $valueToName = [
self::ERROR_CODE_UNSPECIFIED => 'ERROR_CODE_UNSPECIFIED',
self::CLOUD_BUILD_PERMISSION_DENIED => 'CLOUD_BUILD_PERMISSION_DENIED',
self::APPLY_BUILD_API_FAILED => 'APPLY_BUILD_API_FAILED',
self::APPLY_BUILD_RUN_FAILED => 'APPLY_BUILD_RUN_FAILED',
+ self::QUOTA_VALIDATION_FAILED => 'QUOTA_VALIDATION_FAILED',
];
public static function name($value)
diff --git a/Config/src/V1/TerraformVersion.php b/Config/src/V1/TerraformVersion.php
new file mode 100644
index 000000000000..15be7f36d1d1
--- /dev/null
+++ b/Config/src/V1/TerraformVersion.php
@@ -0,0 +1,238 @@
+google.cloud.config.v1.TerraformVersion
+ */
+class TerraformVersion extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Identifier. The version name is in the format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
+ */
+ protected $name = '';
+ /**
+ * Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.TerraformVersion.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $state = 0;
+ /**
+ * Output only. When the version is supported.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp support_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $support_time = null;
+ /**
+ * Output only. When the version is deprecated.
+ *
+ * Generated from protobuf field optional .google.protobuf.Timestamp deprecate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $deprecate_time = null;
+ /**
+ * Output only. When the version is obsolete.
+ *
+ * Generated from protobuf field optional .google.protobuf.Timestamp obsolete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $obsolete_time = null;
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Identifier. The version name is in the format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
+ * @type int $state
+ * Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
+ * @type \Google\Protobuf\Timestamp $support_time
+ * Output only. When the version is supported.
+ * @type \Google\Protobuf\Timestamp $deprecate_time
+ * Output only. When the version is deprecated.
+ * @type \Google\Protobuf\Timestamp $obsolete_time
+ * Output only. When the version is obsolete.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Config\V1\Config::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Identifier. The version name is in the format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Identifier. The version name is in the format:
+ * 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.TerraformVersion.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return int
+ */
+ public function getState()
+ {
+ return $this->state;
+ }
+
+ /**
+ * Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
+ *
+ * Generated from protobuf field .google.cloud.config.v1.TerraformVersion.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param int $var
+ * @return $this
+ */
+ public function setState($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\Config\V1\TerraformVersion\State::class);
+ $this->state = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. When the version is supported.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp support_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return \Google\Protobuf\Timestamp|null
+ */
+ public function getSupportTime()
+ {
+ return $this->support_time;
+ }
+
+ public function hasSupportTime()
+ {
+ return isset($this->support_time);
+ }
+
+ public function clearSupportTime()
+ {
+ unset($this->support_time);
+ }
+
+ /**
+ * Output only. When the version is supported.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp support_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param \Google\Protobuf\Timestamp $var
+ * @return $this
+ */
+ public function setSupportTime($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
+ $this->support_time = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. When the version is deprecated.
+ *
+ * Generated from protobuf field optional .google.protobuf.Timestamp deprecate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return \Google\Protobuf\Timestamp|null
+ */
+ public function getDeprecateTime()
+ {
+ return $this->deprecate_time;
+ }
+
+ public function hasDeprecateTime()
+ {
+ return isset($this->deprecate_time);
+ }
+
+ public function clearDeprecateTime()
+ {
+ unset($this->deprecate_time);
+ }
+
+ /**
+ * Output only. When the version is deprecated.
+ *
+ * Generated from protobuf field optional .google.protobuf.Timestamp deprecate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param \Google\Protobuf\Timestamp $var
+ * @return $this
+ */
+ public function setDeprecateTime($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
+ $this->deprecate_time = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. When the version is obsolete.
+ *
+ * Generated from protobuf field optional .google.protobuf.Timestamp obsolete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return \Google\Protobuf\Timestamp|null
+ */
+ public function getObsoleteTime()
+ {
+ return $this->obsolete_time;
+ }
+
+ public function hasObsoleteTime()
+ {
+ return isset($this->obsolete_time);
+ }
+
+ public function clearObsoleteTime()
+ {
+ unset($this->obsolete_time);
+ }
+
+ /**
+ * Output only. When the version is obsolete.
+ *
+ * Generated from protobuf field optional .google.protobuf.Timestamp obsolete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param \Google\Protobuf\Timestamp $var
+ * @return $this
+ */
+ public function setObsoleteTime($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
+ $this->obsolete_time = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/Config/src/V1/TerraformVersion/State.php b/Config/src/V1/TerraformVersion/State.php
new file mode 100644
index 000000000000..e9b33658097e
--- /dev/null
+++ b/Config/src/V1/TerraformVersion/State.php
@@ -0,0 +1,69 @@
+google.cloud.config.v1.TerraformVersion.State
+ */
+class State
+{
+ /**
+ * The default value. This value is used if the state is omitted.
+ *
+ * Generated from protobuf enum STATE_UNSPECIFIED = 0;
+ */
+ const STATE_UNSPECIFIED = 0;
+ /**
+ * The version is actively supported.
+ *
+ * Generated from protobuf enum ACTIVE = 1;
+ */
+ const ACTIVE = 1;
+ /**
+ * The version is deprecated.
+ *
+ * Generated from protobuf enum DEPRECATED = 2;
+ */
+ const DEPRECATED = 2;
+ /**
+ * The version is obsolete.
+ *
+ * Generated from protobuf enum OBSOLETE = 3;
+ */
+ const OBSOLETE = 3;
+
+ private static $valueToName = [
+ self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
+ self::ACTIVE => 'ACTIVE',
+ self::DEPRECATED => 'DEPRECATED',
+ self::OBSOLETE => 'OBSOLETE',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
+
diff --git a/Config/src/V1/gapic_metadata.json b/Config/src/V1/gapic_metadata.json
index 691728bb0612..17aca320234b 100644
--- a/Config/src/V1/gapic_metadata.json
+++ b/Config/src/V1/gapic_metadata.json
@@ -75,6 +75,11 @@
"getRevision"
]
},
+ "GetTerraformVersion": {
+ "methods": [
+ "getTerraformVersion"
+ ]
+ },
"ImportStatefile": {
"methods": [
"importStatefile"
@@ -100,6 +105,11 @@
"listRevisions"
]
},
+ "ListTerraformVersions": {
+ "methods": [
+ "listTerraformVersions"
+ ]
+ },
"LockDeployment": {
"methods": [
"lockDeployment"
diff --git a/Config/src/V1/resources/config_client_config.json b/Config/src/V1/resources/config_client_config.json
index cf6c525f4090..6ea63ea32572 100644
--- a/Config/src/V1/resources/config_client_config.json
+++ b/Config/src/V1/resources/config_client_config.json
@@ -85,6 +85,11 @@
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
+ "GetTerraformVersion": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "idempotent",
+ "retry_params_name": "default"
+ },
"ImportStatefile": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
@@ -110,6 +115,11 @@
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
+ "ListTerraformVersions": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "idempotent",
+ "retry_params_name": "default"
+ },
"LockDeployment": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
diff --git a/Config/src/V1/resources/config_descriptor_config.php b/Config/src/V1/resources/config_descriptor_config.php
index 0d17a4f188ae..6937c9679f4a 100644
--- a/Config/src/V1/resources/config_descriptor_config.php
+++ b/Config/src/V1/resources/config_descriptor_config.php
@@ -245,6 +245,18 @@
],
],
],
+ 'GetTerraformVersion' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Cloud\Config\V1\TerraformVersion',
+ 'headerParams' => [
+ [
+ 'keyName' => 'name',
+ 'fieldAccessors' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'ImportStatefile' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\Config\V1\Statefile',
@@ -337,6 +349,26 @@
],
],
],
+ 'ListTerraformVersions' => [
+ 'pageStreaming' => [
+ 'requestPageTokenGetMethod' => 'getPageToken',
+ 'requestPageTokenSetMethod' => 'setPageToken',
+ 'requestPageSizeGetMethod' => 'getPageSize',
+ 'requestPageSizeSetMethod' => 'setPageSize',
+ 'responsePageTokenGetMethod' => 'getNextPageToken',
+ 'resourcesGetMethod' => 'getTerraformVersions',
+ ],
+ 'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
+ 'responseType' => 'Google\Cloud\Config\V1\ListTerraformVersionsResponse',
+ 'headerParams' => [
+ [
+ 'keyName' => 'parent',
+ 'fieldAccessors' => [
+ 'getParent',
+ ],
+ ],
+ ],
+ ],
'GetLocation' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\Location\Location',
@@ -417,6 +449,7 @@
'resource' => 'projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}',
'revision' => 'projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}',
'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}',
+ 'terraformVersion' => 'projects/{project}/locations/{location}/terraformVersions/{terraform_version}',
'workerPool' => 'projects/{project}/locations/{location}/workerPools/{worker_pool}',
],
],
diff --git a/Config/src/V1/resources/config_rest_client_config.php b/Config/src/V1/resources/config_rest_client_config.php
index 07c000095e19..a3cbbd7e11a8 100644
--- a/Config/src/V1/resources/config_rest_client_config.php
+++ b/Config/src/V1/resources/config_rest_client_config.php
@@ -155,6 +155,17 @@
],
],
],
+ 'GetTerraformVersion' => [
+ 'method' => 'get',
+ 'uriTemplate' => '/v1/{name=projects/*/locations/*/terraformVersions/*}',
+ 'placeholders' => [
+ 'name' => [
+ 'getters' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'ImportStatefile' => [
'method' => 'post',
'uriTemplate' => '/v1/{parent=projects/*/locations/*/deployments/*}:importState',
@@ -211,6 +222,17 @@
],
],
],
+ 'ListTerraformVersions' => [
+ 'method' => 'get',
+ 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/terraformVersions',
+ 'placeholders' => [
+ 'parent' => [
+ 'getters' => [
+ 'getParent',
+ ],
+ ],
+ ],
+ ],
'LockDeployment' => [
'method' => 'post',
'uriTemplate' => '/v1/{name=projects/*/locations/*/deployments/*}:lock',
diff --git a/Config/tests/Unit/V1/Client/ConfigClientTest.php b/Config/tests/Unit/V1/Client/ConfigClientTest.php
index 5066634275ad..d306b73b3ddd 100644
--- a/Config/tests/Unit/V1/Client/ConfigClientTest.php
+++ b/Config/tests/Unit/V1/Client/ConfigClientTest.php
@@ -43,6 +43,7 @@
use Google\Cloud\Config\V1\GetPreviewRequest;
use Google\Cloud\Config\V1\GetResourceRequest;
use Google\Cloud\Config\V1\GetRevisionRequest;
+use Google\Cloud\Config\V1\GetTerraformVersionRequest;
use Google\Cloud\Config\V1\ImportStatefileRequest;
use Google\Cloud\Config\V1\ListDeploymentsRequest;
use Google\Cloud\Config\V1\ListDeploymentsResponse;
@@ -52,12 +53,15 @@
use Google\Cloud\Config\V1\ListResourcesResponse;
use Google\Cloud\Config\V1\ListRevisionsRequest;
use Google\Cloud\Config\V1\ListRevisionsResponse;
+use Google\Cloud\Config\V1\ListTerraformVersionsRequest;
+use Google\Cloud\Config\V1\ListTerraformVersionsResponse;
use Google\Cloud\Config\V1\LockDeploymentRequest;
use Google\Cloud\Config\V1\LockInfo;
use Google\Cloud\Config\V1\Preview;
use Google\Cloud\Config\V1\Resource;
use Google\Cloud\Config\V1\Revision;
use Google\Cloud\Config\V1\Statefile;
+use Google\Cloud\Config\V1\TerraformVersion;
use Google\Cloud\Config\V1\UnlockDeploymentRequest;
use Google\Cloud\Config\V1\UpdateDeploymentRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
@@ -137,6 +141,8 @@ public function createDeploymentTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name);
$expectedResponse->setLatestRevision($latestRevision);
@@ -148,6 +154,8 @@ public function createDeploymentTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$anyResponse = new Any();
$anyResponse->setValue($expectedResponse->serializeToString());
$completeOperation = new Operation();
@@ -435,6 +443,8 @@ public function deleteDeploymentTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name2);
$expectedResponse->setLatestRevision($latestRevision);
@@ -446,6 +456,8 @@ public function deleteDeploymentTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$anyResponse = new Any();
$anyResponse->setValue($expectedResponse->serializeToString());
$completeOperation = new Operation();
@@ -1035,6 +1047,8 @@ public function getDeploymentTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name2);
$expectedResponse->setLatestRevision($latestRevision);
@@ -1046,6 +1060,8 @@ public function getDeploymentTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->deploymentName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]');
@@ -1272,6 +1288,9 @@ public function getRevisionTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
+ $quotaValidationResults = 'quotaValidationResults220555095';
$expectedResponse = new Revision();
$expectedResponse->setName($name2);
$expectedResponse->setStateDetail($stateDetail);
@@ -1281,6 +1300,9 @@ public function getRevisionTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
+ $expectedResponse->setQuotaValidationResults($quotaValidationResults);
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT]', '[REVISION]');
@@ -1334,6 +1356,71 @@ public function getRevisionExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function getTerraformVersionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $name2 = 'name2-1052831874';
+ $expectedResponse = new TerraformVersion();
+ $expectedResponse->setName($name2);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedName = $gapicClient->terraformVersionName('[PROJECT]', '[LOCATION]', '[TERRAFORM_VERSION]');
+ $request = (new GetTerraformVersionRequest())->setName($formattedName);
+ $response = $gapicClient->getTerraformVersion($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.config.v1.Config/GetTerraformVersion', $actualFuncCall);
+ $actualValue = $actualRequestObject->getName();
+ $this->assertProtobufEquals($formattedName, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function getTerraformVersionExceptionTest()
+ {
+ $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->terraformVersionName('[PROJECT]', '[LOCATION]', '[TERRAFORM_VERSION]');
+ $request = (new GetTerraformVersionRequest())->setName($formattedName);
+ try {
+ $gapicClient->getTerraformVersion($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 importStatefileTest()
{
@@ -1687,6 +1774,77 @@ public function listRevisionsExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function listTerraformVersionsTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $nextPageToken = '';
+ $terraformVersionsElement = new TerraformVersion();
+ $terraformVersions = [$terraformVersionsElement];
+ $expectedResponse = new ListTerraformVersionsResponse();
+ $expectedResponse->setNextPageToken($nextPageToken);
+ $expectedResponse->setTerraformVersions($terraformVersions);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
+ $request = (new ListTerraformVersionsRequest())->setParent($formattedParent);
+ $response = $gapicClient->listTerraformVersions($request);
+ $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
+ $resources = iterator_to_array($response->iterateAllElements());
+ $this->assertSame(1, count($resources));
+ $this->assertEquals($expectedResponse->getTerraformVersions()[0], $resources[0]);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame('/google.cloud.config.v1.Config/ListTerraformVersions', $actualFuncCall);
+ $actualValue = $actualRequestObject->getParent();
+ $this->assertProtobufEquals($formattedParent, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function listTerraformVersionsExceptionTest()
+ {
+ $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 ListTerraformVersionsRequest())->setParent($formattedParent);
+ try {
+ $gapicClient->listTerraformVersions($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 lockDeploymentTest()
{
@@ -1718,6 +1876,8 @@ public function lockDeploymentTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name2);
$expectedResponse->setLatestRevision($latestRevision);
@@ -1729,6 +1889,8 @@ public function lockDeploymentTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$anyResponse = new Any();
$anyResponse->setValue($expectedResponse->serializeToString());
$completeOperation = new Operation();
@@ -1860,6 +2022,8 @@ public function unlockDeploymentTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name2);
$expectedResponse->setLatestRevision($latestRevision);
@@ -1871,6 +2035,8 @@ public function unlockDeploymentTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$anyResponse = new Any();
$anyResponse->setValue($expectedResponse->serializeToString());
$completeOperation = new Operation();
@@ -2006,6 +2172,8 @@ public function updateDeploymentTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name);
$expectedResponse->setLatestRevision($latestRevision);
@@ -2017,6 +2185,8 @@ public function updateDeploymentTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$anyResponse = new Any();
$anyResponse->setValue($expectedResponse->serializeToString());
$completeOperation = new Operation();
@@ -2481,6 +2651,8 @@ public function createDeploymentAsyncTest()
$serviceAccount = 'serviceAccount-1948028253';
$importExistingResources = false;
$workerPool = 'workerPool982219837';
+ $tfVersionConstraint = 'tfVersionConstraint594495121';
+ $tfVersion = 'tfVersion1712341003';
$expectedResponse = new Deployment();
$expectedResponse->setName($name);
$expectedResponse->setLatestRevision($latestRevision);
@@ -2492,6 +2664,8 @@ public function createDeploymentAsyncTest()
$expectedResponse->setServiceAccount($serviceAccount);
$expectedResponse->setImportExistingResources($importExistingResources);
$expectedResponse->setWorkerPool($workerPool);
+ $expectedResponse->setTfVersionConstraint($tfVersionConstraint);
+ $expectedResponse->setTfVersion($tfVersion);
$anyResponse = new Any();
$anyResponse->setValue($expectedResponse->serializeToString());
$completeOperation = new Operation();