Skip to content

Commit ceeb2e2

Browse files
feat: [Memorystore] [Memorystore for Valkey] Add support for Flexible CA feature (#9075)
* feat: [Memorystore for Valkey] Add support for Flexible CA feature PiperOrigin-RevId: 893211666 Source-Link: googleapis/googleapis@1568178 Source-Link: googleapis/googleapis-gen@0c9a019 Copy-Tag: eyJwIjoiTWVtb3J5c3RvcmUvLk93bEJvdC55YW1sIiwiaCI6IjBjOWEwMTkzNDMwZjczMjExZTZlNTZmZmJlZTc1Y2FmNWYxZjRhYTQifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent aafc718 commit ceeb2e2

14 files changed

Lines changed: 852 additions & 1 deletion

File tree

Memorystore/metadata/V1Beta/Memorystore.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START memorystore_v1beta_generated_Memorystore_GetSharedRegionalCertificateAuthority_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Memorystore\V1beta\Client\MemorystoreClient;
28+
use Google\Cloud\Memorystore\V1beta\GetSharedRegionalCertificateAuthorityRequest;
29+
use Google\Cloud\Memorystore\V1beta\SharedRegionalCertificateAuthority;
30+
31+
/**
32+
* Gets the details of shared regional certificate authority information for
33+
* Memorystore instance.
34+
*
35+
* @param string $formattedName Regional certificate authority resource name using the form:
36+
* `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority`
37+
* where `location_id` refers to a Google Cloud region. Please see
38+
* {@see MemorystoreClient::sharedRegionalCertificateAuthorityName()} for help formatting this field.
39+
*/
40+
function get_shared_regional_certificate_authority_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$memorystoreClient = new MemorystoreClient();
44+
45+
// Prepare the request message.
46+
$request = (new GetSharedRegionalCertificateAuthorityRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var SharedRegionalCertificateAuthority $response */
52+
$response = $memorystoreClient->getSharedRegionalCertificateAuthority($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedName = MemorystoreClient::sharedRegionalCertificateAuthorityName(
71+
'[PROJECT]',
72+
'[LOCATION]'
73+
);
74+
75+
get_shared_regional_certificate_authority_sample($formattedName);
76+
}
77+
// [END memorystore_v1beta_generated_Memorystore_GetSharedRegionalCertificateAuthority_sync]

Memorystore/src/V1beta/Client/MemorystoreClient.php

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
use Google\Cloud\Memorystore\V1beta\DeleteInstanceRequest;
4646
use Google\Cloud\Memorystore\V1beta\GetCertificateAuthorityRequest;
4747
use Google\Cloud\Memorystore\V1beta\GetInstanceRequest;
48+
use Google\Cloud\Memorystore\V1beta\GetSharedRegionalCertificateAuthorityRequest;
4849
use Google\Cloud\Memorystore\V1beta\Instance;
4950
use Google\Cloud\Memorystore\V1beta\ListInstancesRequest;
51+
use Google\Cloud\Memorystore\V1beta\SharedRegionalCertificateAuthority;
5052
use Google\Cloud\Memorystore\V1beta\UpdateInstanceRequest;
5153
use Google\LongRunning\Client\OperationsClient;
5254
use Google\LongRunning\Operation;
@@ -70,6 +72,7 @@
7072
* @method PromiseInterface<OperationResponse> deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = [])
7173
* @method PromiseInterface<CertificateAuthority> getCertificateAuthorityAsync(GetCertificateAuthorityRequest $request, array $optionalArgs = [])
7274
* @method PromiseInterface<Instance> getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = [])
75+
* @method PromiseInterface<SharedRegionalCertificateAuthority> getSharedRegionalCertificateAuthorityAsync(GetSharedRegionalCertificateAuthorityRequest $request, array $optionalArgs = [])
7376
* @method PromiseInterface<PagedListResponse> listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = [])
7477
* @method PromiseInterface<OperationResponse> updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = [])
7578
* @method PromiseInterface<Location> getLocationAsync(GetLocationRequest $request, array $optionalArgs = [])
@@ -187,6 +190,27 @@ private function createOperationsClient(array $options)
187190
return new OperationsClient($options);
188191
}
189192

