From affdc80782eab7b42ac02541477a7138febad9cf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 5 Jun 2024 08:54:31 +0000 Subject: [PATCH 1/2] feat: [Memorystore for Redis Cluster] Add support for different node types feat: [Memorystore for Redis Cluster] Add persistence support feat: [Memorystore for Redis Cluster] Get details of certificate authority from redis cluster docs: [Memorystore for Redis Cluster] size_gb field shows the size of the cluster rounded up to the next integer, precise_size_gb field will show the exact size of the cluster PiperOrigin-RevId: 640389721 Source-Link: https://github.com/googleapis/googleapis/commit/8bca64a28cfdb648efbd7a659ad02962897228df Source-Link: https://github.com/googleapis/googleapis-gen/commit/24dbd227a55e7347733d59311837797c96d6d554 Copy-Tag: eyJwIjoiUmVkaXNDbHVzdGVyLy5Pd2xCb3QueWFtbCIsImgiOiIyNGRiZDIyN2E1NWU3MzQ3NzMzZDU5MzExODM3Nzk3Yzk2ZDZkNTU0In0= --- .../Redis/Cluster/V1/CloudRedisCluster.php | Bin 0 -> 8132 bytes .../Redis/Cluster/V1/AuthorizationMode.php | 61 ++ .../Redis/Cluster/V1/CertificateAuthority.php | 112 +++ .../ManagedCertificateAuthority.php | 72 ++ .../ManagedCertificateAuthority/CertChain.php | 68 ++ .../Google/Cloud/Redis/Cluster/V1/Cluster.php | 821 +++++++++++++++ .../Cloud/Redis/Cluster/V1/Cluster/State.php | 78 ++ .../Redis/Cluster/V1/Cluster/StateInfo.php | 78 ++ .../V1/Cluster/StateInfo/UpdateInfo.php | 124 +++ .../Cluster/V1/ClusterPersistenceConfig.php | 155 +++ .../V1/ClusterPersistenceConfig/AOFConfig.php | 70 ++ .../AOFConfig/AppendFsync.php | 74 ++ .../PersistenceMode.php | 71 ++ .../V1/ClusterPersistenceConfig/RDBConfig.php | 122 +++ .../RDBConfig/SnapshotPeriod.php | 78 ++ .../Redis/Cluster/V1/CreateClusterRequest.php | 238 +++++ .../Redis/Cluster/V1/DeleteClusterRequest.php | 125 +++ .../Redis/Cluster/V1/DiscoveryEndpoint.php | 153 +++ .../GetClusterCertificateAuthorityRequest.php | 92 ++ .../Redis/Cluster/V1/GetClusterRequest.php | 91 ++ .../Redis/Cluster/V1/ListClustersRequest.php | 183 ++++ .../Redis/Cluster/V1/ListClustersResponse.php | 175 ++++ .../Cloud/Redis/Cluster/V1/NodeType.php | 73 ++ .../Redis/Cluster/V1/OperationMetadata.php | 307 ++++++ .../Cloud/Redis/Cluster/V1/PscConfig.php | 73 ++ .../Cloud/Redis/Cluster/V1/PscConnection.php | 227 +++++ .../Cluster/V1/TransitEncryptionMode.php | 61 ++ .../Redis/Cluster/V1/UpdateClusterRequest.php | 196 ++++ .../Cluster/V1/ZoneDistributionConfig.php | 113 +++ .../ZoneDistributionMode.php | 69 ++ .../create_cluster.php | 132 +++ .../delete_cluster.php | 83 ++ .../CloudRedisClusterClient/get_cluster.php | 73 ++ .../get_cluster_certificate_authority.php | 77 ++ .../CloudRedisClusterClient/get_location.php | 57 ++ .../CloudRedisClusterClient/list_clusters.php | 86 ++ .../list_locations.php | 62 ++ .../update_cluster.php | 108 ++ .../src/V1/Client/CloudRedisClusterClient.php | 572 +++++++++++ .../v1/src/V1/gapic_metadata.json | 58 ++ .../cloud_redis_cluster_client_config.json | 72 ++ .../cloud_redis_cluster_descriptor_config.php | 169 ++++ ...cloud_redis_cluster_rest_client_config.php | 174 ++++ .../V1/Client/CloudRedisClusterClientTest.php | 940 ++++++++++++++++++ 44 files changed, 6823 insertions(+) create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php create mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php create mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php create mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php create mode 100644 owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php 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 new file mode 100644 index 0000000000000000000000000000000000000000..ca7ebc33312f87bc11e52448e82a5a795f30bf79 GIT binary patch literal 8132 zcmb^$O>^7U(IEA?l=bl>*|h995begcYEu=HHYpv~1wSM*BYu>moXEoj1Cfw~m;z7$ zv@1JmGQFgiP7gix(o4_1cBY*kbIPSN?evmM+nJu+=^x0c`#u1YB4tWSbP@R8?!Nur zef!>hXz$x_L*CF$-O)U~DeoN0-o7r|j^$Ymt0nKWcXxG1ZdeDl(bAo`EN4n`u~d_@ znS5;-QC+L;H1wprXIXnKeYMfD+Rar*ZyGLsw_Q(nR-dl%WtAMt{ny1w_7`b|ylB-uJIs9hi>W|j$12kHi>&k4K?TSr!0W$vC?VXma*=Mgz z)r2al=S>vU)LQk7?lv65_AIB2pvmN(?gh%FE4S~6V<|afSH8`8OeXu7d?0&HTkk$y zmL1(|JLY}HHzjZseANdiPqB@wkXO$E(;a*ktb z21bjg9oU0$nSe$@(We+-}H7Yxo- z%{&xaR|S5srBf4%O+SSNo1D7?G?akwSq~sQ-x?es_7@2j(vFUqROF+I{?j(vi~JDA zY|TL>L?v0eJ(;@mFD3M~as!rIR)afkoU?}Na^sk7S2x85xlEHCQ>$t;qalVKMs)Hn zjEjwE7*`{SHw29nOcED7r5H8=a5!_6>Ob?;uA`Xh$UH>aCYq?R zukEySJU@(r{|@c8WnAJNo? z)y5PsfqSELPs&~Rr6iG`0MWR5p0iw_9#~C18bPS(#P^19AoR)+3y8<)lE-k_b2QU6 zJXJRv&Y?|4--Ui2ji=Oil0YY=hwHK!>Ao%Xjw zxe(n>LBw_&xM}Vhdv0`wMfB|QLwHI-A|C+3>gZxlM=#KY;-d?Usketv5=@ml_#HDy zq(+?@4G|b~ktyt*(-DnVC@!bxW=+pImx)JGEchj7zp{5Y>flw$6}(q|GtXMwy9#M2zSRjA#8 zMo${$$z&N81VC@nq3L;)MQLgg=GA^8smrkFFZZCP#$bfXv-Bp+_1TR?ApAr>wVX}o*YnxT>;*Cf6X{A;spX3svl3R6 zF(qBgKg!OA=+0I-!*{~;S0=leWpE?O4__*eUtQ@)63zE9n$KN*A-;}QgKlf}h5vbk z-6`v?5Kep@rDkCoFRNWSI|VSonizD+)HF)mJ!DY#Anl#6}ii z+|<2imh+^mzl(hebLgc!)A{*|f@;ksw#Bp|3Q7#tKihIV-eIv|AquuxL9P|$?@XyS z9Q&077ke@sxejxJsK|M=ckJS$i#yg1a8|Ct%&z4;!@7WXHPvaewkzNr`&(h3pb_P0 zGaaq4Y8v}21arYn&z}^KV}+gv-Oxh61`}93cyGXaw4o^TFvg>XH?5pW)I3(A9o|6m zrK>PaD?r;-@v7!x_uJhJ+<;4>XVS4sYM7N5xfVeNZ7?Z6dex? z9s5TZFBk*5A<}}m1I@(4nyRZih>66RWg>~vumm)KUcA7G4LU1#A?UXPBTp>-L4vEV zKq61DmB$7M&+=RO?QfZ{IAu1yuNmeNMpy6yLuQH|D;iOL`egFcm&zw+Xg5je{OM%1 z>-eA#PDNlcuvF~xafqH&aIu*iVI3iL?dinEFtzb?)>pUVT`Qet?lJc8%^klp;E|x5 z_k>C&)m=-Gwr1`6wD}$N+_aU_dKc}bKZjs4IF2|lPo;28&35-Ky!GjhVe!l~ohW}} zapF}$7*&XLX_!lRRk+-9CdRzuogtw}c-@}vC5+YmYPG18tGQB5EoUqFQl`IJmWo+5 zSK6vzwY-SUNB#r$tBM747N%MVt!!7bX_S#R2%GOK+bCVE3Ny!in#gbs^;XSSYuREts}@R`0sTfMUsY0@*nLQ3 z9Kz^DNEbhlaU}X*2`&w85Xpx*g0i_eJF@ay2^I%lZb|(X z+^AKQVl`h=(R(V}<&)HU6XcTs1KB0A2KP>as%9(b(oA_6o%u92xuxQ4DDefrT;H1p z`J)6=-QzKm7~*=}z+&FA^yZmx`1~#Q;44MUEr0R%|NJHtCwJ*%&I>-ud=ON`m9EBm zrPEN8-{ak-GYulcZs#3PpXpOhG-LO_QrIZ0hf6veJAube&%bg+{*7&J&+v~7(^U_& z&+BWxg1d&(@t|Feee$Jpy)&?y=i@m(HpUrs93LURQs%`40MxXWrQ+_z3C8u=$m)H7-yDp3#g zDJ6P-3aee=;c(YCp7@Wq8D_h;V`mDQj?Mlj!Szl^(0=y#ER|$@pF3eb`D%1u2gBTb z(9yAScgUrQ!u<1e#v9lVA1&p+R2Bw}fB&Y$_dU;cldG%Go;?#12k#_wa*E-M&&2m^ zyh-6j^B{%e{AGMYd9`vgoogle.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/CertificateAuthority.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php new file mode 100644 index 000000000000..65adb51a42bd --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority.php @@ -0,0 +1,112 @@ +google.cloud.redis.cluster.v1.CertificateAuthority + */ +class CertificateAuthority extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + protected $server_ca; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $managed_server_ca + * @type string $name + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; + * @return \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority|null + */ + public function getManagedServerCa() + { + return $this->readOneof(1); + } + + public function hasManagedServerCa() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 1; + * @param \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority $var + * @return $this + */ + public function setManagedServerCa($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Unique name of the resource in this scope including project, + * location and cluster using the form: + * `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getServerCa() + { + return $this->whichOneof("server_ca"); + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php new file mode 100644 index 000000000000..e5e61afb2624 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority.php @@ -0,0 +1,72 @@ +google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority + */ +class ManagedCertificateAuthority extends \Google\Protobuf\Internal\Message +{ + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + */ + private $ca_certs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $ca_certs + * The PEM encoded CA certificate chains for redis managed + * server authentication + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCaCerts() + { + return $this->ca_certs; + } + + /** + * The PEM encoded CA certificate chains for redis managed + * server authentication + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * @param array<\Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCaCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\CertificateAuthority\ManagedCertificateAuthority\CertChain::class); + $this->ca_certs = $arr; + + return $this; + } + +} + +// 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php new file mode 100644 index 000000000000..6aa46fd7e72b --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php @@ -0,0 +1,68 @@ +google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + */ +class CertChain extends \Google\Protobuf\Internal\Message +{ + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + */ + private $certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $certificates + * The certificates that form the CA chain, from leaf to root order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCertificates() + { + return $this->certificates; + } + + /** + * The certificates that form the CA chain, from leaf to root order. + * + * Generated from protobuf field repeated string certificates = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->certificates = $arr; + + return $this; + } + +} + +// 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/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 new file mode 100644 index 000000000000..58b6ccfa3e61 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php @@ -0,0 +1,821 @@ +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 new file mode 100644 index 000000000000..3cd28633110d --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php @@ -0,0 +1,78 @@ +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 new file mode 100644 index 000000000000..05eb2f09fd6f --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php @@ -0,0 +1,78 @@ +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 new file mode 100644 index 000000000000..ad999e1fee0f --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php @@ -0,0 +1,124 @@ +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/ClusterPersistenceConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php new file mode 100644 index 000000000000..b17af3046ed1 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig.php @@ -0,0 +1,155 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig + */ +class ClusterPersistenceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_config = null; + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $aof_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The mode of persistence. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $rdb_config + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * @type \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $aof_config + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of persistence. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\PersistenceMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig|null + */ + public function getRdbConfig() + { + return $this->rdb_config; + } + + public function hasRdbConfig() + { + return isset($this->rdb_config); + } + + public function clearRdbConfig() + { + unset($this->rdb_config); + } + + /** + * Optional. RDB configuration. This field will be ignored if mode is not RDB. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig $var + * @return $this + */ + public function setRdbConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig::class); + $this->rdb_config = $var; + + return $this; + } + + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig|null + */ + public function getAofConfig() + { + return $this->aof_config; + } + + public function hasAofConfig() + { + return isset($this->aof_config); + } + + public function clearAofConfig() + { + unset($this->aof_config); + } + + /** + * Optional. AOF configuration. This field will be ignored if mode is not AOF. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig $var + * @return $this + */ + public function setAofConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig::class); + $this->aof_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php new file mode 100644 index 000000000000..8aab049465e7 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig.php @@ -0,0 +1,70 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig + */ +class AOFConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $append_fsync = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $append_fsync + * Optional. fsync configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAppendFsync() + { + return $this->append_fsync; + } + + /** + * Optional. fsync configuration. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAppendFsync($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\AOFConfig\AppendFsync::class); + $this->append_fsync = $var; + + return $this; + } + +} + +// 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php new file mode 100644 index 000000000000..ec1a3a6654af --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php @@ -0,0 +1,74 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync + */ +class AppendFsync +{ + /** + * Not set. Default: EVERYSEC + * + * Generated from protobuf enum APPEND_FSYNC_UNSPECIFIED = 0; + */ + const APPEND_FSYNC_UNSPECIFIED = 0; + /** + * Never fsync. Normally Linux will flush data every 30 seconds with this + * configuration, but it's up to the kernel's exact tuning. + * + * Generated from protobuf enum NO = 1; + */ + const NO = 1; + /** + * fsync every second. Fast enough, and you may lose 1 second of data if + * there is a disaster + * + * Generated from protobuf enum EVERYSEC = 2; + */ + const EVERYSEC = 2; + /** + * fsync every time new commands are appended to the AOF. It has the best + * data loss protection at the cost of performance + * + * Generated from protobuf enum ALWAYS = 3; + */ + const ALWAYS = 3; + + private static $valueToName = [ + self::APPEND_FSYNC_UNSPECIFIED => 'APPEND_FSYNC_UNSPECIFIED', + self::NO => 'NO', + self::EVERYSEC => 'EVERYSEC', + self::ALWAYS => 'ALWAYS', + ]; + + 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(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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php new file mode 100644 index 000000000000..0b99ded98ebe --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/PersistenceMode.php @@ -0,0 +1,71 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode + */ +class PersistenceMode +{ + /** + * Not set. + * + * Generated from protobuf enum PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + const PERSISTENCE_MODE_UNSPECIFIED = 0; + /** + * Persistence is disabled, and any snapshot data is deleted. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * RDB based persistence is enabled. + * + * Generated from protobuf enum RDB = 2; + */ + const RDB = 2; + /** + * AOF based persistence is enabled. + * + * Generated from protobuf enum AOF = 3; + */ + const AOF = 3; + + private static $valueToName = [ + self::PERSISTENCE_MODE_UNSPECIFIED => 'PERSISTENCE_MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::RDB => 'RDB', + self::AOF => 'AOF', + ]; + + 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(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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php new file mode 100644 index 000000000000..2d16c395c5e1 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig.php @@ -0,0 +1,122 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig + */ +class RDBConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_period = 0; + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rdb_snapshot_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $rdb_snapshot_period + * Optional. Period between RDB snapshots. + * @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRdbSnapshotPeriod() + { + return $this->rdb_snapshot_period; + } + + /** + * Optional. Period between RDB snapshots. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRdbSnapshotPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ClusterPersistenceConfig\RDBConfig\SnapshotPeriod::class); + $this->rdb_snapshot_period = $var; + + return $this; + } + + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRdbSnapshotStartTime() + { + return $this->rdb_snapshot_start_time; + } + + public function hasRdbSnapshotStartTime() + { + return isset($this->rdb_snapshot_start_time); + } + + public function clearRdbSnapshotStartTime() + { + unset($this->rdb_snapshot_start_time); + } + + /** + * Optional. The time that the first snapshot was/will be attempted, and to + * which future snapshots will be aligned. If not provided, the current time + * will be used. + * + * Generated from protobuf field .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRdbSnapshotStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->rdb_snapshot_start_time = $var; + + return $this; + } + +} + +// 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/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php new file mode 100644 index 000000000000..21d491f77fde --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php @@ -0,0 +1,78 @@ +google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod + */ +class SnapshotPeriod +{ + /** + * Not set. + * + * Generated from protobuf enum SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + const SNAPSHOT_PERIOD_UNSPECIFIED = 0; + /** + * One hour. + * + * Generated from protobuf enum ONE_HOUR = 1; + */ + const ONE_HOUR = 1; + /** + * Six hours. + * + * Generated from protobuf enum SIX_HOURS = 2; + */ + const SIX_HOURS = 2; + /** + * Twelve hours. + * + * Generated from protobuf enum TWELVE_HOURS = 3; + */ + const TWELVE_HOURS = 3; + /** + * Twenty four hours. + * + * Generated from protobuf enum TWENTY_FOUR_HOURS = 4; + */ + const TWENTY_FOUR_HOURS = 4; + + private static $valueToName = [ + self::SNAPSHOT_PERIOD_UNSPECIFIED => 'SNAPSHOT_PERIOD_UNSPECIFIED', + self::ONE_HOUR => 'ONE_HOUR', + self::SIX_HOURS => 'SIX_HOURS', + self::TWELVE_HOURS => 'TWELVE_HOURS', + self::TWENTY_FOUR_HOURS => 'TWENTY_FOUR_HOURS', + ]; + + 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(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/CreateClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php new file mode 100644 index 000000000000..a4ec433911f9 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php @@ -0,0 +1,238 @@ +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 new file mode 100644 index 000000000000..c8eb432dad73 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php @@ -0,0 +1,125 @@ +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 new file mode 100644 index 000000000000..fc450c18b9c3 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php @@ -0,0 +1,153 @@ +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/GetClusterCertificateAuthorityRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php new file mode 100644 index 000000000000..5a8f0feed587 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterCertificateAuthorityRequest.php @@ -0,0 +1,92 @@ +google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest + */ +class GetClusterCertificateAuthorityRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * 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 certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::certificateAuthorityName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\GetClusterCertificateAuthorityRequest + * + * @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 certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * 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 certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * 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 certificate authority resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + * 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/GetClusterRequest.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php new file mode 100644 index 000000000000..e457cb50362a --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php @@ -0,0 +1,91 @@ +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 new file mode 100644 index 000000000000..7d993d799de4 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php @@ -0,0 +1,183 @@ +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 new file mode 100644 index 000000000000..efc059d380c2 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php @@ -0,0 +1,175 @@ +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/NodeType.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php new file mode 100644 index 000000000000..3fe082e637cb --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/NodeType.php @@ -0,0 +1,73 @@ +google.cloud.redis.cluster.v1.NodeType + */ +class NodeType +{ + /** + * Generated from protobuf enum NODE_TYPE_UNSPECIFIED = 0; + */ + const NODE_TYPE_UNSPECIFIED = 0; + /** + * Redis shared core nano node_type. + * + * Generated from protobuf enum REDIS_SHARED_CORE_NANO = 1; + */ + const REDIS_SHARED_CORE_NANO = 1; + /** + * Redis highmem medium node_type. + * + * Generated from protobuf enum REDIS_HIGHMEM_MEDIUM = 2; + */ + const REDIS_HIGHMEM_MEDIUM = 2; + /** + * Redis highmem xlarge node_type. + * + * Generated from protobuf enum REDIS_HIGHMEM_XLARGE = 3; + */ + const REDIS_HIGHMEM_XLARGE = 3; + /** + * Redis standard small node_type. + * + * Generated from protobuf enum REDIS_STANDARD_SMALL = 4; + */ + const REDIS_STANDARD_SMALL = 4; + + private static $valueToName = [ + self::NODE_TYPE_UNSPECIFIED => 'NODE_TYPE_UNSPECIFIED', + self::REDIS_SHARED_CORE_NANO => 'REDIS_SHARED_CORE_NANO', + self::REDIS_HIGHMEM_MEDIUM => 'REDIS_HIGHMEM_MEDIUM', + self::REDIS_HIGHMEM_XLARGE => 'REDIS_HIGHMEM_XLARGE', + self::REDIS_STANDARD_SMALL => 'REDIS_STANDARD_SMALL', + ]; + + 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/OperationMetadata.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php new file mode 100644 index 000000000000..9abe7ef897ee --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +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 new file mode 100644 index 000000000000..ee2fe513f106 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php @@ -0,0 +1,73 @@ +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 new file mode 100644 index 000000000000..318d11f69361 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php @@ -0,0 +1,227 @@ +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 new file mode 100644 index 000000000000..70baeb4693b6 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php @@ -0,0 +1,61 @@ +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 new file mode 100644 index 000000000000..0f67d0fe41e9 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php @@ -0,0 +1,196 @@ +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/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php new file mode 100644 index 000000000000..1645d3cf3f67 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig.php @@ -0,0 +1,113 @@ +google.cloud.redis.cluster.v1.ZoneDistributionConfig + */ +class ZoneDistributionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = 0; + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * @type string $zone + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + * specified. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig\ZoneDistributionMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Optional. When SINGLE ZONE distribution is selected, zone field would be + * used to allocate all resources in that zone. This is not applicable to + * MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php new file mode 100644 index 000000000000..a1d1598e5034 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ZoneDistributionConfig/ZoneDistributionMode.php @@ -0,0 +1,69 @@ +google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode + */ +class ZoneDistributionMode +{ + /** + * Not Set. Default: MULTI_ZONE + * + * Generated from protobuf enum ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + const ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + /** + * Distribute all resources across 3 zones picked at random, within the + * region. + * + * Generated from protobuf enum MULTI_ZONE = 1; + */ + const MULTI_ZONE = 1; + /** + * Distribute all resources in a single zone. The zone field must be + * specified, when this mode is selected. + * + * Generated from protobuf enum SINGLE_ZONE = 2; + */ + const SINGLE_ZONE = 2; + + private static $valueToName = [ + self::ZONE_DISTRIBUTION_MODE_UNSPECIFIED => 'ZONE_DISTRIBUTION_MODE_UNSPECIFIED', + self::MULTI_ZONE => 'MULTI_ZONE', + self::SINGLE_ZONE => 'SINGLE_ZONE', + ]; + + 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(ZoneDistributionMode::class, \Google\Cloud\Redis\Cluster\V1\ZoneDistributionConfig_ZoneDistributionMode::class); + 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 new file mode 100644 index 000000000000..54dd9d7d7369 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php @@ -0,0 +1,132 @@ +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 new file mode 100644 index 000000000000..ee3e020173b0 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php @@ -0,0 +1,83 @@ +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 new file mode 100644 index 000000000000..6fb81f5b64ba --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php @@ -0,0 +1,73 @@ +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_cluster_certificate_authority.php b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php new file mode 100644 index 000000000000..b23b63cb2e21 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CertificateAuthority $response */ + $response = $cloudRedisClusterClient->getClusterCertificateAuthority($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::certificateAuthorityName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + get_cluster_certificate_authority_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_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 new file mode 100644 index 000000000000..a92286bb4074 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000000..8c213fe52b86 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php @@ -0,0 +1,86 @@ +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 new file mode 100644 index 000000000000..484811919b90 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php @@ -0,0 +1,62 @@ +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 new file mode 100644 index 000000000000..da166dd875d7 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php @@ -0,0 +1,108 @@ +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 new file mode 100644 index 000000000000..79f15ce845a9 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php @@ -0,0 +1,572 @@ + 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 new file mode 100644 index 000000000000..3c75e8b0b86c --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "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 new file mode 100644 index 000000000000..11c25ca9ac4a --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json @@ -0,0 +1,72 @@ +{ + "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 new file mode 100644 index 000000000000..686a9576bac4 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php @@ -0,0 +1,169 @@ + [ + '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 new file mode 100644 index 000000000000..69fe4ba287c9 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php @@ -0,0 +1,174 @@ + [ + '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 new file mode 100644 index 000000000000..de2b3c0055d0 --- /dev/null +++ b/owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php @@ -0,0 +1,940 @@ +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()); + } +} From 04dcb7fefdeeb40507ad23cf92bd4ee0a6b32ac8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 5 Jun 2024 08:57:49 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../metadata/V1/CloudRedisCluster.php | Bin 5500 -> 8132 bytes .../get_cluster_certificate_authority.php | 0 .../src}/V1/CertificateAuthority.php | 0 .../ManagedCertificateAuthority.php | 2 - .../ManagedCertificateAuthority/CertChain.php | 2 - .../src/V1/Client/CloudRedisClusterClient.php | 52 + RedisCluster/src/V1/Cluster.php | 268 ++++- .../src}/V1/ClusterPersistenceConfig.php | 0 .../V1/ClusterPersistenceConfig/AOFConfig.php | 2 - .../AOFConfig/AppendFsync.php | 2 - .../PersistenceMode.php | 2 - .../V1/ClusterPersistenceConfig/RDBConfig.php | 2 - .../RDBConfig/SnapshotPeriod.php | 2 - .../GetClusterCertificateAuthorityRequest.php | 0 .../src}/V1/NodeType.php | 0 .../src}/V1/ZoneDistributionConfig.php | 0 .../ZoneDistributionMode.php | 2 - RedisCluster/src/V1/gapic_metadata.json | 5 + .../cloud_redis_cluster_client_config.json | 5 + .../cloud_redis_cluster_descriptor_config.php | 13 + ...cloud_redis_cluster_rest_client_config.php | 11 + .../V1/Client/CloudRedisClusterClientTest.php | 86 ++ .../Redis/Cluster/V1/CloudRedisCluster.php | Bin 8132 -> 0 bytes .../Redis/Cluster/V1/AuthorizationMode.php | 61 -- .../Google/Cloud/Redis/Cluster/V1/Cluster.php | 821 --------------- .../Cloud/Redis/Cluster/V1/Cluster/State.php | 78 -- .../Redis/Cluster/V1/Cluster/StateInfo.php | 78 -- .../V1/Cluster/StateInfo/UpdateInfo.php | 124 --- .../Redis/Cluster/V1/CreateClusterRequest.php | 238 ----- .../Redis/Cluster/V1/DeleteClusterRequest.php | 125 --- .../Redis/Cluster/V1/DiscoveryEndpoint.php | 153 --- .../Redis/Cluster/V1/GetClusterRequest.php | 91 -- .../Redis/Cluster/V1/ListClustersRequest.php | 183 ---- .../Redis/Cluster/V1/ListClustersResponse.php | 175 ---- .../Redis/Cluster/V1/OperationMetadata.php | 307 ------ .../Cloud/Redis/Cluster/V1/PscConfig.php | 73 -- .../Cloud/Redis/Cluster/V1/PscConnection.php | 227 ----- .../Cluster/V1/TransitEncryptionMode.php | 61 -- .../Redis/Cluster/V1/UpdateClusterRequest.php | 196 ---- .../create_cluster.php | 132 --- .../delete_cluster.php | 83 -- .../CloudRedisClusterClient/get_cluster.php | 73 -- .../CloudRedisClusterClient/get_location.php | 57 -- .../CloudRedisClusterClient/list_clusters.php | 86 -- .../list_locations.php | 62 -- .../update_cluster.php | 108 -- .../src/V1/Client/CloudRedisClusterClient.php | 572 ----------- .../v1/src/V1/gapic_metadata.json | 58 -- .../cloud_redis_cluster_client_config.json | 72 -- .../cloud_redis_cluster_descriptor_config.php | 169 ---- ...cloud_redis_cluster_rest_client_config.php | 174 ---- .../V1/Client/CloudRedisClusterClientTest.php | 940 ------------------ 52 files changed, 436 insertions(+), 5597 deletions(-) rename {owl-bot-staging/RedisCluster/v1 => RedisCluster}/samples/V1/CloudRedisClusterClient/get_cluster_certificate_authority.php (100%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/CertificateAuthority.php (100%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/CertificateAuthority/ManagedCertificateAuthority.php (92%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/CertificateAuthority/ManagedCertificateAuthority/CertChain.php (90%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ClusterPersistenceConfig.php (100%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ClusterPersistenceConfig/AOFConfig.php (91%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ClusterPersistenceConfig/AOFConfig/AppendFsync.php (91%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ClusterPersistenceConfig/PersistenceMode.php (90%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ClusterPersistenceConfig/RDBConfig.php (95%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ClusterPersistenceConfig/RDBConfig/SnapshotPeriod.php (90%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/GetClusterCertificateAuthorityRequest.php (100%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/NodeType.php (100%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ZoneDistributionConfig.php (100%) rename {owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster => RedisCluster/src}/V1/ZoneDistributionConfig/ZoneDistributionMode.php (90%) delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/GPBMetadata/Google/Cloud/Redis/Cluster/V1/CloudRedisCluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/AuthorizationMode.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/State.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/Cluster/StateInfo/UpdateInfo.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/CreateClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DeleteClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/DiscoveryEndpoint.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/GetClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/ListClustersResponse.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConfig.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/PscConnection.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/TransitEncryptionMode.php delete mode 100644 owl-bot-staging/RedisCluster/v1/proto/src/Google/Cloud/Redis/Cluster/V1/UpdateClusterRequest.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/create_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/delete_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/get_location.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_clusters.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/list_locations.php delete mode 100644 owl-bot-staging/RedisCluster/v1/samples/V1/CloudRedisClusterClient/update_cluster.php delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/Client/CloudRedisClusterClient.php delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_client_config.json delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_descriptor_config.php delete mode 100644 owl-bot-staging/RedisCluster/v1/src/V1/resources/cloud_redis_cluster_rest_client_config.php delete mode 100644 owl-bot-staging/RedisCluster/v1/tests/Unit/V1/Client/CloudRedisClusterClientTest.php diff --git a/RedisCluster/metadata/V1/CloudRedisCluster.php b/RedisCluster/metadata/V1/CloudRedisCluster.php index 958d741750aa35126f10d0c8f3a951dcf02301e2..ca7ebc33312f87bc11e52448e82a5a795f30bf79 100644 GIT binary patch delta 2162 zcmai$QE%H+6vt;LTjP_oO>dJlO{=YqD2!EPTF2U{AZPFYw$aUJ)<6FbSSO;{!}QaBU}P+C=5ezUTbTIsbFd zz4pI1PVRl@_rF?(m1pm*9KYkA^55Tsg&eUmjRVsnMur%cwxiWli|_~5UenO5!!mjQ zfS4A#2Yy}MCvj$uxz43;z2Mnb{35(*&j(_$Az1Rq(c?@YTEaLXV3XLCi zJh%d*2B~Xi2Q%Z*IUnWjb~&6XJ7y0t1>G_ZJ#ZezTL!6VCc&n5MDXr*JVsM8j@6g< zeZeqjYYXB>O`TvGz%sP$150b_-TJ27`tCS+9&A#lY@bhmfp5V~oivDxwv47lYVIS^ z)$InU$ERtSfLl@CPjlM0gD>wSZo|Yt)hGzQC*;uE1~dwnpQ?=m5@#vTt+IC+doJ|H z+i3)0d`?#SD$L>wN;vk7uCU9=Uwsf6HU_8x6Z@*J?vgq-iSd*exTd;Q1eat-eR~*{ z5H4rd7uAq* zfXtq%>4|yZdM_vfAty!WEO?o?)%IWfhu*|TPmR5Uf@J&K(5ig15A4~}LEw5_OMX5A z@y>}G7-zHz{(X8b+}4gQ<+=m>?to{iZ$+epH_w{@Mt!?GolaweOMExTav$OiXR4e{ z_m3&X)#gqY_npPXL7bP@`tZb0EO5Pu$bd9Ev?qMpS2Fm)!ZX{m;VEsb7Ito=#gwKkLd0LIRe=o-u@5?@mCas`)!azW1GbxA1+ znZjB@$c8VW5CmjNzqr;7(%Xa5du)n#!8M0-btgp#_N}2=i1VeAAZ78I zQk632pi~4YBVbX^ z+P6ZJxokn<(?!}Q291D^?hXw_A84&K&fg5ghTnYX@tIkE;K*(dcTJsNKAmWKNgUCO z)w|-nPGE=(^GB~ka?{yFT5qLXNUv84vgC*mPMfpfZuS^}xL&Lju;WfujYCi=NV%fm zEwJ|LxZ3`Tfk5{Yg{C1YIe{wGQeQMTSOQ{Yfu_Vto~I8uBbNm%@oxL$5b0V}+e<;z*DhmID96yd+WBvm?YNA#E delta 60 zcmV-C0K@;pKm0171O&7q3OA8UH?ung7X$*Y3A4Tk-vX0B4egU+4&$?V4>tmm7-5t1 S7@Y#t2(ywI3Iwx^9ykG)&lPF_ 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 ca7ebc33312f87bc11e52448e82a5a795f30bf79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8132 zcmb^$O>^7U(IEA?l=bl>*|h995begcYEu=HHYpv~1wSM*BYu>moXEoj1Cfw~m;z7$ zv@1JmGQFgiP7gix(o4_1cBY*kbIPSN?evmM+nJu+=^x0c`#u1YB4tWSbP@R8?!Nur zef!>hXz$x_L*CF$-O)U~DeoN0-o7r|j^$Ymt0nKWcXxG1ZdeDl(bAo`EN4n`u~d_@ znS5;-QC+L;H1wprXIXnKeYMfD+Rar*ZyGLsw_Q(nR-dl%WtAMt{ny1w_7`b|ylB-uJIs9hi>W|j$12kHi>&k4K?TSr!0W$vC?VXma*=Mgz z)r2al=S>vU)LQk7?lv65_AIB2pvmN(?gh%FE4S~6V<|afSH8`8OeXu7d?0&HTkk$y zmL1(|JLY}HHzjZseANdiPqB@wkXO$E(;a*ktb z21bjg9oU0$nSe$@(We+-}H7Yxo- z%{&xaR|S5srBf4%O+SSNo1D7?G?akwSq~sQ-x?es_7@2j(vFUqROF+I{?j(vi~JDA zY|TL>L?v0eJ(;@mFD3M~as!rIR)afkoU?}Na^sk7S2x85xlEHCQ>$t;qalVKMs)Hn zjEjwE7*`{SHw29nOcED7r5H8=a5!_6>Ob?;uA`Xh$UH>aCYq?R zukEySJU@(r{|@c8WnAJNo? z)y5PsfqSELPs&~Rr6iG`0MWR5p0iw_9#~C18bPS(#P^19AoR)+3y8<)lE-k_b2QU6 zJXJRv&Y?|4--Ui2ji=Oil0YY=hwHK!>Ao%Xjw zxe(n>LBw_&xM}Vhdv0`wMfB|QLwHI-A|C+3>gZxlM=#KY;-d?Usketv5=@ml_#HDy zq(+?@4G|b~ktyt*(-DnVC@!bxW=+pImx)JGEchj7zp{5Y>flw$6}(q|GtXMwy9#M2zSRjA#8 zMo${$$z&N81VC@nq3L;)MQLgg=GA^8smrkFFZZCP#$bfXv-Bp+_1TR?ApAr>wVX}o*YnxT>;*Cf6X{A;spX3svl3R6 zF(qBgKg!OA=+0I-!*{~;S0=leWpE?O4__*eUtQ@)63zE9n$KN*A-;}QgKlf}h5vbk z-6`v?5Kep@rDkCoFRNWSI|VSonizD+)HF)mJ!DY#Anl#6}ii z+|<2imh+^mzl(hebLgc!)A{*|f@;ksw#Bp|3Q7#tKihIV-eIv|AquuxL9P|$?@XyS z9Q&077ke@sxejxJsK|M=ckJS$i#yg1a8|Ct%&z4;!@7WXHPvaewkzNr`&(h3pb_P0 zGaaq4Y8v}21arYn&z}^KV}+gv-Oxh61`}93cyGXaw4o^TFvg>XH?5pW)I3(A9o|6m zrK>PaD?r;-@v7!x_uJhJ+<;4>XVS4sYM7N5xfVeNZ7?Z6dex? z9s5TZFBk*5A<}}m1I@(4nyRZih>66RWg>~vumm)KUcA7G4LU1#A?UXPBTp>-L4vEV zKq61DmB$7M&+=RO?QfZ{IAu1yuNmeNMpy6yLuQH|D;iOL`egFcm&zw+Xg5je{OM%1 z>-eA#PDNlcuvF~xafqH&aIu*iVI3iL?dinEFtzb?)>pUVT`Qet?lJc8%^klp;E|x5 z_k>C&)m=-Gwr1`6wD}$N+_aU_dKc}bKZjs4IF2|lPo;28&35-Ky!GjhVe!l~ohW}} zapF}$7*&XLX_!lRRk+-9CdRzuogtw}c-@}vC5+YmYPG18tGQB5EoUqFQl`IJmWo+5 zSK6vzwY-SUNB#r$tBM747N%MVt!!7bX_S#R2%GOK+bCVE3Ny!in#gbs^;XSSYuREts}@R`0sTfMUsY0@*nLQ3 z9Kz^DNEbhlaU}X*2`&w85Xpx*g0i_eJF@ay2^I%lZb|(X z+^AKQVl`h=(R(V}<&)HU6XcTs1KB0A2KP>as%9(b(oA_6o%u92xuxQ4DDefrT;H1p z`J)6=-QzKm7~*=}z+&FA^yZmx`1~#Q;44MUEr0R%|NJHtCwJ*%&I>-ud=ON`m9EBm zrPEN8-{ak-GYulcZs#3PpXpOhG-LO_QrIZ0hf6veJAube&%bg+{*7&J&+v~7(^U_& z&+BWxg1d&(@t|Feee$Jpy)&?y=i@m(HpUrs93LURQs%`40MxXWrQ+_z3C8u=$m)H7-yDp3#g zDJ6P-3aee=;c(YCp7@Wq8D_h;V`mDQj?Mlj!Szl^(0=y#ER|$@pF3eb`D%1u2gBTb z(9yAScgUrQ!u<1e#v9lVA1&p+R2Bw}fB&Y$_dU;cldG%Go;?#12k#_wa*E-M&&2m^ zyh-6j^B{%e{AGMYd9`vgoogle.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()); - } -}