Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RedisCluster/metadata/V1/CloudRedisCluster.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2026 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 redis_v1_generated_CloudRedisCluster_GetSharedRegionalCertificateAuthority_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Redis\Cluster\V1\Client\CloudRedisClusterClient;
use Google\Cloud\Redis\Cluster\V1\GetSharedRegionalCertificateAuthorityRequest;
use Google\Cloud\Redis\Cluster\V1\SharedRegionalCertificateAuthority;

/**
* Gets the details of regional certificate authority information for Redis
* cluster.
*
* @param string $formattedName Regional certificate authority resource name using the form:
* `projects/{project_id}/locations/{location_id}/sharedRegionalCertificateAuthority`
* where `location_id` refers to a Google Cloud region. Please see
* {@see CloudRedisClusterClient::sharedRegionalCertificateAuthorityName()} for help formatting this field.
*/
function get_shared_regional_certificate_authority_sample(string $formattedName): void
{
// Create a client.
$cloudRedisClusterClient = new CloudRedisClusterClient();

// Prepare the request message.
$request = (new GetSharedRegionalCertificateAuthorityRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var SharedRegionalCertificateAuthority $response */
$response = $cloudRedisClusterClient->getSharedRegionalCertificateAuthority($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 = CloudRedisClusterClient::sharedRegionalCertificateAuthorityName(
'[PROJECT]',
'[LOCATION]'
);

get_shared_regional_certificate_authority_sample($formattedName);
}
// [END redis_v1_generated_CloudRedisCluster_GetSharedRegionalCertificateAuthority_sync]
71 changes: 71 additions & 0 deletions RedisCluster/src/V1/Client/CloudRedisClusterClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
use Google\Cloud\Redis\Cluster\V1\GetBackupRequest;
use Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest;
use Google\Cloud\Redis\Cluster\V1\GetClusterRequest;
use Google\Cloud\Redis\Cluster\V1\GetSharedRegionalCertificateAuthorityRequest;
use Google\Cloud\Redis\Cluster\V1\ListBackupCollectionsRequest;
use Google\Cloud\Redis\Cluster\V1\ListBackupsRequest;
use Google\Cloud\Redis\Cluster\V1\ListClustersRequest;
use Google\Cloud\Redis\Cluster\V1\RescheduleClusterMaintenanceRequest;
use Google\Cloud\Redis\Cluster\V1\SharedRegionalCertificateAuthority;
use Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
Expand Down Expand Up @@ -96,6 +98,7 @@
* @method PromiseInterface<BackupCollection> getBackupCollectionAsync(GetBackupCollectionRequest $request, array $optionalArgs = [])
* @method PromiseInterface<Cluster> getClusterAsync(GetClusterRequest $request, array $optionalArgs = [])
* @method PromiseInterface<CertificateAuthority> getClusterCertificateAuthorityAsync(GetClusterCertificateAuthorityRequest $request, array $optionalArgs = [])
* @method PromiseInterface<SharedRegionalCertificateAuthority> getSharedRegionalCertificateAuthorityAsync(GetSharedRegionalCertificateAuthorityRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listBackupCollectionsAsync(ListBackupCollectionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listClustersAsync(ListClustersRequest $request, array $optionalArgs = [])
Expand Down Expand Up @@ -244,6 +247,25 @@ public static function backupCollectionName(string $project, string $location, s
]);
}

/**
* Formats a string containing the fully-qualified path to represent a ca_pool
* resource.
*
* @param string $project
* @param string $location
* @param string $caPool
*
* @return string The formatted ca_pool resource.
*/
public static function caPoolName(string $project, string $location, string $caPool): string
{
return self::getPathTemplate('caPool')->render([
'project' => $project,
'location' => $location,
'ca_pool' => $caPool,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* certificate_authority resource.
Expand Down Expand Up @@ -403,12 +425,30 @@ public static function serviceAttachmentName(string $project, string $region, st
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* shared_regional_certificate_authority resource.
*
* @param string $project
* @param string $location
*
* @return string The formatted shared_regional_certificate_authority resource.
*/
public static function sharedRegionalCertificateAuthorityName(string $project, string $location): string
{
return self::getPathTemplate('sharedRegionalCertificateAuthority')->render([
'project' => $project,
'location' => $location,
]);
}

/**
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
* Template: Pattern
* - backup: projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}
* - backupCollection: projects/{project}/locations/{location}/backupCollections/{backup_collection}
* - caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
* - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority
* - cluster: projects/{project}/locations/{location}/clusters/{cluster}
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
Expand All @@ -417,6 +457,7 @@ public static function serviceAttachmentName(string $project, string $region, st
* - location: projects/{project}/locations/{location}
* - network: projects/{project}/global/networks/{network}
* - serviceAttachment: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
* - sharedRegionalCertificateAuthority: projects/{project}/locations/{location}/sharedRegionalCertificateAuthority
*
* The optional $template argument can be supplied to specify a particular pattern,
* and must match one of the templates listed above. If no $template argument is
Expand Down Expand Up @@ -779,6 +820,36 @@ public function getClusterCertificateAuthority(
return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait();
}

/**
* Gets the details of regional certificate authority information for Redis
* cluster.
*
* The async variant is
* {@see CloudRedisClusterClient::getSharedRegionalCertificateAuthorityAsync()} .
*
* @example samples/V1/CloudRedisClusterClient/get_shared_regional_certificate_authority.php
*
* @param GetSharedRegionalCertificateAuthorityRequest $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 SharedRegionalCertificateAuthority
*
* @throws ApiException Thrown if the API call fails.
*/
public function getSharedRegionalCertificateAuthority(
GetSharedRegionalCertificateAuthorityRequest $request,
array $callOptions = []
): SharedRegionalCertificateAuthority {
return $this->startApiCall('GetSharedRegionalCertificateAuthority', $request, $callOptions)->wait();
}

/**
* Lists all backup collections owned by a consumer project in either the
* specified location (region) or all locations.
Expand Down
140 changes: 140 additions & 0 deletions RedisCluster/src/V1/Cluster.php

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

Loading
Loading