193+
/**
194+
* Formats a string containing the fully-qualified path to represent a ca_pool
195+
* resource.
196+
*
197+
* @param string $project
198+
* @param string $location
199+
* @param string $caPool
200+
*
201+
* @return string The formatted ca_pool resource.
202+
*
203+
* @experimental
204+
*/
205+
public static function caPoolName(string $project, string $location, string $caPool): string
206+
{
207+
return self::getPathTemplate('caPool')->render([
208+
'project' => $project,
209+
'location' => $location,
210+
'ca_pool' => $caPool,
211+
]);
212+
}
213+
190214
/**
191215
* Formats a string containing the fully-qualified path to represent a
192216
* forwarding_rule resource.
@@ -288,15 +312,36 @@ public static function serviceAttachmentName(string $project, string $region, st
288312
]);
289313
}
290314

315+
/**
316+
* Formats a string containing the fully-qualified path to represent a
317+
* shared_regional_certificate_authority resource.
318+
*
319+
* @param string $project
320+
* @param string $location
321+
*
322+
* @return string The formatted shared_regional_certificate_authority resource.
323+
*
324+
* @experimental
325+
*/
326+
public static function sharedRegionalCertificateAuthorityName(string $project, string $location): string
327+
{
328+
return self::getPathTemplate('sharedRegionalCertificateAuthority')->render([
329+
'project' => $project,
330+
'location' => $location,
331+
]);
332+
}
333+
291334
/**
292335
* Parses a formatted name string and returns an associative array of the components in the name.
293336
* The following name formats are supported:
294337
* Template: Pattern
338+
* - caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
295339
* - forwardingRule: projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
296340
* - instance: projects/{project}/locations/{location}/instances/{instance}
297341
* - location: projects/{project}/locations/{location}
298342
* - network: projects/{project}/global/networks/{network}
299343
* - serviceAttachment: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
344+
* - sharedRegionalCertificateAuthority: projects/{project}/locations/{location}/sharedRegionalCertificateAuthority
300345
*
301346
* The optional $template argument can be supplied to specify a particular pattern,
302347
* and must match one of the templates listed above. If no $template argument is
@@ -517,6 +562,38 @@ public function getInstance(GetInstanceRequest $request, array $callOptions = []
517562
return $this->startApiCall('GetInstance', $request, $callOptions)->wait();
518563
}
519564

565+
/**
566+
* Gets the details of shared regional certificate authority information for
567+
* Memorystore instance.
568+
*
569+
* The async variant is
570+
* {@see MemorystoreClient::getSharedRegionalCertificateAuthorityAsync()} .
571+
*
572+
* @example samples/V1beta/MemorystoreClient/get_shared_regional_certificate_authority.php
573+
*
574+
* @param GetSharedRegionalCertificateAuthorityRequest $request A request to house fields associated with the call.
575+
* @param array $callOptions {
576+
* Optional.
577+
*
578+
* @type RetrySettings|array $retrySettings
579+
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
580+
* associative array of retry settings parameters. See the documentation on
581+
* {@see RetrySettings} for example usage.
582+
* }
583+
*
584+
* @return SharedRegionalCertificateAuthority
585+
*
586+
* @throws ApiException Thrown if the API call fails.
587+
*
588+
* @experimental
589+
*/
590+
public function getSharedRegionalCertificateAuthority(
591+
GetSharedRegionalCertificateAuthorityRequest $request,
592+
array $callOptions = []
593+
): SharedRegionalCertificateAuthority {
594+
return $this->startApiCall('GetSharedRegionalCertificateAuthority', $request, $callOptions)->wait();
595+
}
596+
520597
/**
521598
* Lists Instances in a given project and location.
522599
*

Memorystore/src/V1beta/GetSharedRegionalCertificateAuthorityRequest.php

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)