diff --git a/RedisCluster/metadata/V1/CloudRedisCluster.php b/RedisCluster/metadata/V1/CloudRedisCluster.php index 958d741750aa..ca7ebc33312f 100644 Binary files a/RedisCluster/metadata/V1/CloudRedisCluster.php and b/RedisCluster/metadata/V1/CloudRedisCluster.php differ diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php b/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php similarity index 100% rename from owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php rename to RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php b/RedisCluster/src/V1/CertificateAuthority.php similarity index 100% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php rename to RedisCluster/src/V1/CertificateAuthority.php diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php similarity index 92% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php rename to RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php index e5e61afb2624..a6ae67f1e601 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php +++ b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority.php @@ -67,6 +67,4 @@ public function setCaCerts($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ManagedCertificateAuthority::class, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority_ManagedCertificateAuthority::class); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php similarity index 90% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php rename to RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php index 6aa46fd7e72b..09a80e62cb93 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php +++ b/RedisCluster/src/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php @@ -63,6 +63,4 @@ public function setCertificates($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CertChain::class, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority_ManagedCertificateAuthority_CertChain::class); diff --git a/RedisCluster/src/V1/Client/CloudRedisClusterClient.php b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php index 52e411bafbe6..9522b09bc6b2 100644 --- a/RedisCluster/src/V1/Client/CloudRedisClusterClient.php +++ b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php @@ -37,9 +37,11 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\Cloud\Redis\Cluster\V1\CertificateAuthority; use Google\Cloud\Redis\Cluster\V1\Cluster; use Google\Cloud\Redis\Cluster\V1\CreateClusterRequest; use Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest; +use Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest; use Google\Cloud\Redis\Cluster\V1\GetClusterRequest; use Google\Cloud\Redis\Cluster\V1\ListClustersRequest; use Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest; @@ -82,6 +84,7 @@ * @method PromiseInterface createClusterAsync(CreateClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface getClusterAsync(GetClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClusterCertificateAuthorityAsync(GetClusterCertificateAuthorityRequest $request, array $optionalArgs = []) * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) * @method PromiseInterface updateClusterAsync(UpdateClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) @@ -185,6 +188,25 @@ private function createOperationsClient(array $options) return new OperationsClient($options); } + /** + * Formats a string containing the fully-qualified path to represent a + * certificate_authority resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted certificate_authority resource. + */ + public static function certificateAuthorityName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('certificateAuthority')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a cluster * resource. @@ -225,6 +247,7 @@ public static function locationName(string $project, string $location): string * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority * - cluster: projects/{project}/locations/{location}/clusters/{cluster} * - location: projects/{project}/locations/{location} * @@ -404,6 +427,35 @@ public function getCluster(GetClusterRequest $request, array $callOptions = []): return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); } + /** + * Gets the details of certificate authority information for Redis cluster. + * + * The async variant is + * {@see CloudRedisClusterClient::getClusterCertificateAuthorityAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php + * + * @param GetClusterCertificateAuthorityRequest $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 CertificateAuthority + * + * @throws ApiException Thrown if the API call fails. + */ + public function getClusterCertificateAuthority( + GetClusterCertificateAuthorityRequest $request, + array $callOptions = [] + ): CertificateAuthority { + return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait(); + } + /** * Lists all Redis clusters owned by a project in either the specified * location (region) or all locations. diff --git a/RedisCluster/src/V1/Cluster.php b/RedisCluster/src/V1/Cluster.php index 717d2175cd9b..58b6ccfa3e61 100644 --- a/RedisCluster/src/V1/Cluster.php +++ b/RedisCluster/src/V1/Cluster.php @@ -63,7 +63,8 @@ class Cluster extends \Google\Protobuf\Internal\Message */ protected $transit_encryption_mode = 0; /** - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -102,6 +103,45 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $state_info = null; + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_type = 0; + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $persistence_config = null; + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $redis_configs; + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $precise_size_gb = null; + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone_distribution_config = null; + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deletion_protection_enabled = null; /** * Constructor. @@ -129,7 +169,8 @@ class Cluster extends \Google\Protobuf\Internal\Message * Optional. The in-transit encryption for the Redis cluster. * If not provided, encryption is disabled for the cluster. * @type int $size_gb - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * @type int $shard_count * Required. Number of shards for the Redis cluster. * @type array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $psc_configs @@ -144,6 +185,21 @@ class Cluster extends \Google\Protobuf\Internal\Message * accessing the cluster. * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $state_info * Output only. Additional information about the current state of the cluster. + * @type int $node_type + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $persistence_config + * Optional. Persistence config (RDB, AOF) for the cluster. + * @type array|\Google\Protobuf\Internal\MapField $redis_configs + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * @type float $precise_size_gb + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * @type \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $zone_distribution_config + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * @type bool $deletion_protection_enabled + * Optional. The delete operation will fail when the value is set to true. * } */ public function __construct($data = NULL) { @@ -364,7 +420,8 @@ public function setTransitEncryptionMode($var) } /** - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int @@ -385,7 +442,8 @@ public function clearSizeGb() } /** - * Output only. Redis memory size in GB for the entire cluster. + * Output only. Redis memory size in GB for the entire cluster rounded up to + * the next integer. * * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var @@ -557,5 +615,207 @@ public function setStateInfo($var) return $this; } + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNodeType() + { + return $this->node_type; + } + + /** + * Optional. The type of a redis node in the cluster. NodeType determines the + * underlying machine-type of a redis node. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNodeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\NodeType::class); + $this->node_type = $var; + + return $this; + } + + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig|null + */ + public function getPersistenceConfig() + { + return $this->persistence_config; + } + + public function hasPersistenceConfig() + { + return isset($this->persistence_config); + } + + public function clearPersistenceConfig() + { + unset($this->persistence_config); + } + + /** + * Optional. Persistence config (RDB, AOF) for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $var + * @return $this + */ + public function setPersistenceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig::class); + $this->persistence_config = $var; + + return $this; + } + + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRedisConfigs() + { + return $this->redis_configs; + } + + /** + * Optional. Key/Value pairs of customer overrides for mutable Redis Configs + * + * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRedisConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->redis_configs = $arr; + + return $this; + } + + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getPreciseSizeGb() + { + return isset($this->precise_size_gb) ? $this->precise_size_gb : 0.0; + } + + public function hasPreciseSizeGb() + { + return isset($this->precise_size_gb); + } + + public function clearPreciseSizeGb() + { + unset($this->precise_size_gb); + } + + /** + * Output only. Precise value of redis memory size in GB for the entire + * cluster. + * + * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setPreciseSizeGb($var) + { + GPBUtil::checkDouble($var); + $this->precise_size_gb = $var; + + return $this; + } + + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig|null + */ + public function getZoneDistributionConfig() + { + return $this->zone_distribution_config; + } + + public function hasZoneDistributionConfig() + { + return isset($this->zone_distribution_config); + } + + public function clearZoneDistributionConfig() + { + unset($this->zone_distribution_config); + } + + /** + * Optional. This config will be used to determine how the customer wants us + * to distribute cluster resources within the region. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $var + * @return $this + */ + public function setZoneDistributionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig::class); + $this->zone_distribution_config = $var; + + return $this; + } + + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDeletionProtectionEnabled() + { + return isset($this->deletion_protection_enabled) ? $this->deletion_protection_enabled : false; + } + + public function hasDeletionProtectionEnabled() + { + return isset($this->deletion_protection_enabled); + } + + public function clearDeletionProtectionEnabled() + { + unset($this->deletion_protection_enabled); + } + + /** + * Optional. The delete operation will fail when the value is set to true. + * + * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDeletionProtectionEnabled($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection_enabled = $var; + + return $this; + } + } diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php b/RedisCluster/src/V1/ClusterPersistenceConfig.php similarity index 100% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php rename to RedisCluster/src/V1/ClusterPersistenceConfig.php diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php similarity index 91% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php rename to RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php index 8aab049465e7..7ae275fc1b9a 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig.php @@ -65,6 +65,4 @@ public function setAppendFsync($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AOFConfig::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_AOFConfig::class); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php similarity index 91% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php rename to RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php index ec1a3a6654af..c825e1b2ee66 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php @@ -69,6 +69,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AppendFsync::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_AOFConfig_AppendFsync::class); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php b/RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php similarity index 90% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php rename to RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php index 0b99ded98ebe..5e37e2527fd1 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/PersistenceMode.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PersistenceMode::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_PersistenceMode::class); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php similarity index 95% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php rename to RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php index 2d16c395c5e1..72bea412dc13 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig.php @@ -117,6 +117,4 @@ public function setRdbSnapshotStartTime($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RDBConfig::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_RDBConfig::class); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php similarity index 90% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php rename to RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php index 21d491f77fde..a1ff3273539a 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php +++ b/RedisCluster/src/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SnapshotPeriod::class, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig_RDBConfig_SnapshotPeriod::class); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php b/RedisCluster/src/V1/GetClusterCertificateAuthorityRequest.php similarity index 100% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php rename to RedisCluster/src/V1/GetClusterCertificateAuthorityRequest.php diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php b/RedisCluster/src/V1/NodeType.php similarity index 100% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php rename to RedisCluster/src/V1/NodeType.php diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php b/RedisCluster/src/V1/ZoneDistributionConfig.php similarity index 100% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php rename to RedisCluster/src/V1/ZoneDistributionConfig.php diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php b/RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php similarity index 90% rename from owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php rename to RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php index a1d1598e5034..80c81d323b89 100644 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php +++ b/RedisCluster/src/V1/ZoneDistributionConfig/ZoneDistributionMode.php @@ -64,6 +64,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ZoneDistributionMode::class, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig_ZoneDistributionMode::class); diff --git a/RedisCluster/src/V1/gapic_metadata.json b/RedisCluster/src/V1/gapic_metadata.json index 441f3d1baf21..3c75e8b0b86c 100644 --- a/RedisCluster/src/V1/gapic_metadata.json +++ b/RedisCluster/src/V1/gapic_metadata.json @@ -25,6 +25,11 @@ "getCluster" ] }, + "GetClusterCertificateAuthority": { + "methods": [ + "getClusterCertificateAuthority" + ] + }, "ListClusters": { "methods": [ "listClusters" diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json b/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json index 574207f2c4ac..11c25ca9ac4a 100644 --- a/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json @@ -41,6 +41,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetClusterCertificateAuthority": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListClusters": { "timeout_millis": 600000, "retry_codes_name": "no_retry_1_codes", diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php b/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php index e5d8665a28fc..686a9576bac4 100644 --- a/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php @@ -93,6 +93,18 @@ ], ], ], + 'GetClusterCertificateAuthority' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\CertificateAuthority', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'ListClusters' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -148,6 +160,7 @@ 'interfaceOverride' => 'google.cloud.location.Locations', ], 'templateMap' => [ + 'certificateAuthority' => 'projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority', 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', 'location' => 'projects/{project}/locations/{location}', ], diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php b/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php index 115039ea6b92..69fe4ba287c9 100644 --- a/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php @@ -84,6 +84,17 @@ ], ], ], + 'GetClusterCertificateAuthority' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ListClusters' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', diff --git a/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php b/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php index f2c609e59f7f..8c5d0fb49197 100644 --- a/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php +++ b/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php @@ -30,10 +30,12 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\Cloud\Redis\Cluster\V1\CertificateAuthority; use Google\Cloud\Redis\Cluster\V1\Client\CloudRedisClusterClient; use Google\Cloud\Redis\Cluster\V1\Cluster; use Google\Cloud\Redis\Cluster\V1\CreateClusterRequest; use Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest; +use Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest; use Google\Cloud\Redis\Cluster\V1\GetClusterRequest; use Google\Cloud\Redis\Cluster\V1\ListClustersRequest; use Google\Cloud\Redis\Cluster\V1\ListClustersResponse; @@ -103,12 +105,16 @@ public function createClusterTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -371,12 +377,16 @@ public function getClusterTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); @@ -430,6 +440,74 @@ public function getClusterExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getClusterCertificateAuthorityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new CertificateAuthority(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterCertificateAuthorityRequest())->setName($formattedName); + $response = $gapicClient->getClusterCertificateAuthority($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.redis.cluster.v1.CloudRedisCluster/GetClusterCertificateAuthority', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterCertificateAuthorityExceptionTest() + { + $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->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterCertificateAuthorityRequest())->setName($formattedName); + try { + $gapicClient->getClusterCertificateAuthority($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 listClustersTest() { @@ -527,12 +605,16 @@ public function updateClusterTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -803,12 +885,16 @@ public function createClusterAsyncTest() $replicaCount = 564075208; $sizeGb = 2105542105; $shardCount = 495377042; + $preciseSizeGb = 1.3422684e8; + $deletionProtectionEnabled = true; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); $expectedResponse->setReplicaCount($replicaCount); $expectedResponse->setSizeGb($sizeGb); $expectedResponse->setShardCount($shardCount); + $expectedResponse->setPreciseSizeGb($preciseSizeGb); + $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php b/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php deleted file mode 100644 index ca7ebc33312f..000000000000 Binary files a/owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php and /dev/null differ diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php deleted file mode 100644 index ff6184311f1f..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.redis.cluster.v1.AuthorizationMode - */ -class AuthorizationMode -{ - /** - * Not set. - * - * Generated from protobuf enum AUTH_MODE_UNSPECIFIED = 0; - */ - const AUTH_MODE_UNSPECIFIED = 0; - /** - * IAM basic authorization mode - * - * Generated from protobuf enum AUTH_MODE_IAM_AUTH = 1; - */ - const AUTH_MODE_IAM_AUTH = 1; - /** - * Authorization disabled mode - * - * Generated from protobuf enum AUTH_MODE_DISABLED = 2; - */ - const AUTH_MODE_DISABLED = 2; - - private static $valueToName = [ - self::AUTH_MODE_UNSPECIFIED => 'AUTH_MODE_UNSPECIFIED', - self::AUTH_MODE_IAM_AUTH => 'AUTH_MODE_IAM_AUTH', - self::AUTH_MODE_DISABLED => 'AUTH_MODE_DISABLED', - ]; - - 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php deleted file mode 100644 index 58b6ccfa3e61..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php +++ /dev/null @@ -1,821 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster - */ -class Cluster extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Output only. The timestamp associated with the cluster creation request. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. System assigned, unique identifier for the cluster. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Optional. The number of replica nodes per shard. - * - * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $replica_count = null; - /** - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $authorization_mode = 0; - /** - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $transit_encryption_mode = 0; - /** - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * - * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $size_gb = null; - /** - * Required. Number of shards for the Redis cluster. - * - * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $shard_count = null; - /** - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; - */ - private $psc_configs; - /** - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $discovery_endpoints; - /** - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $psc_connections; - /** - * Output only. Additional information about the current state of the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state_info = null; - /** - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $node_type = 0; - /** - * Optional. Persistence config (RDB, AOF) for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $persistence_config = null; - /** - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * - * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $redis_configs; - /** - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * - * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $precise_size_gb = null; - /** - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $zone_distribution_config = null; - /** - * Optional. The delete operation will fail when the value is set to true. - * - * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $deletion_protection_enabled = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp associated with the cluster creation request. - * @type int $state - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * @type string $uid - * Output only. System assigned, unique identifier for the cluster. - * @type int $replica_count - * Optional. The number of replica nodes per shard. - * @type int $authorization_mode - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * @type int $transit_encryption_mode - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * @type int $size_gb - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * @type int $shard_count - * Required. Number of shards for the Redis cluster. - * @type array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $psc_configs - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * @type array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $discovery_endpoints - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * @type array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $psc_connections - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $state_info - * Output only. Additional information about the current state of the cluster. - * @type int $node_type - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $persistence_config - * Optional. Persistence config (RDB, AOF) for the cluster. - * @type array|\Google\Protobuf\Internal\MapField $redis_configs - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * @type float $precise_size_gb - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * @type \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $zone_distribution_config - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * @type bool $deletion_protection_enabled - * Optional. The delete operation will fail when the value is set to true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Unique name of the resource in this scope including project and - * location using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The timestamp associated with the cluster creation request. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp associated with the cluster creation request. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of this cluster. - * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\Cluster\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. System assigned, unique identifier for the cluster. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. System assigned, unique identifier for the cluster. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Optional. The number of replica nodes per shard. - * - * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getReplicaCount() - { - return isset($this->replica_count) ? $this->replica_count : 0; - } - - public function hasReplicaCount() - { - return isset($this->replica_count); - } - - public function clearReplicaCount() - { - unset($this->replica_count); - } - - /** - * Optional. The number of replica nodes per shard. - * - * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setReplicaCount($var) - { - GPBUtil::checkInt32($var); - $this->replica_count = $var; - - return $this; - } - - /** - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAuthorizationMode() - { - return $this->authorization_mode; - } - - /** - * Optional. The authorization mode of the Redis cluster. - * If not provided, auth feature is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAuthorizationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\AuthorizationMode::class); - $this->authorization_mode = $var; - - return $this; - } - - /** - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTransitEncryptionMode() - { - return $this->transit_encryption_mode; - } - - /** - * Optional. The in-transit encryption for the Redis cluster. - * If not provided, encryption is disabled for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTransitEncryptionMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\TransitEncryptionMode::class); - $this->transit_encryption_mode = $var; - - return $this; - } - - /** - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * - * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getSizeGb() - { - return isset($this->size_gb) ? $this->size_gb : 0; - } - - public function hasSizeGb() - { - return isset($this->size_gb); - } - - public function clearSizeGb() - { - unset($this->size_gb); - } - - /** - * Output only. Redis memory size in GB for the entire cluster rounded up to - * the next integer. - * - * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setSizeGb($var) - { - GPBUtil::checkInt32($var); - $this->size_gb = $var; - - return $this; - } - - /** - * Required. Number of shards for the Redis cluster. - * - * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getShardCount() - { - return isset($this->shard_count) ? $this->shard_count : 0; - } - - public function hasShardCount() - { - return isset($this->shard_count); - } - - public function clearShardCount() - { - unset($this->shard_count); - } - - /** - * Required. Number of shards for the Redis cluster. - * - * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setShardCount($var) - { - GPBUtil::checkInt32($var); - $this->shard_count = $var; - - return $this; - } - - /** - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPscConfigs() - { - return $this->psc_configs; - } - - /** - * Required. Each PscConfig configures the consumer network where IPs will - * be designated to the cluster for client access through Private Service - * Connect Automation. Currently, only one PscConfig is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPscConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); - $this->psc_configs = $arr; - - return $this; - } - - /** - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDiscoveryEndpoints() - { - return $this->discovery_endpoints; - } - - /** - * Output only. Endpoints created on each given network, for Redis clients to - * connect to the cluster. Currently only one discovery endpoint is supported. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDiscoveryEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint::class); - $this->discovery_endpoints = $arr; - - return $this; - } - - /** - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPscConnections() - { - return $this->psc_connections; - } - - /** - * Output only. PSC connections for discovery of the cluster topology and - * accessing the cluster. - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPscConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConnection::class); - $this->psc_connections = $arr; - - return $this; - } - - /** - * Output only. Additional information about the current state of the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo|null - */ - public function getStateInfo() - { - return $this->state_info; - } - - public function hasStateInfo() - { - return isset($this->state_info); - } - - public function clearStateInfo() - { - unset($this->state_info); - } - - /** - * Output only. Additional information about the current state of the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $var - * @return $this - */ - public function setStateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo::class); - $this->state_info = $var; - - return $this; - } - - /** - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getNodeType() - { - return $this->node_type; - } - - /** - * Optional. The type of a redis node in the cluster. NodeType determines the - * underlying machine-type of a redis node. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.NodeType node_type = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setNodeType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\NodeType::class); - $this->node_type = $var; - - return $this; - } - - /** - * Optional. Persistence config (RDB, AOF) for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig|null - */ - public function getPersistenceConfig() - { - return $this->persistence_config; - } - - public function hasPersistenceConfig() - { - return isset($this->persistence_config); - } - - public function clearPersistenceConfig() - { - unset($this->persistence_config); - } - - /** - * Optional. Persistence config (RDB, AOF) for the cluster. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig persistence_config = 20 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig $var - * @return $this - */ - public function setPersistenceConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig::class); - $this->persistence_config = $var; - - return $this; - } - - /** - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * - * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getRedisConfigs() - { - return $this->redis_configs; - } - - /** - * Optional. Key/Value pairs of customer overrides for mutable Redis Configs - * - * Generated from protobuf field map redis_configs = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setRedisConfigs($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->redis_configs = $arr; - - return $this; - } - - /** - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * - * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getPreciseSizeGb() - { - return isset($this->precise_size_gb) ? $this->precise_size_gb : 0.0; - } - - public function hasPreciseSizeGb() - { - return isset($this->precise_size_gb); - } - - public function clearPreciseSizeGb() - { - unset($this->precise_size_gb); - } - - /** - * Output only. Precise value of redis memory size in GB for the entire - * cluster. - * - * Generated from protobuf field optional double precise_size_gb = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setPreciseSizeGb($var) - { - GPBUtil::checkDouble($var); - $this->precise_size_gb = $var; - - return $this; - } - - /** - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig|null - */ - public function getZoneDistributionConfig() - { - return $this->zone_distribution_config; - } - - public function hasZoneDistributionConfig() - { - return isset($this->zone_distribution_config); - } - - public function clearZoneDistributionConfig() - { - unset($this->zone_distribution_config); - } - - /** - * Optional. This config will be used to determine how the customer wants us - * to distribute cluster resources within the region. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig zone_distribution_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig $var - * @return $this - */ - public function setZoneDistributionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig::class); - $this->zone_distribution_config = $var; - - return $this; - } - - /** - * Optional. The delete operation will fail when the value is set to true. - * - * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDeletionProtectionEnabled() - { - return isset($this->deletion_protection_enabled) ? $this->deletion_protection_enabled : false; - } - - public function hasDeletionProtectionEnabled() - { - return isset($this->deletion_protection_enabled); - } - - public function clearDeletionProtectionEnabled() - { - unset($this->deletion_protection_enabled); - } - - /** - * Optional. The delete operation will fail when the value is set to true. - * - * Generated from protobuf field optional bool deletion_protection_enabled = 25 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDeletionProtectionEnabled($var) - { - GPBUtil::checkBool($var); - $this->deletion_protection_enabled = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php deleted file mode 100644 index 3cd28633110d..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster.State - */ -class State -{ - /** - * Not set. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Redis cluster is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * Redis cluster has been created and is fully usable. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * Redis cluster configuration is being updated. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * Redis cluster is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Redis\Cluster\V1\Cluster_State::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php deleted file mode 100644 index 05eb2f09fd6f..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster.StateInfo - */ -class StateInfo extends \Google\Protobuf\Internal\Message -{ - protected $info; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $update_info - * Describes ongoing update on the cluster when cluster state is UPDATING. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Describes ongoing update on the cluster when cluster state is UPDATING. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo|null - */ - public function getUpdateInfo() - { - return $this->readOneof(1); - } - - public function hasUpdateInfo() - { - return $this->hasOneof(1); - } - - /** - * Describes ongoing update on the cluster when cluster state is UPDATING. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $var - * @return $this - */ - public function setUpdateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getInfo() - { - return $this->whichOneof("info"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StateInfo::class, \Google\Cloud\Redis\Cluster\V1\Cluster_StateInfo::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php deleted file mode 100644 index ad999e1fee0f..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo - */ -class UpdateInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Target number of shards for redis cluster - * - * Generated from protobuf field optional int32 target_shard_count = 1; - */ - protected $target_shard_count = null; - /** - * Target number of replica nodes per shard. - * - * Generated from protobuf field optional int32 target_replica_count = 2; - */ - protected $target_replica_count = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $target_shard_count - * Target number of shards for redis cluster - * @type int $target_replica_count - * Target number of replica nodes per shard. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Target number of shards for redis cluster - * - * Generated from protobuf field optional int32 target_shard_count = 1; - * @return int - */ - public function getTargetShardCount() - { - return isset($this->target_shard_count) ? $this->target_shard_count : 0; - } - - public function hasTargetShardCount() - { - return isset($this->target_shard_count); - } - - public function clearTargetShardCount() - { - unset($this->target_shard_count); - } - - /** - * Target number of shards for redis cluster - * - * Generated from protobuf field optional int32 target_shard_count = 1; - * @param int $var - * @return $this - */ - public function setTargetShardCount($var) - { - GPBUtil::checkInt32($var); - $this->target_shard_count = $var; - - return $this; - } - - /** - * Target number of replica nodes per shard. - * - * Generated from protobuf field optional int32 target_replica_count = 2; - * @return int - */ - public function getTargetReplicaCount() - { - return isset($this->target_replica_count) ? $this->target_replica_count : 0; - } - - public function hasTargetReplicaCount() - { - return isset($this->target_replica_count); - } - - public function clearTargetReplicaCount() - { - unset($this->target_replica_count); - } - - /** - * Target number of replica nodes per shard. - * - * Generated from protobuf field optional int32 target_replica_count = 2; - * @param int $var - * @return $this - */ - public function setTargetReplicaCount($var) - { - GPBUtil::checkInt32($var); - $this->target_replica_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpdateInfo::class, \Google\Cloud\Redis\Cluster\V1\Cluster_StateInfo_UpdateInfo::class); - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php deleted file mode 100644 index a4ec433911f9..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php +++ /dev/null @@ -1,238 +0,0 @@ -google.cloud.redis.cluster.v1.CreateClusterRequest - */ -class CreateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The cluster that is to be created. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = null; - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 4; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. The cluster that is to be created. - * @param string $clusterId Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * @return \Google\Cloud\Redis\Cluster\V1\CreateClusterRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Redis\Cluster\V1\Cluster $cluster, string $clusterId): self - { - return (new self()) - ->setParent($parent) - ->setCluster($cluster) - ->setClusterId($clusterId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @type string $cluster_id - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster - * Required. The cluster that is to be created. - * @type string $request_id - * Idempotent request UUID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. The logical name of the Redis cluster in the customer project - * with the following restrictions: - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-63 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project / location - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The cluster that is to be created. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The cluster that is to be created. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); - $this->cluster = $var; - - return $this; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 4; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 4; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php deleted file mode 100644 index c8eb432dad73..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.redis.cluster.v1.DeleteClusterRequest - */ -class DeleteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 2; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest - * - * @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. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * @type string $request_id - * Idempotent request UUID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 2; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 2; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php deleted file mode 100644 index fc450c18b9c3..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.redis.cluster.v1.DiscoveryEndpoint - */ -class DiscoveryEndpoint extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * - * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $address = ''; - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $port = 0; - /** - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $psc_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $address - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * @type int $port - * Output only. The port number of the exposed Redis endpoint. - * @type \Google\Cloud\Redis\Cluster\V1\PscConfig $psc_config - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * - * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Output only. Address of the exposed Redis endpoint used by clients to - * connect to the service. The address could be either IP or hostname. - * - * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAddress($var) - { - GPBUtil::checkString($var, True); - $this->address = $var; - - return $this; - } - - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Output only. The port number of the exposed Redis endpoint. - * - * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Redis\Cluster\V1\PscConfig|null - */ - public function getPscConfig() - { - return $this->psc_config; - } - - public function hasPscConfig() - { - return isset($this->psc_config); - } - - public function clearPscConfig() - { - unset($this->psc_config); - } - - /** - * Output only. Customer configuration for where the endpoint is created and - * accessed from. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Redis\Cluster\V1\PscConfig $var - * @return $this - */ - public function setPscConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); - $this->psc_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php deleted file mode 100644 index e457cb50362a..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.redis.cluster.v1.GetClusterRequest - */ -class GetClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\GetClusterRequest - * - * @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. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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. Redis cluster resource name using the form: - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - * where `location_id` refers to a GCP region. - * - * 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php deleted file mode 100644 index 7d993d799de4..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.redis.cluster.v1.ListClustersRequest - */ -class ListClustersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. Please see - * {@see CloudRedisClusterClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Redis\Cluster\V1\ListClustersRequest - * - * @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 resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * @type int $page_size - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * @type string $page_token - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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 resource name of the cluster location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region. - * - * 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; - } - - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. - * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] - * to determine if there are more clusters left to be queried. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The `next_page_token` value returned from a previous - * [ListClusters][CloudRedis.ListClusters] request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php deleted file mode 100644 index efc059d380c2..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.redis.cluster.v1.ListClustersResponse - */ -class ListClustersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; - */ - private $clusters; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * 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\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClusters() - { - return $this->clusters; - } - - /** - * A list of Redis clusters in the project in the specified location, - * or across all locations. - * If the `location_id` in the parent field of the request is "-", all regions - * available to the project are queried, and the results aggregated. - * If in such an aggregated query a location is unavailable, a placeholder - * Redis entry is included in the response with the `name` field set to a - * value of the form - * `projects/{project_id}/locations/{location_id}/clusters/`- and the - * `status` field set to ERROR and `status_message` field set to "location not - * available for ListClusters". - * - * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; - * @param array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClusters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\Cluster::class); - $this->clusters = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php deleted file mode 100644 index 9abe7ef897ee..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.redis.cluster.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php deleted file mode 100644 index ee2fe513f106..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.redis.cluster.v1.PscConfig - */ -class PscConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $network = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Required. The network where the IP address of the discovery endpoint will - * be reserved, in the form of - * projects/{network_project}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php deleted file mode 100644 index 318d11f69361..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php +++ /dev/null @@ -1,227 +0,0 @@ -google.cloud.redis.cluster.v1.PscConnection - */ -class PscConnection extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * - * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $psc_connection_id = ''; - /** - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $address = ''; - /** - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * - * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $forwarding_rule = ''; - /** - * Output only. The consumer project_id where the forwarding rule is created - * from. - * - * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $project_id = ''; - /** - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 5; - */ - protected $network = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $psc_connection_id - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * @type string $address - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * @type string $forwarding_rule - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * @type string $project_id - * Output only. The consumer project_id where the forwarding rule is created - * from. - * @type string $network - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * - * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPscConnectionId() - { - return $this->psc_connection_id; - } - - /** - * Output only. The PSC connection id of the forwarding rule connected to the - * service attachment. - * - * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPscConnectionId($var) - { - GPBUtil::checkString($var, True); - $this->psc_connection_id = $var; - - return $this; - } - - /** - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Output only. The IP allocated on the consumer network for the PSC - * forwarding rule. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setAddress($var) - { - GPBUtil::checkString($var, True); - $this->address = $var; - - return $this; - } - - /** - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * - * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getForwardingRule() - { - return $this->forwarding_rule; - } - - /** - * Output only. The URI of the consumer side forwarding rule. - * Example: - * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. - * - * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setForwardingRule($var) - { - GPBUtil::checkString($var, True); - $this->forwarding_rule = $var; - - return $this; - } - - /** - * Output only. The consumer project_id where the forwarding rule is created - * from. - * - * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Output only. The consumer project_id where the forwarding rule is created - * from. - * - * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 5; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * The consumer network where the IP address resides, in the form of - * projects/{project_id}/global/networks/{network_id}. - * - * Generated from protobuf field string network = 5; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php deleted file mode 100644 index 70baeb4693b6..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.redis.cluster.v1.TransitEncryptionMode - */ -class TransitEncryptionMode -{ - /** - * In-transit encryption not set. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; - */ - const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; - /** - * In-transit encryption disabled. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_DISABLED = 1; - */ - const TRANSIT_ENCRYPTION_MODE_DISABLED = 1; - /** - * Use server managed encryption for in-transit encryption. - * - * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; - */ - const TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; - - private static $valueToName = [ - self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED', - self::TRANSIT_ENCRYPTION_MODE_DISABLED => 'TRANSIT_ENCRYPTION_MODE_DISABLED', - self::TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION => 'TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION', - ]; - - 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php deleted file mode 100644 index 0f67d0fe41e9..000000000000 --- a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php +++ /dev/null @@ -1,196 +0,0 @@ -google.cloud.redis.cluster.v1.UpdateClusterRequest - */ -class UpdateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = null; - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 3; - */ - protected $request_id = ''; - - /** - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. Update description. - * Only fields specified in update_mask are updated. - * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * - * * `size_gb` - * * `replica_count` - * - * @return \Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Redis\Cluster\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCluster($cluster) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster - * Required. Update description. - * Only fields specified in update_mask are updated. - * @type string $request_id - * Idempotent request UUID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); - parent::__construct($data); - } - - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. Mask of fields to update. At least one path must be supplied in - * this field. The elements of the repeated paths field may only include these - * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: - * * `size_gb` - * * `replica_count` - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. Update description. - * Only fields specified in update_mask are updated. - * - * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); - $this->cluster = $var; - - return $this; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 3; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Idempotent request UUID. - * - * Generated from protobuf field string request_id = 3; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php deleted file mode 100644 index 54dd9d7d7369..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php +++ /dev/null @@ -1,132 +0,0 @@ -setNetwork($clusterPscConfigsNetwork); - $clusterPscConfigs = [$pscConfig,]; - $cluster = (new Cluster()) - ->setName($clusterName) - ->setShardCount($clusterShardCount) - ->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClusterClient->createCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } 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 -{ - $formattedParent = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $clusterName = '[NAME]'; - $clusterShardCount = 0; - $clusterPscConfigsNetwork = '[NETWORK]'; - - create_cluster_sample( - $formattedParent, - $clusterId, - $clusterName, - $clusterShardCount, - $clusterPscConfigsNetwork - ); -} -// [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php deleted file mode 100644 index ee3e020173b0..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClusterClient->deleteCluster($request); - $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 -{ - $formattedName = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - delete_cluster_sample($formattedName); -} -// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php deleted file mode 100644 index 6fb81f5b64ba..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Cluster $response */ - $response = $cloudRedisClusterClient->getCluster($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::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - get_cluster_sample($formattedName); -} -// [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php deleted file mode 100644 index a92286bb4074..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END redis_v1_generated_CloudRedisCluster_GetLocation_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php deleted file mode 100644 index 8c213fe52b86..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php +++ /dev/null @@ -1,86 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudRedisClusterClient->listClusters($request); - - /** @var Cluster $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 = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); - - list_clusters_sample($formattedParent); -} -// [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php deleted file mode 100644 index 484811919b90..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $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()); - } -} -// [END redis_v1_generated_CloudRedisCluster_ListLocations_sync] diff --git a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php deleted file mode 100644 index da166dd875d7..000000000000 --- a/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php +++ /dev/null @@ -1,108 +0,0 @@ -setNetwork($clusterPscConfigsNetwork); - $clusterPscConfigs = [$pscConfig,]; - $cluster = (new Cluster()) - ->setName($clusterName) - ->setShardCount($clusterShardCount) - ->setPscConfigs($clusterPscConfigs); - $request = (new UpdateClusterRequest()) - ->setUpdateMask($updateMask) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClusterClient->updateCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } 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 -{ - $clusterName = '[NAME]'; - $clusterShardCount = 0; - $clusterPscConfigsNetwork = '[NETWORK]'; - - update_cluster_sample($clusterName, $clusterShardCount, $clusterPscConfigsNetwork); -} -// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php b/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php deleted file mode 100644 index 79f15ce845a9..000000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php +++ /dev/null @@ -1,572 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_redis_cluster_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * certificate_authority resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted certificate_authority resource. - */ - public static function certificateAuthorityName(string $project, string $location, string $cluster): string - { - return self::getPathTemplate('certificateAuthority')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName(string $project, string $location, string $cluster): string - { - return self::getPathTemplate('cluster')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->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 - * - certificateAuthority: projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - location: projects/{project}/locations/{location} - * - * 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 - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'redis.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a Redis cluster based on the specified properties. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. Once the operation is completed the Redis - * cluster will be fully functional. The completed longrunning.Operation will - * contain the new cluster object in the response field. - * - * The returned operation is automatically deleted after a few hours, so there - * is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClusterClient::createClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/create_cluster.php - * - * @param CreateClusterRequest $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 createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); - } - - /** - * Deletes a specific Redis cluster. Cluster stops serving and data is - * deleted. - * - * The async variant is {@see CloudRedisClusterClient::deleteClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/delete_cluster.php - * - * @param DeleteClusterRequest $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 deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); - } - - /** - * Gets the details of a specific Redis cluster. - * - * The async variant is {@see CloudRedisClusterClient::getClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/get_cluster.php - * - * @param GetClusterRequest $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 Cluster - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster - { - return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); - } - - /** - * Gets the details of certificate authority information for Redis cluster. - * - * The async variant is - * {@see CloudRedisClusterClient::getClusterCertificateAuthorityAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php - * - * @param GetClusterCertificateAuthorityRequest $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 CertificateAuthority - * - * @throws ApiException Thrown if the API call fails. - */ - public function getClusterCertificateAuthority(GetClusterCertificateAuthorityRequest $request, array $callOptions = []): CertificateAuthority - { - return $this->startApiCall('GetClusterCertificateAuthority', $request, $callOptions)->wait(); - } - - /** - * Lists all Redis clusters owned by a project in either the specified - * location (region) or all locations. - * - * The location should have the following format: - * - * * `projects/{project_id}/locations/{location_id}` - * - * If `location_id` is specified as `-` (wildcard), then all regions - * available to the project are queried, and the results are aggregated. - * - * The async variant is {@see CloudRedisClusterClient::listClustersAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/list_clusters.php - * - * @param ListClustersRequest $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 listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListClusters', $request, $callOptions); - } - - /** - * Updates the metadata and configuration of a specific Redis cluster. - * - * Completed longrunning.Operation will contain the new cluster object - * in the response field. The returned operation is automatically deleted - * after a few hours, so there is no need to call DeleteOperation. - * - * The async variant is {@see CloudRedisClusterClient::updateClusterAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/update_cluster.php - * - * @param UpdateClusterRequest $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 updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see CloudRedisClusterClient::getLocationAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/get_location.php - * - * @param GetLocationRequest $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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see CloudRedisClusterClient::listLocationsAsync()} . - * - * @example samples/V1/CloudRedisClusterClient/list_locations.php - * - * @param ListLocationsRequest $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 listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json b/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 3c75e8b0b86c..000000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.redis.cluster.v1", - "libraryPackage": "Google\\Cloud\\Redis\\Cluster\\V1", - "services": { - "CloudRedisCluster": { - "clients": { - "grpc": { - "libraryClient": "CloudRedisClusterGapicClient", - "rpcs": { - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetClusterCertificateAuthority": { - "methods": [ - "getClusterCertificateAuthority" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json deleted file mode 100644 index 11c25ca9ac4a..000000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.redis.cluster.v1.CloudRedisCluster": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetClusterCertificateAuthority": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListClusters": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateCluster": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php deleted file mode 100644 index 686a9576bac4..000000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php +++ /dev/null @@ -1,169 +0,0 @@ - [ - 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ - 'CreateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', - 'metadataReturnType' => '\Google\Protobuf\Any', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Protobuf\Any', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', - 'metadataReturnType' => '\Google\Protobuf\Any', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'cluster.name', - 'fieldAccessors' => [ - 'getCluster', - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Redis\Cluster\V1\Cluster', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetClusterCertificateAuthority' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Redis\Cluster\V1\CertificateAuthority', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListClusters' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getClusters', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Redis\Cluster\V1\ListClustersResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'certificateAuthority' => 'projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority', - 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', - 'location' => 'projects/{project}/locations/{location}', - ], - ], - ], -]; diff --git a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php deleted file mode 100644 index 69fe4ba287c9..000000000000 --- a/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php +++ /dev/null @@ -1,174 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ - 'CreateCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'cluster_id', - ], - ], - 'DeleteCluster' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetClusterCertificateAuthority' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListClusters' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', - 'body' => 'cluster', - 'placeholders' => [ - 'cluster.name' => [ - 'getters' => [ - 'getCluster', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php b/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php deleted file mode 100644 index de2b3c0055d0..000000000000 --- a/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php +++ /dev/null @@ -1,940 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudRedisClusterClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudRedisClusterClient($options); - } - - /** @test */ - public function createClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/DeleteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->getCluster($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.redis.cluster.v1.CloudRedisCluster/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); - try { - $gapicClient->getCluster($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 getClusterCertificateAuthorityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new CertificateAuthority(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterCertificateAuthorityRequest()) - ->setName($formattedName); - $response = $gapicClient->getClusterCertificateAuthority($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.redis.cluster.v1.CloudRedisCluster/GetClusterCertificateAuthority', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterCertificateAuthorityExceptionTest() - { - $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->certificateAuthorityName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterCertificateAuthorityRequest()) - ->setName($formattedName); - try { - $gapicClient->getClusterCertificateAuthority($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 listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $clustersElement = new Cluster(); - $clusters = [ - $clustersElement, - ]; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setClusters($clusters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListClustersRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listClusters($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $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 ListClustersRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listClusters($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 updateClusterTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new UpdateClusterRequest()) - ->setUpdateMask($updateMask) - ->setCluster($cluster); - $response = $gapicClient->updateCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateClusterExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new UpdateClusterRequest()) - ->setUpdateMask($updateMask) - ->setCluster($cluster); - $response = $gapicClient->updateCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($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.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $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); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($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 listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $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); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($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 createClusterAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $replicaCount = 564075208; - $sizeGb = 2105542105; - $shardCount = 495377042; - $preciseSizeGb = 1.3422684E8; - $deletionProtectionEnabled = true; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setReplicaCount($replicaCount); - $expectedResponse->setSizeGb($sizeGb); - $expectedResponse->setShardCount($shardCount); - $expectedResponse->setPreciseSizeGb($preciseSizeGb); - $expectedResponse->setDeletionProtectionEnabled($deletionProtectionEnabled); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterName = 'clusterName-1141738587'; - $cluster->setName($clusterName); - $clusterShardCount = 1450084715; - $cluster->setShardCount($clusterShardCount); - $clusterPscConfigs = []; - $cluster->setPscConfigs($clusterPscConfigs); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createClusterAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -}