From 440e4e800d83e02e52769ec9778752b53f1862b3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 3 Jan 2025 21:00:49 +0000 Subject: [PATCH] docs: fixed format string formatting PiperOrigin-RevId: 711790227 Source-Link: https://github.com/googleapis/googleapis/commit/e1b13abbbbec18998ad0bfe39a32ad2b061d4eda Source-Link: https://github.com/googleapis/googleapis-gen/commit/a7b70805d268dd78011498e8f4ecfaf817dd853f Copy-Tag: eyJwIjoiUHJpdmF0ZUNhdGFsb2cvLk93bEJvdC55YW1sIiwiaCI6ImE3YjcwODA1ZDI2OGRkNzgwMTE0OThlOGY0ZWNmYWY4MTdkZDg1M2YifQ== --- .../Privatecatalog/V1Beta1/PrivateCatalog.php | Bin 0 -> 5198 bytes .../PrivateCatalog/V1beta1/AssetReference.php | 511 ++++++++++ .../AssetReference/AssetValidationState.php | 71 ++ .../Cloud/PrivateCatalog/V1beta1/Catalog.php | 228 +++++ .../PrivateCatalog/V1beta1/GcsSource.php | 149 +++ .../PrivateCatalog/V1beta1/GitSource.php | 217 +++++ .../Cloud/PrivateCatalog/V1beta1/Inputs.php | 77 ++ .../Cloud/PrivateCatalog/V1beta1/Product.php | 922 ++++++++++++++++++ .../V1beta1/SearchCatalogsRequest.php | 189 ++++ .../V1beta1/SearchCatalogsResponse.php | 105 ++ .../V1beta1/SearchProductsRequest.php | 197 ++++ .../V1beta1/SearchProductsResponse.php | 105 ++ .../V1beta1/SearchVersionsRequest.php | 197 ++++ .../V1beta1/SearchVersionsResponse.php | 105 ++ .../Cloud/PrivateCatalog/V1beta1/Version.php | 254 +++++ .../PrivateCatalogClient/search_catalogs.php | 80 ++ .../PrivateCatalogClient/search_products.php | 77 ++ .../PrivateCatalogClient/search_versions.php | 86 ++ .../V1beta1/Client/PrivateCatalogClient.php | 284 ++++++ .../Gapic/PrivateCatalogGapicClient.php | 452 +++++++++ .../src/V1beta1/PrivateCatalogClient.php | 36 + .../v1beta1/src/V1beta1/gapic_metadata.json | 33 + .../private_catalog_client_config.json | 37 + .../private_catalog_descriptor_config.php | 88 ++ .../private_catalog_rest_client_config.php | 92 ++ .../Client/PrivateCatalogClientTest.php | 328 +++++++ .../Unit/V1beta1/PrivateCatalogClientTest.php | 274 ++++++ 27 files changed, 5194 insertions(+) create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_client_config.json create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_descriptor_config.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php create mode 100644 owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/GPBMetadata/Google/Cloud/Privatecatalog/V1Beta1/PrivateCatalog.php new file mode 100644 index 0000000000000000000000000000000000000000..d7336ea94188e456da8400f0bf46f85e86b854f3 GIT binary patch literal 5198 zcmcIo&2!U66vsBs#|AO$|WE13S zWv;Nc%oNr(`V`i-@0XauMTBg}3PVk9FAIBUA8GKb3AEQh=T zN0+pg<%Aei96sCXx;7=At1*Ff*T(a=G@+B7z3zJe%#s$}aD!n5IMpgH#er)%wG|xN z0r9C9Y`{^|Y-1WD%vR=aNwZ8HX=(G~j;49&l1my5x;SZF(*jJpfxF1>%@iEOziLD9 zEBd5XbX||3;JKk`_I&E8I7)EYA=stqWS$W0G)uT+?Gi6YC%TCxn?}CmGtX@YUDqXU zySDB#4ySW6j$IXSwo`Z-3vLl0FSU03;jVJB+P%9u2~nLVA!JuF33Zu-bF)&v96KsDX%C9@g?egk6raFJ63psJ{YtT`j9wS zd4wip;R?Y_ZhmUvt}Z+}7I0l&SD8f@T>JyACrt92^&A6IHGzfi*|DCLo?`$yx17o` zspx3ONEESc9E2<}Pl%Y(7cmjVv|;O+>Up;-&8PBCDmvP`*I6_k#r7gP%eq*PemUhT zI@ctj?^t_vzQtqBe99>*nrg}x0jO{?a?a+I&(M?|U}&9n#(qx8sfD?SW)LObY4o`0 z2z?;c^`U7>sXP$*WGQp`ZSgU>&1=O#sSvD&0uk!a_>IU(C8EEvFMk~re#)WohzCPJ zm_-QsGp2RA=VOtG;>r)vOoYyk?D!mqsfF1?-iq2>8iS-}=s~&@+jHyPfQXzG8aL65 zFcn~!STJ<$P(?gVA4D3DtBZP(-E%XNje$*uV>Dn{5R>5;`=7%R!L0xtc+wjC^4CG( z?>w6BcSN~>vZR?L<^cN=ynKwti0gN0sERw^840)w7ZHGU(8XOCuz-s|>^d83x}iD_ z08B4D9Z6aLej-t$(vt-B?|&JgKa%%$!lCpnj~btyI>^GZ|$P<@xcMEL*Rvi9d3s2{b04 zDwt?Y@J;!YHSYk5E)3nQA+wryWbI&O7h3ydIYN(BkvPur(2#>_kJ{p6h*f5m8#%$2 zfuv>w#K|?b@GY2(Vy~P-X9MheA{W8IT$2QHIGI6XP-%Av70mz`0xONca_x?&ajCVrK*by>$NPokq%*g8Dp@hQ6n@RT{_EeL zv%h2%J^qH?k4D`kaPd0~)1qBmz*C_W37rP5o@{Eg06E?`Q=&B}b|P8>0tvJvb;DF>MM9@Rt0$WpEtxH0 zO0)*WPDE=!U~c{Y@5pPoWU=pV-FW4#lm_@al zP;E!a%+jU)@&Kfx-bUv6x@h;&=N}BoZ7+J>lDTNWB?cb8>s%O#&6kcW&Yl! zFSGY9z2B-X-@D#Kr)u(9EP5AP77t%Fco^d^ZEv$TggVpY`b@K5p=rv4jWOUT^&Z@e Z-y!ab7pKGn)sc@={G@n9IzR^q{Rblvs-yq_ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php new file mode 100644 index 000000000000..28de295119be --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference.php @@ -0,0 +1,511 @@ +google.cloud.privatecatalog.v1beta1.AssetReference + */ +class AssetReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A unique identifier among asset references in a product. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The definition of input parameters to hydrate the asset template. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $inputs = null; + /** + * Output only. The current state of the asset reference. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $validation_status = 0; + /** + * Output only. The validation process metadata. + * + * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $validation_operation = null; + /** + * Output only. The cloud storage source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gcs_source = null; + /** + * Output only. The creation timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * The version of the source used for this asset reference. + * + * Generated from protobuf field string version = 14 [deprecated = true]; + * @deprecated + */ + protected $version = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Output only. A unique identifier among asset references in a product. + * @type string $description + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * @type \Google\Cloud\PrivateCatalog\V1beta1\Inputs $inputs + * Output only. The definition of input parameters to hydrate the asset template. + * @type int $validation_status + * Output only. The current state of the asset reference. + * @type \Google\LongRunning\Operation $validation_operation + * Output only. The validation process metadata. + * @type string $asset + * Output only. The asset resource name if an asset is hosted by Private Catalog. + * @type string $gcs_path + * Output only. The cloud storage object path. + * @type \Google\Cloud\PrivateCatalog\V1beta1\GitSource $git_source + * Output only. The git source. + * @type \Google\Cloud\PrivateCatalog\V1beta1\GcsSource $gcs_source + * Output only. The cloud storage source. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation timestamp of the asset reference. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the asset reference. + * @type string $version + * The version of the source used for this asset reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. A unique identifier among asset references in a product. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. A unique identifier among asset references in a product. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. The human-readable description of the referenced asset. Maximum 256 + * characters in length. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The definition of input parameters to hydrate the asset template. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivateCatalog\V1beta1\Inputs|null + */ + public function getInputs() + { + return $this->inputs; + } + + public function hasInputs() + { + return isset($this->inputs); + } + + public function clearInputs() + { + unset($this->inputs); + } + + /** + * Output only. The definition of input parameters to hydrate the asset template. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.Inputs inputs = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivateCatalog\V1beta1\Inputs $var + * @return $this + */ + public function setInputs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\Inputs::class); + $this->inputs = $var; + + return $this; + } + + /** + * Output only. The current state of the asset reference. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getValidationStatus() + { + return $this->validation_status; + } + + /** + * Output only. The current state of the asset reference. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState validation_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setValidationStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference\AssetValidationState::class); + $this->validation_status = $var; + + return $this; + } + + /** + * Output only. The validation process metadata. + * + * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\LongRunning\Operation|null + */ + public function getValidationOperation() + { + return $this->validation_operation; + } + + public function hasValidationOperation() + { + return isset($this->validation_operation); + } + + public function clearValidationOperation() + { + unset($this->validation_operation); + } + + /** + * Output only. The validation process metadata. + * + * Generated from protobuf field .google.longrunning.Operation validation_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\LongRunning\Operation $var + * @return $this + */ + public function setValidationOperation($var) + { + GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); + $this->validation_operation = $var; + + return $this; + } + + /** + * Output only. The asset resource name if an asset is hosted by Private Catalog. + * + * Generated from protobuf field string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAsset() + { + return $this->readOneof(10); + } + + public function hasAsset() + { + return $this->hasOneof(10); + } + + /** + * Output only. The asset resource name if an asset is hosted by Private Catalog. + * + * Generated from protobuf field string asset = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAsset($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. The cloud storage object path. + * + * Generated from protobuf field string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + * @deprecated + */ + public function getGcsPath() + { + @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(11); + } + + public function hasGcsPath() + { + @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(11); + } + + /** + * Output only. The cloud storage object path. + * + * Generated from protobuf field string gcs_path = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + * @deprecated + */ + public function setGcsPath($var) + { + @trigger_error('gcs_path is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Output only. The git source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivateCatalog\V1beta1\GitSource|null + */ + public function getGitSource() + { + return $this->readOneof(15); + } + + public function hasGitSource() + { + return $this->hasOneof(15); + } + + /** + * Output only. The git source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GitSource git_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivateCatalog\V1beta1\GitSource $var + * @return $this + */ + public function setGitSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\GitSource::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. The cloud storage source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\PrivateCatalog\V1beta1\GcsSource|null + */ + public function getGcsSource() + { + return $this->gcs_source; + } + + public function hasGcsSource() + { + return isset($this->gcs_source); + } + + public function clearGcsSource() + { + unset($this->gcs_source); + } + + /** + * Output only. The cloud storage source. + * + * Generated from protobuf field .google.cloud.privatecatalog.v1beta1.GcsSource gcs_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\PrivateCatalog\V1beta1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PrivateCatalog\V1beta1\GcsSource::class); + $this->gcs_source = $var; + + return $this; + } + + /** + * Output only. The creation timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.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 creation timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 12 [(.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 last update timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last update timestamp of the asset reference. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The version of the source used for this asset reference. + * + * Generated from protobuf field string version = 14 [deprecated = true]; + * @return string + * @deprecated + */ + public function getVersion() + { + @trigger_error('version is deprecated.', E_USER_DEPRECATED); + return $this->version; + } + + /** + * The version of the source used for this asset reference. + * + * Generated from protobuf field string version = 14 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setVersion($var) + { + @trigger_error('version is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php new file mode 100644 index 000000000000..b7a471cf660c --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/AssetReference/AssetValidationState.php @@ -0,0 +1,71 @@ +google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState + */ +class AssetValidationState +{ + /** + * Unknown state. + * + * Generated from protobuf enum ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + */ + const ASSET_VALIDATION_STATE_UNSPECIFIED = 0; + /** + * The validation is still in process. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The validation is done and the asset reference is valid. + * + * Generated from protobuf enum VALID = 2; + */ + const VALID = 2; + /** + * The validation is done and the asset reference is invalid. + * + * Generated from protobuf enum INVALID = 3; + */ + const INVALID = 3; + + private static $valueToName = [ + self::ASSET_VALIDATION_STATE_UNSPECIFIED => 'ASSET_VALIDATION_STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::VALID => 'VALID', + self::INVALID => 'INVALID', + ]; + + 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(AssetValidationState::class, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference_AssetValidationState::class); + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php new file mode 100644 index 000000000000..a836b56c1379 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Catalog.php @@ -0,0 +1,228 @@ +google.cloud.privatecatalog.v1beta1.Catalog + */ +class Catalog extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The descriptive name of the catalog as it appears in UIs. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. The description of the catalog. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The time when the catalog was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the catalog was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}`. + * @type string $display_name + * Output only. The descriptive name of the catalog as it appears in UIs. + * @type string $description + * Output only. The description of the catalog. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the catalog was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the catalog was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the target catalog, in the format of + * `catalogs/{catalog}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The descriptive name of the catalog as it appears in UIs. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The descriptive name of the catalog as it appears in UIs. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The description of the catalog. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. The description of the catalog. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The time when the catalog was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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 when the catalog was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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 when the catalog was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the catalog was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php new file mode 100644 index 000000000000..9439240968df --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GcsSource.php @@ -0,0 +1,149 @@ +google.cloud.privatecatalog.v1beta1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. the cloud storage object path. + * + * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gcs_path = ''; + /** + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * + * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. The time when the object metadata was last changed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_path + * Output only. the cloud storage object path. + * @type int|string $generation + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the object metadata was last changed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. the cloud storage object path. + * + * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGcsPath() + { + return $this->gcs_path; + } + + /** + * Output only. the cloud storage object path. + * + * Generated from protobuf field string gcs_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGcsPath($var) + { + GPBUtil::checkString($var, True); + $this->gcs_path = $var; + + return $this; + } + + /** + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * + * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. Generation of the object, which is set when the content of an object starts + * being written. + * + * Generated from protobuf field int64 generation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. The time when the object metadata was last changed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the object metadata was last changed. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php new file mode 100644 index 000000000000..13cdd80dd4a9 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/GitSource.php @@ -0,0 +1,217 @@ +google.cloud.privatecatalog.v1beta1.GitSource + */ +class GitSource extends \Google\Protobuf\Internal\Message +{ + /** + * Location of the Git repo to build. + * + * Generated from protobuf field string repo = 1; + */ + protected $repo = ''; + /** + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * + * Generated from protobuf field string dir = 2; + */ + protected $dir = ''; + protected $ref; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $repo + * Location of the Git repo to build. + * @type string $dir + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * @type string $commit + * The revision commit to use. + * @type string $branch + * The revision branch to use. + * @type string $tag + * The revision tag to use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Location of the Git repo to build. + * + * Generated from protobuf field string repo = 1; + * @return string + */ + public function getRepo() + { + return $this->repo; + } + + /** + * Location of the Git repo to build. + * + * Generated from protobuf field string repo = 1; + * @param string $var + * @return $this + */ + public function setRepo($var) + { + GPBUtil::checkString($var, True); + $this->repo = $var; + + return $this; + } + + /** + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * + * Generated from protobuf field string dir = 2; + * @return string + */ + public function getDir() + { + return $this->dir; + } + + /** + * Directory, relative to the source root, in which to run the build. + * This must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + * + * Generated from protobuf field string dir = 2; + * @param string $var + * @return $this + */ + public function setDir($var) + { + GPBUtil::checkString($var, True); + $this->dir = $var; + + return $this; + } + + /** + * The revision commit to use. + * + * Generated from protobuf field string commit = 3; + * @return string + */ + public function getCommit() + { + return $this->readOneof(3); + } + + public function hasCommit() + { + return $this->hasOneof(3); + } + + /** + * The revision commit to use. + * + * Generated from protobuf field string commit = 3; + * @param string $var + * @return $this + */ + public function setCommit($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The revision branch to use. + * + * Generated from protobuf field string branch = 4; + * @return string + */ + public function getBranch() + { + return $this->readOneof(4); + } + + public function hasBranch() + { + return $this->hasOneof(4); + } + + /** + * The revision branch to use. + * + * Generated from protobuf field string branch = 4; + * @param string $var + * @return $this + */ + public function setBranch($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The revision tag to use. + * + * Generated from protobuf field string tag = 5; + * @return string + */ + public function getTag() + { + return $this->readOneof(5); + } + + public function hasTag() + { + return $this->hasOneof(5); + } + + /** + * The revision tag to use. + * + * Generated from protobuf field string tag = 5; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getRef() + { + return $this->whichOneof("ref"); + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php new file mode 100644 index 000000000000..7fef72404881 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Inputs.php @@ -0,0 +1,77 @@ +google.cloud.privatecatalog.v1beta1.Inputs + */ +class Inputs extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The JSON schema defining the inputs and their formats. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $parameters + * Output only. The JSON schema defining the inputs and their formats. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The JSON schema defining the inputs and their formats. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * Output only. The JSON schema defining the inputs and their formats. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php new file mode 100644 index 000000000000..d22f0ed59e72 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Product.php @@ -0,0 +1,922 @@ +google.cloud.privatecatalog.v1beta1.Product + */ +class Product extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * + * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $asset_type = ''; + /** + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * + * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_metadata = null; + /** + * Output only. The icon URI of the product. + * + * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $icon_uri = ''; + /** + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $asset_references; + /** + * Output only. The time when the product was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the product was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * @type string $asset_type + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * @type \Google\Protobuf\Struct $display_metadata + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * @type string $icon_uri + * Output only. The icon URI of the product. + * @type array<\Google\Cloud\PrivateCatalog\V1beta1\AssetReference>|\Google\Protobuf\Internal\RepeatedField $asset_references + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the product was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the product was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the target product, in the format of + * `products/[a-z][-a-z0-9]*[a-z0-9]'. + * A unique identifier for the product under a catalog. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * + * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAssetType() + { + return $this->asset_type; + } + + /** + * Output only. The type of the product asset. It can be one of the following values: + * * `google.deploymentmanager.Template` + * * `google.cloudprivatecatalog.ListingOnly` + * * `google.cloudprivatecatalog.Terraform` + * + * Generated from protobuf field string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAssetType($var) + { + GPBUtil::checkString($var, True); + $this->asset_type = $var; + + return $this; + } + + /** + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * + * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getDisplayMetadata() + { + return $this->display_metadata; + } + + public function hasDisplayMetadata() + { + return isset($this->display_metadata); + } + + public function clearDisplayMetadata() + { + unset($this->display_metadata); + } + + /** + * Required. Output only. The display metadata to describe the product. The JSON schema of the + * metadata differs by [Product.asset_type][google.cloud.privatecatalog.v1beta1.Product.asset_type]. + * When the type is `google.deploymentmanager.Template`, the schema is as + * follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * signup_url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * required: + * - name + * - description + * - signup_url + * additionalProperties: false + * ``` + * When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + * is as follows: + * ``` + * "$schema": http://json-schema.org/draft-04/schema# + * type: object + * properties: + * name: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * tagline: + * type: string + * minLength: 1 + * maxLength: 100 + * support_info: + * type: string + * minLength: 1 + * maxLength: 2048 + * creator: + * type: string + * minLength: 1 + * maxLength: 100 + * documentations: + * type: array + * items: + * type: object + * properties: + * url: + * type: string + * pattern: + * "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + * title: + * type: string + * minLength: 1 + * maxLength: 64 + * description: + * type: string + * minLength: 1 + * maxLength: 2048 + * required: + * - name + * - description + * additionalProperties: true + * + * Generated from protobuf field .google.protobuf.Struct display_metadata = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDisplayMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->display_metadata = $var; + + return $this; + } + + /** + * Output only. The icon URI of the product. + * + * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIconUri() + { + return $this->icon_uri; + } + + /** + * Output only. The icon URI of the product. + * + * Generated from protobuf field string icon_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIconUri($var) + { + GPBUtil::checkString($var, True); + $this->icon_uri = $var; + + return $this; + } + + /** + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssetReferences() + { + return $this->asset_references; + } + + /** + * Output only. A collection of assets referred by a product. + * This field is set for Terraform Products only. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.AssetReference asset_references = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\AssetReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssetReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\AssetReference::class); + $this->asset_references = $arr; + + return $this; + } + + /** + * Output only. The time when the product was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 when the product was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 when the product was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the product was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php new file mode 100644 index 000000000000..46c48ae71b1c --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsRequest.php @@ -0,0 +1,189 @@ +google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest + */ +class SearchCatalogsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * + * Generated from protobuf field string query = 2; + */ + protected $query = ''; + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * @type string $query + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * @type int $page_size + * The maximum number of entries that are requested. + * @type string $page_token + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. The name of the resource context. It can be in following formats: + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query to filter the catalogs. The supported queries are: + * * Get a single catalog: `name=catalogs/{catalog}` + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php new file mode 100644 index 000000000000..073d9cfa206c --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchCatalogsResponse.php @@ -0,0 +1,105 @@ +google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse + */ +class SearchCatalogsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Catalog`s computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + */ + private $catalogs; + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivateCatalog\V1beta1\Catalog>|\Google\Protobuf\Internal\RepeatedField $catalogs + * The `Catalog`s computed from the resource context. + * @type string $next_page_token + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * The `Catalog`s computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCatalogs() + { + return $this->catalogs; + } + + /** + * The `Catalog`s computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Catalog catalogs = 1; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Catalog>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCatalogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Catalog::class); + $this->catalogs = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to SearchCatalogs that + * indicates from where listing should continue. + * + * 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; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php new file mode 100644 index 000000000000..38693b585c31 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsRequest.php @@ -0,0 +1,197 @@ +google.cloud.privatecatalog.v1beta1.SearchProductsRequest + */ +class SearchProductsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * + * Generated from protobuf field string query = 2; + */ + protected $query = ''; + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @type string $query + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * @type int $page_size + * The maximum number of entries that are requested. + * @type string $page_token + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * + * Generated from protobuf field string query = 2; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * The query to filter the products. + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * + * Generated from protobuf field string query = 2; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php new file mode 100644 index 000000000000..8e3c9015929b --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchProductsResponse.php @@ -0,0 +1,105 @@ +google.cloud.privatecatalog.v1beta1.SearchProductsResponse + */ +class SearchProductsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Product` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + */ + private $products; + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivateCatalog\V1beta1\Product>|\Google\Protobuf\Internal\RepeatedField $products + * The `Product` resources computed from the resource context. + * @type string $next_page_token + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * The `Product` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducts() + { + return $this->products; + } + + /** + * The `Product` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Product products = 1; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Product>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Product::class); + $this->products = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to SearchProducts that + * indicates from where listing should continue. + * + * 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; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php new file mode 100644 index 000000000000..2a177f28643d --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsRequest.php @@ -0,0 +1,197 @@ +google.cloud.privatecatalog.v1beta1.SearchVersionsRequest + */ +class SearchVersionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @type string $query + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * @type int $page_size + * The maximum number of entries that are requested. + * @type string $page_token + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * + * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The query to filter the versions. + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * + * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of entries that are requested. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A pagination token returned from a previous call to SearchVersions + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 4; + * @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/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php new file mode 100644 index 000000000000..da4bb06dd2a8 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/SearchVersionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.privatecatalog.v1beta1.SearchVersionsResponse + */ +class SearchVersionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Version` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + */ + private $versions; + /** + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\PrivateCatalog\V1beta1\Version>|\Google\Protobuf\Internal\RepeatedField $versions + * The `Version` resources computed from the resource context. + * @type string $next_page_token + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * The `Version` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersions() + { + return $this->versions; + } + + /** + * The `Version` resources computed from the resource context. + * + * Generated from protobuf field repeated .google.cloud.privatecatalog.v1beta1.Version versions = 1; + * @param array<\Google\Cloud\PrivateCatalog\V1beta1\Version>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivateCatalog\V1beta1\Version::class); + $this->versions = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to SearchVersions that + * indicates from where the listing should continue. + * + * 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; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php new file mode 100644 index 000000000000..3797906139c4 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/proto/src/Google/Cloud/PrivateCatalog/V1beta1/Version.php @@ -0,0 +1,254 @@ +google.cloud.privatecatalog.v1beta1.Version + */ +class Version extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]`. + * A unique identifier for the version under a product. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * + * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $asset = null; + /** + * Output only. The time when the version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the version was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]`. + * A unique identifier for the version under a product. + * @type string $description + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * @type \Google\Protobuf\Struct $asset + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the version was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the version was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Privatecatalog\V1Beta1\PrivateCatalog::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]`. + * A unique identifier for the version under a product. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the version, in the format + * `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]`. + * A unique identifier for the version under a product. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. The user-supplied description of the version. Maximum of 256 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * + * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Struct|null + */ + public function getAsset() + { + return $this->asset; + } + + public function hasAsset() + { + return isset($this->asset); + } + + public function clearAsset() + { + unset($this->asset); + } + + /** + * Output only. The asset which has been validated and is ready to be + * provisioned. See + * [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + * + * Generated from protobuf field .google.protobuf.Struct asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setAsset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->asset = $var; + + return $this; + } + + /** + * Output only. The time when the version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 when the version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 when the version was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the version was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php new file mode 100644 index 000000000000..0c6deb6f551a --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_catalogs.php @@ -0,0 +1,80 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privateCatalogClient->searchCatalogs($request); + + /** @var Catalog $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 +{ + $resource = '[RESOURCE]'; + + search_catalogs_sample($resource); +} +// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php new file mode 100644 index 000000000000..a320924a1c4b --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_products.php @@ -0,0 +1,77 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privateCatalogClient->searchProducts($request); + + /** @var Product $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 +{ + $resource = '[RESOURCE]'; + + search_products_sample($resource); +} +// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php new file mode 100644 index 000000000000..fc8cfe590f41 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/samples/V1beta1/PrivateCatalogClient/search_versions.php @@ -0,0 +1,86 @@ +setResource($resource) + ->setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $privateCatalogClient->searchVersions($request); + + /** @var Version $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 +{ + $resource = '[RESOURCE]'; + $query = '[QUERY]'; + + search_versions_sample($resource, $query); +} +// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php new file mode 100644 index 000000000000..b31ded819f89 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Client/PrivateCatalogClient.php @@ -0,0 +1,284 @@ + searchCatalogsAsync(SearchCatalogsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchProductsAsync(SearchProductsRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchVersionsAsync(SearchVersionsRequest $request, array $optionalArgs = []) + */ +final class PrivateCatalogClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'cloudprivatecatalog.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudprivatecatalog.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/private_catalog_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/private_catalog_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/private_catalog_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/private_catalog_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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 'cloudprivatecatalog.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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($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); + } + + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * The async variant is {@see PrivateCatalogClient::searchCatalogsAsync()} . + * + * @example samples/V1beta1/PrivateCatalogClient/search_catalogs.php + * + * @param SearchCatalogsRequest $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. + * + * @experimental + */ + public function searchCatalogs(SearchCatalogsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchCatalogs', $request, $callOptions); + } + + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * The async variant is {@see PrivateCatalogClient::searchProductsAsync()} . + * + * @example samples/V1beta1/PrivateCatalogClient/search_products.php + * + * @param SearchProductsRequest $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. + * + * @experimental + */ + public function searchProducts(SearchProductsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchProducts', $request, $callOptions); + } + + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * The async variant is {@see PrivateCatalogClient::searchVersionsAsync()} . + * + * @example samples/V1beta1/PrivateCatalogClient/search_versions.php + * + * @param SearchVersionsRequest $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. + * + * @experimental + */ + public function searchVersions(SearchVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchVersions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php new file mode 100644 index 000000000000..16e6c30c48ca --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/Gapic/PrivateCatalogGapicClient.php @@ -0,0 +1,452 @@ +searchCatalogs($resource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @experimental + * + * @deprecated Please use the new service client {@see \Google\Cloud\PrivateCatalog\V1beta1\Client\PrivateCatalogClient}. + */ +class PrivateCatalogGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudprivatecatalog.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudprivatecatalog.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/private_catalog_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/private_catalog_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/private_catalog_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/private_catalog_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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 'cloudprivatecatalog.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 + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * Sample code: + * ``` + * $privateCatalogClient = new PrivateCatalogClient(); + * try { + * $resource = 'resource'; + * // Iterate over pages of elements + * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchCatalogs($resource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @param string $resource Required. The name of the resource context. It can be in following formats: + * + * * `projects/{project}` + * * `folders/{folder}` + * * `organizations/{organization}` + * @param array $optionalArgs { + * Optional. + * + * @type string $query + * The query to filter the catalogs. The supported queries are: + * + * * Get a single catalog: `name=catalogs/{catalog}` + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function searchCatalogs($resource, array $optionalArgs = []) + { + $request = new SearchCatalogsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('SearchCatalogs', $optionalArgs, SearchCatalogsResponse::class, $request); + } + + /** + * Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * Sample code: + * ``` + * $privateCatalogClient = new PrivateCatalogClient(); + * try { + * $resource = 'resource'; + * // Iterate over pages of elements + * $pagedResponse = $privateCatalogClient->searchProducts($resource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchProducts($resource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @param string $resource Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @param array $optionalArgs { + * Optional. + * + * @type string $query + * The query to filter the products. + * + * The supported queries are: + * * List products of all catalogs: empty + * * List products under a catalog: `parent=catalogs/{catalog}` + * * Get a product by name: + * `name=catalogs/{catalog}/products/{product}` + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function searchProducts($resource, array $optionalArgs = []) + { + $request = new SearchProductsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('SearchProducts', $optionalArgs, SearchProductsResponse::class, $request); + } + + /** + * Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the + * scope of the consumer cloud resource hierarchy context. + * + * Sample code: + * ``` + * $privateCatalogClient = new PrivateCatalogClient(); + * try { + * $resource = 'resource'; + * $query = 'query'; + * // Iterate over pages of elements + * $pagedResponse = $privateCatalogClient->searchVersions($resource, $query); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $privateCatalogClient->searchVersions($resource, $query); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $privateCatalogClient->close(); + * } + * ``` + * + * @param string $resource Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] + * for details. + * @param string $query Required. The query to filter the versions. + * + * The supported queries are: + * * List versions under a product: + * `parent=catalogs/{catalog}/products/{product}` + * * Get a version by name: + * `name=catalogs/{catalog}/products/{product}/versions/{version}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function searchVersions($resource, $query, array $optionalArgs = []) + { + $request = new SearchVersionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setQuery($query); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('SearchVersions', $optionalArgs, SearchVersionsResponse::class, $request); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php new file mode 100644 index 000000000000..7fe112c3ec3e --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/PrivateCatalogClient.php @@ -0,0 +1,36 @@ + [ + 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' => [ + 'SearchCatalogs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCatalogs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchCatalogsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SearchProducts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProducts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchProductsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SearchVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\PrivateCatalog\V1beta1\SearchVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php new file mode 100644 index 000000000000..ee300a6a4e95 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/src/V1beta1/resources/private_catalog_rest_client_config.php @@ -0,0 +1,92 @@ + [ + 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' => [ + 'SearchCatalogs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*}/catalogs:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=organizations/*}/catalogs:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=folders/*}/catalogs:search', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SearchProducts' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*}/products:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=organizations/*}/products:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=folders/*}/products:search', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SearchVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=projects/*}/versions:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=organizations/*}/versions:search', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{resource=folders/*}/versions:search', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php new file mode 100644 index 000000000000..3beab95fea45 --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/Client/PrivateCatalogClientTest.php @@ -0,0 +1,328 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PrivateCatalogClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PrivateCatalogClient($options); + } + + /** @test */ + public function searchCatalogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new SearchCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new SearchCatalogsRequest()) + ->setResource($resource); + $response = $gapicClient->searchCatalogs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchCatalogsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new SearchCatalogsRequest()) + ->setResource($resource); + try { + $gapicClient->searchCatalogs($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 searchProductsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $productsElement = new Product(); + $products = [ + $productsElement, + ]; + $expectedResponse = new SearchProductsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProducts($products); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new SearchProductsRequest()) + ->setResource($resource); + $response = $gapicClient->searchProducts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchProductsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new SearchProductsRequest()) + ->setResource($resource); + try { + $gapicClient->searchProducts($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 searchVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $versionsElement = new Version(); + $versions = [ + $versionsElement, + ]; + $expectedResponse = new SearchVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVersions($versions); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $query = 'query107944136'; + $request = (new SearchVersionsRequest()) + ->setResource($resource) + ->setQuery($query); + $response = $gapicClient->searchVersions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchVersionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $query = 'query107944136'; + $request = (new SearchVersionsRequest()) + ->setResource($resource) + ->setQuery($query); + try { + $gapicClient->searchVersions($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 searchCatalogsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new SearchCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new SearchCatalogsRequest()) + ->setResource($resource); + $response = $gapicClient->searchCatalogsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php new file mode 100644 index 000000000000..1e1689801f1b --- /dev/null +++ b/owl-bot-staging/PrivateCatalog/v1beta1/tests/Unit/V1beta1/PrivateCatalogClientTest.php @@ -0,0 +1,274 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PrivateCatalogClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PrivateCatalogClient($options); + } + + /** @test */ + public function searchCatalogsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogsElement = new Catalog(); + $catalogs = [ + $catalogsElement, + ]; + $expectedResponse = new SearchCatalogsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogs($catalogs); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->searchCatalogs($resource); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchCatalogs', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchCatalogsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + try { + $gapicClient->searchCatalogs($resource); + // 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 searchProductsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $productsElement = new Product(); + $products = [ + $productsElement, + ]; + $expectedResponse = new SearchProductsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProducts($products); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->searchProducts($resource); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProducts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchProducts', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchProductsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + try { + $gapicClient->searchProducts($resource); + // 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 searchVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $versionsElement = new Version(); + $versions = [ + $versionsElement, + ]; + $expectedResponse = new SearchVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVersions($versions); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $query = 'query107944136'; + $response = $gapicClient->searchVersions($resource, $query); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.privatecatalog.v1beta1.PrivateCatalog/SearchVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchVersionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $query = 'query107944136'; + try { + $gapicClient->searchVersions($resource, $query); + // 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()); + } +}