Skip to content

Commit

Permalink
feat: Update Compute Engine API to revision 20230711 (#6488)
Browse files Browse the repository at this point in the history
Source-Link: googleapis/googleapis@e8c26cc
Source-Link: googleapis/googleapis-gen@81d1ed1
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiODFkMWVkMTE3ZjY4NDRmZWZiMjM5ZTBjZDA4NGJhMTAxODQ2ZWYwMSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Jul 25, 2023
1 parent a0d73dc commit b25fc4c
Show file tree
Hide file tree
Showing 28 changed files with 1,120 additions and 19 deletions.
Binary file modified Compute/metadata/V1/Compute.php
Binary file not shown.
2 changes: 1 addition & 1 deletion Compute/samples/V1/RegionSecurityPoliciesClient/patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use Google\Rpc\Status;

/**
* Patches the specified policy with the data included in the request. To clear fields in the rule, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
* Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
*
* @param string $project Project ID for this request.
* @param string $region Name of the region scoping this request.
Expand Down
87 changes: 87 additions & 0 deletions Compute/samples/V1/ResourcePoliciesClient/patch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START compute_v1_generated_ResourcePolicies_Patch_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Compute\V1\ResourcePoliciesClient;
use Google\Cloud\Compute\V1\ResourcePolicy;
use Google\Rpc\Status;

/**
* Modify the specified resource policy.
*
* @param string $project Project ID for this request.
* @param string $region Name of the region for this request.
* @param string $resourcePolicy Id of the resource policy to patch.
*/
function patch_sample(string $project, string $region, string $resourcePolicy): void
{
// Create a client.
$resourcePoliciesClient = new ResourcePoliciesClient();

// Prepare any non-scalar elements to be passed along with the request.
$resourcePolicyResource = new ResourcePolicy();

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $resourcePoliciesClient->patch(
$project,
$region,
$resourcePolicy,
$resourcePolicyResource
);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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
{
$project = '[PROJECT]';
$region = '[REGION]';
$resourcePolicy = '[RESOURCE_POLICY]';

patch_sample($project, $region, $resourcePolicy);
}
// [END compute_v1_generated_ResourcePolicies_Patch_sync]
2 changes: 1 addition & 1 deletion Compute/samples/V1/SecurityPoliciesClient/patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use Google\Rpc\Status;

/**
* Patches the specified policy with the data included in the request. To clear fields in the rule, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
* Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
*
* @param string $project Project ID for this request.
* @param string $securityPolicy Name of the security policy to update.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/SecurityPoliciesClient/patch_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use Google\Rpc\Status;

/**
* Patches a rule at the specified priority.
* Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
*
* @param string $project Project ID for this request.
* @param string $securityPolicy Name of the security policy to update.
Expand Down
8 changes: 4 additions & 4 deletions Compute/src/V1/BackendBucket.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function list(ListRegionSecurityPoliciesRequest $request, array $callOpti
}

/**
* Patches the specified policy with the data included in the request. To clear fields in the rule, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
* Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
*
* The async variant is {@see self::patchAsync()} .
*
Expand Down
26 changes: 26 additions & 0 deletions Compute/src/V1/Client/BaseClient/ResourcePoliciesBaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Google\Cloud\Compute\V1\GetResourcePolicyRequest;
use Google\Cloud\Compute\V1\InsertResourcePolicyRequest;
use Google\Cloud\Compute\V1\ListResourcePoliciesRequest;
use Google\Cloud\Compute\V1\PatchResourcePolicyRequest;
use Google\Cloud\Compute\V1\Policy;
use Google\Cloud\Compute\V1\RegionOperationsClient;
use Google\Cloud\Compute\V1\ResourcePolicy;
Expand Down Expand Up @@ -66,6 +67,7 @@
* @method PromiseInterface getIamPolicyAsync(GetIamPolicyResourcePolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface insertAsync(InsertResourcePolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface listAsync(ListResourcePoliciesRequest $request, array $optionalArgs = [])
* @method PromiseInterface patchAsync(PatchResourcePolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface setIamPolicyAsync(SetIamPolicyResourcePolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsResourcePolicyRequest $request, array $optionalArgs = [])
*/
Expand Down Expand Up @@ -388,6 +390,30 @@ public function list(ListResourcePoliciesRequest $request, array $callOptions =
return $this->startApiCall('List', $request, $callOptions);
}

/**
* Modify the specified resource policy.
*
* The async variant is {@see self::patchAsync()} .
*
* @param PatchResourcePolicyRequest $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 patch(PatchResourcePolicyRequest $request, array $callOptions = []): OperationResponse
{
return $this->startApiCall('Patch', $request, $callOptions)->wait();
}

/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public function listPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsS
}

/**
* Patches the specified policy with the data included in the request. To clear fields in the rule, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
* Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
*
* The async variant is {@see self::patchAsync()} .
*
Expand All @@ -468,7 +468,7 @@ public function patch(PatchSecurityPolicyRequest $request, array $callOptions =
}

/**
* Patches a rule at the specified priority.
* Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
*
* The async variant is {@see self::patchRuleAsync()} .
*
Expand Down
7 changes: 7 additions & 0 deletions Compute/src/V1/DistributionPolicy/TargetShape.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Compute/src/V1/Enums/DistributionPolicy/TargetShape.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class TargetShape

const ANY = 'ANY';

const ANY_SINGLE_ZONE = 'ANY_SINGLE_ZONE';

const BALANCED = 'BALANCED';

const EVEN = 'EVEN';
Expand Down
38 changes: 38 additions & 0 deletions Compute/src/V1/Enums/QuotaExceededInfo/RolloutStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* Generated by gapic-generator-php from the file
* https://github.com/googleapis/googleapis/blob/master/google/cloud/compute/v1/compute.proto
* Updates to the above are reflected here through a refresh process.
*/

namespace Google\Cloud\Compute\V1\Enums\QuotaExceededInfo;

/**
* RolloutStatus contains string constants that represent the names of each value
* in the google.cloud.compute.v1.QuotaExceededInfo.RolloutStatus descriptor.
*/
class RolloutStatus
{
const UNDEFINED_ROLLOUT_STATUS = 'UNDEFINED_ROLLOUT_STATUS';

const IN_PROGRESS = 'IN_PROGRESS';

const ROLLOUT_STATUS_UNSPECIFIED = 'ROLLOUT_STATUS_UNSPECIFIED';
}
2 changes: 1 addition & 1 deletion Compute/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public function list($project, $region, array $optionalArgs = [])
}

/**
* Patches the specified policy with the data included in the request. To clear fields in the rule, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
* Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.
*
* Sample code:
* ```
Expand Down
Loading

0 comments on commit b25fc4c

Please sign in to comment.