From ae1d3f47220211e6faba9cb597f8c2c99c8e6fa6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 12 Dec 2023 02:01:03 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20post-p?= =?UTF-8?q?rocessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Recommender/metadata/V1/Recommendation.php | Bin 5003 -> 5056 bytes Recommender/src/V1/CostProjection.php | 44 + .../src/V1/Gapic/RecommenderGapicClient.php | 16 +- Recommender/src/V1/Impact.php | 6 +- Recommender/src/V1/ListInsightsRequest.php | 16 + .../src/V1/ListRecommendationsRequest.php | 23 + .../V1/MarkRecommendationDismissedRequest.php | 8 +- .../Google/Cloud/Recommender/V1/Insight.php | Bin 3007 -> 0 bytes .../Recommender/V1/InsightTypeConfig.php | 45 - .../Cloud/Recommender/V1/Recommendation.php | Bin 5056 -> 0 bytes .../Recommender/V1/RecommenderConfig.php | 45 - .../Recommender/V1/RecommenderService.php | 127 -- .../Cloud/Recommender/V1/CostProjection.php | 181 -- .../Recommender/V1/GetInsightRequest.php | 81 - .../V1/GetInsightTypeConfigRequest.php | 111 - .../V1/GetRecommendationRequest.php | 81 - .../V1/GetRecommenderConfigRequest.php | 111 - .../Google/Cloud/Recommender/V1/Impact.php | 208 -- .../Cloud/Recommender/V1/Impact/Category.php | 92 - .../Google/Cloud/Recommender/V1/Insight.php | 502 ----- .../Cloud/Recommender/V1/Insight/Category.php | 92 - .../V1/Insight/RecommendationReference.php | 74 - .../Cloud/Recommender/V1/Insight/Severity.php | 78 - .../Cloud/Recommender/V1/InsightStateInfo.php | 101 - .../Recommender/V1/InsightStateInfo/State.php | 77 - .../Recommender/V1/InsightTypeConfig.php | 347 --- .../V1/InsightTypeGenerationConfig.php | 83 - .../Recommender/V1/ListInsightsRequest.php | 319 --- .../Recommender/V1/ListInsightsResponse.php | 105 - .../V1/ListRecommendationsRequest.php | 378 ---- .../V1/ListRecommendationsResponse.php | 105 - .../V1/MarkInsightAcceptedRequest.php | 158 -- .../V1/MarkRecommendationClaimedRequest.php | 168 -- .../V1/MarkRecommendationDismissedRequest.php | 101 - .../V1/MarkRecommendationFailedRequest.php | 168 -- .../V1/MarkRecommendationSucceededRequest.php | 168 -- .../Google/Cloud/Recommender/V1/Operation.php | 564 ----- .../Cloud/Recommender/V1/OperationGroup.php | 71 - .../Cloud/Recommender/V1/Recommendation.php | 546 ----- .../V1/Recommendation/InsightReference.php | 74 - .../V1/Recommendation/Priority.php | 78 - .../Recommender/V1/RecommendationContent.php | 119 - .../V1/RecommendationStateInfo.php | 101 - .../V1/RecommendationStateInfo/State.php | 95 - .../Recommender/V1/RecommenderConfig.php | 347 --- .../V1/RecommenderGenerationConfig.php | 83 - .../Recommender/V1/ReliabilityProjection.php | 111 - .../V1/ReliabilityProjection/RiskType.php | 72 - .../Recommender/V1/SecurityProjection.php | 77 - .../V1/SustainabilityProjection.php | 116 - .../V1/UpdateInsightTypeConfigRequest.php | 174 -- .../V1/UpdateRecommenderConfigRequest.php | 174 -- .../Cloud/Recommender/V1/ValueMatcher.php | 81 - .../V1/RecommenderClient/get_insight.php | 72 - .../get_insight_type_config.php | 81 - .../RecommenderClient/get_recommendation.php | 72 - .../get_recommender_config.php | 81 - .../V1/RecommenderClient/list_insights.php | 88 - .../list_recommendations.php | 88 - .../mark_insight_accepted.php | 78 - .../mark_recommendation_claimed.php | 82 - .../mark_recommendation_dismissed.php | 79 - .../mark_recommendation_failed.php | 83 - .../mark_recommendation_succeeded.php | 83 - .../update_insight_type_config.php | 57 - .../update_recommender_config.php | 57 - .../v1/src/V1/Client/RecommenderClient.php | 1167 ---------- .../src/V1/Gapic/RecommenderGapicClient.php | 1962 ----------------- .../v1/src/V1/RecommenderClient.php | 34 - .../Recommender/v1/src/V1/gapic_metadata.json | 83 - .../resources/recommender_client_config.json | 110 - .../recommender_descriptor_config.php | 212 -- .../recommender_rest_client_config.php | 346 --- .../Unit/V1/Client/RecommenderClientTest.php | 1062 --------- .../tests/Unit/V1/RecommenderClientTest.php | 954 -------- 75 files changed, 105 insertions(+), 13928 deletions(-) delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php delete mode 100644 owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php delete mode 100644 owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/Gapic/RecommenderGapicClient.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/RecommenderClient.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_client_config.json delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_descriptor_config.php delete mode 100644 owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php delete mode 100644 owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php delete mode 100644 owl-bot-staging/Recommender/v1/tests/Unit/V1/RecommenderClientTest.php diff --git a/Recommender/metadata/V1/Recommendation.php b/Recommender/metadata/V1/Recommendation.php index cd1ca3eb685f0a2631f80491cfbf0475008a9477..f3d0e874402d694acf945e83290e6e7f04a24a64 100644 GIT binary patch delta 79 zcmeBHKcK#Wotg3DW)9~2988lLC%@p1HxV-85=+i6E{V^~i_ghVPRxluQsVqp<^Ucpot=#O+.google.protobuf.Duration duration = 2; */ private $duration = null; + /** + * The approximate cost savings in the billing account's local currency. + * + * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; + */ + private $cost_in_local_currency = null; /** * Constructor. @@ -46,6 +52,8 @@ class CostProjection extends \Google\Protobuf\Internal\Message * prices or custom contract prices. * @type \Google\Protobuf\Duration $duration * Duration for which this cost applies. + * @type \Google\Type\Money $cost_in_local_currency + * The approximate cost savings in the billing account's local currency. * } */ public function __construct($data = NULL) { @@ -133,5 +141,41 @@ public function setDuration($var) return $this; } + /** + * The approximate cost savings in the billing account's local currency. + * + * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; + * @return \Google\Type\Money|null + */ + public function getCostInLocalCurrency() + { + return $this->cost_in_local_currency; + } + + public function hasCostInLocalCurrency() + { + return isset($this->cost_in_local_currency); + } + + public function clearCostInLocalCurrency() + { + unset($this->cost_in_local_currency); + } + + /** + * The approximate cost savings in the billing account's local currency. + * + * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; + * @param \Google\Type\Money $var + * @return $this + */ + public function setCostInLocalCurrency($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->cost_in_local_currency = $var; + + return $this; + } + } diff --git a/Recommender/src/V1/Gapic/RecommenderGapicClient.php b/Recommender/src/V1/Gapic/RecommenderGapicClient.php index 77ddf9b91c97..fead5d7c676d 100644 --- a/Recommender/src/V1/Gapic/RecommenderGapicClient.php +++ b/Recommender/src/V1/Gapic/RecommenderGapicClient.php @@ -1395,6 +1395,8 @@ public function getRecommenderConfig($name, array $optionalArgs = []) * * * `severity` * + * * `targetResources` + * * Examples: * * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` @@ -1403,8 +1405,13 @@ public function getRecommenderConfig($name, array $optionalArgs = []) * * * `severity = CRITICAL OR severity = HIGH` * + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` * + * The max allowed filter length is 500 characters. + * * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @type RetrySettings|array $retrySettings @@ -1506,6 +1513,8 @@ public function listInsights($parent, array $optionalArgs = []) * * * `priority` * + * * `targetResources` + * * Examples: * * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` @@ -1514,8 +1523,13 @@ public function listInsights($parent, array $optionalArgs = []) * * * `priority = P1 OR priority = P2` * + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` * + * The max allowed filter length is 500 characters. + * * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @type RetrySettings|array $retrySettings @@ -1687,7 +1701,7 @@ public function markRecommendationClaimed($name, $etag, array $optionalArgs = [] * } * ``` * - * @param string $name Name of the recommendation. + * @param string $name Required. Name of the recommendation. * @param array $optionalArgs { * Optional. * diff --git a/Recommender/src/V1/Impact.php b/Recommender/src/V1/Impact.php index 4e30a0fa2aee..f543dfcc01d0 100644 --- a/Recommender/src/V1/Impact.php +++ b/Recommender/src/V1/Impact.php @@ -38,7 +38,7 @@ class Impact extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Recommender\V1\SustainabilityProjection $sustainability_projection * Use with CategoryType.SUSTAINABILITY * @type \Google\Cloud\Recommender\V1\ReliabilityProjection $reliability_projection - * Use with CategoryType.RELAIBILITY + * Use with CategoryType.RELIABILITY * } */ public function __construct($data = NULL) { @@ -166,7 +166,7 @@ public function setSustainabilityProjection($var) } /** - * Use with CategoryType.RELAIBILITY + * Use with CategoryType.RELIABILITY * * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; * @return \Google\Cloud\Recommender\V1\ReliabilityProjection|null @@ -182,7 +182,7 @@ public function hasReliabilityProjection() } /** - * Use with CategoryType.RELAIBILITY + * Use with CategoryType.RELIABILITY * * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; * @param \Google\Cloud\Recommender\V1\ReliabilityProjection $var diff --git a/Recommender/src/V1/ListInsightsRequest.php b/Recommender/src/V1/ListInsightsRequest.php index 6a3139172c36..9c91191cbefb 100644 --- a/Recommender/src/V1/ListInsightsRequest.php +++ b/Recommender/src/V1/ListInsightsRequest.php @@ -54,11 +54,15 @@ class ListInsightsRequest extends \Google\Protobuf\Internal\Message * * `stateInfo.state` * * `insightSubtype` * * `severity` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `insightSubtype = PERMISSIONS_USAGE` * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @@ -129,11 +133,15 @@ public static function build(string $parent): self * * `stateInfo.state` * * `insightSubtype` * * `severity` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `insightSubtype = PERMISSIONS_USAGE` * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * } @@ -257,11 +265,15 @@ public function setPageToken($var) * * `stateInfo.state` * * `insightSubtype` * * `severity` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `insightSubtype = PERMISSIONS_USAGE` * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @@ -279,11 +291,15 @@ public function getFilter() * * `stateInfo.state` * * `insightSubtype` * * `severity` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `insightSubtype = PERMISSIONS_USAGE` * * `severity = CRITICAL OR severity = HIGH` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * diff --git a/Recommender/src/V1/ListRecommendationsRequest.php b/Recommender/src/V1/ListRecommendationsRequest.php index 8c53a3a2c85f..6dc39eb9f748 100644 --- a/Recommender/src/V1/ListRecommendationsRequest.php +++ b/Recommender/src/V1/ListRecommendationsRequest.php @@ -54,11 +54,15 @@ class ListRecommendationsRequest extends \Google\Protobuf\Internal\Message * * `state_info.state` * * `recommenderSubtype` * * `priority` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @@ -124,6 +128,8 @@ public static function build(string $parent): self * * * `priority` * + * * `targetResources` + * * Examples: * * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` @@ -132,8 +138,13 @@ public static function build(string $parent): self * * * `priority = P1 OR priority = P2` * + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + * * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` * + * The max allowed filter length is 500 characters. + * * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @@ -181,11 +192,15 @@ public static function buildFromParentFilter(string $parent, string $filter): se * * `state_info.state` * * `recommenderSubtype` * * `priority` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * } @@ -309,11 +324,15 @@ public function setPageToken($var) * * `state_info.state` * * `recommenderSubtype` * * `priority` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * @@ -331,11 +350,15 @@ public function getFilter() * * `state_info.state` * * `recommenderSubtype` * * `priority` + * * `targetResources` * Examples: * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` * * `priority = P1 OR priority = P2` + * * `targetResources : + * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + * The max allowed filter length is 500 characters. * (These expressions are based on the filter language described at * https://google.aip.dev/160) * diff --git a/Recommender/src/V1/MarkRecommendationDismissedRequest.php b/Recommender/src/V1/MarkRecommendationDismissedRequest.php index ee93ee6af280..f502aa807e6f 100644 --- a/Recommender/src/V1/MarkRecommendationDismissedRequest.php +++ b/Recommender/src/V1/MarkRecommendationDismissedRequest.php @@ -16,7 +16,7 @@ class MarkRecommendationDismissedRequest extends \Google\Protobuf\Internal\Message { /** - * Name of the recommendation. + * Required. Name of the recommendation. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -35,7 +35,7 @@ class MarkRecommendationDismissedRequest extends \Google\Protobuf\Internal\Messa * Optional. Data for populating the Message object. * * @type string $name - * Name of the recommendation. + * Required. Name of the recommendation. * @type string $etag * Fingerprint of the Recommendation. Provides optimistic locking. * } @@ -46,7 +46,7 @@ public function __construct($data = NULL) { } /** - * Name of the recommendation. + * Required. Name of the recommendation. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -57,7 +57,7 @@ public function getName() } /** - * Name of the recommendation. + * Required. Name of the recommendation. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Insight.php deleted file mode 100644 index 96a11af63961e521d190fba4205f707987057967..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3007 zcmb_eOK;mo5Uw76jbdA7A7+)J*{VS!1C0bbEl|jDQ<`EF0=A`!wA&N{6pC8OY-y4p zR|b?o$Nq{Q3iQ}Z5B({<_7~*TpU_#pEI(4%sddqExZk%kv-1t-@e}XZgHK75I@C89 z9gzNnuwzO*-({}p+N3`o4yjK}_r$Yo>Q@PAw8%kACrU%rKS5~Vj(wBX$;fp_Hm#Yq zJ08@0ihvX945(i_-K<$oV2zGhHDm>Fj1wAohDk}Yy}M7DF)*0XZH5G0nGFHt(O?d4jCGDKoNU+?{Msx%yJ#V z0WHU*l?@Vc^1b&x7bD*xiA!ys3`|5!|pa{VEUHFT)&N5>-7<3X$rZevJoH4 z>8v5CL_XH*mz>-o%pcR)(+Tk@8~e_7=r<>rrmOB136nev(-mJs{Vbp}{8gwlrp6dA z9#c`jIaEW}P4*T*-NFK3#))?|Hq8ISudO)S(qND#_bC=(B~1rU&I9;!4K}V_eZt*n zYc(v?>P(?lPd7^+$2?)7;*Hk^adx88Eq!$HeGsM~etYlYTb9HbZ7Bb}1PgHq3wI#T zbs%O)rm`fw3xz>kQ+O9*HZ+P*WQLEm)$`-~4a6mq!|m&^8f&T-jQecjQ4vB&1r|&f z^X4!yhlaw|dNqzW38@<0n(!s8p`4hOoaQgxEPs5_=dDOSu zfjAf9KD>lWic63HxCAIFbm)rn;r55g_N%U<8s|ylC>24%6Ie8HJ#zhtxPSyJTh}6} z$}xx&1oRXgW)pGs1_W9R;#Y>vY9tmAyd=DU61F7Qw2*&*X^cBwn3q6Y#Cs}iJ-$we z)wJ1#*bc>pOR*=FHevk@uY?a^<@||J9hHC1z+xJ(2=B>~t~6Vn=e@%Nt*yxFQ&njc z-w_reFSj(kn8BD9HAOz`sQU9_R#=5XTj@M)b@rtLSt;g(HCV=_)KsKhb&v1K3j(ZY zhng;_2Z?Qt<2uToni%HG-y&_2HgrQ%jud{x1veHTx7Yd(y#Scs#}CTkKKg*ZJyV;{ z@No1^MwBW`d&PYH*W7FAmmHMSxbbTg)wbbTK^4$Z|W!=tI}WFDKGRi`!v+ z;rb)Pv0f%wn0>sJ6Uu*Np?FEQyD%3jKP=Fdtw+~UL@Ii0R;VuFdsqoMdMEL)fDMw% z>zlVAOXdy5Vg97_1qk60=d3~jazD{Y+?tnR?$ofyG-}HA>{pp`6Xqhv-iI|*g05Vs zYb<9;*3}~=5||{*N?S+aWrbx}YN*=2s%iL`+x;g8_posPD~#PcaZ1~K3TbD4kfL@O zw{>3jBlq0Eg>t}|YeptsfBW3iZ`r)uQRLsVcbnnNRSjpZvo?gnI@)|K{gs8!W^iv1 z8`q8?--6(T&h4v9kp8!ng#B5epeAP@Z?2pEJf@1dj~=8$%;(VrI5RNvTDQzAhQ)Aa KG}ldG3h*y7XYoV; diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php deleted file mode 100644 index c295b549cb99..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/InsightTypeConfig.php +++ /dev/null @@ -1,45 +0,0 @@ -internalAddGeneratedFile( - ' -Ø -5google/cloud/recommender/v1/insight_type_config.protogoogle.cloud.recommender.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"± -InsightTypeConfig -name ( ` -insight_type_generation_config ( 28.google.cloud.recommender.v1.InsightTypeGenerationConfig -etag ( / - update_time ( 2.google.protobuf.Timestamp - revision_id ( BàAàAT - annotations ( 2?.google.cloud.recommender.v1.InsightTypeConfig.AnnotationsEntry - display_name ( 2 -AnnotationsEntry -key (  -value ( :8:¯êA« -,recommender.googleapis.com/InsightTypeConfigJprojects/{project}/locations/{location}/insightTypes/{insight_type}/configTorganizations/{organization}/locations/{location}/insightTypes/{insight_type}/configYbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config"F -InsightTypeGenerationConfig\' -params ( 2.google.protobuf.StructB£ -com.google.cloud.recommender.v1BInsightTypeConfigProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb¢CRECªGoogle.Cloud.Recommender.V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/Recommendation.php deleted file mode 100644 index f3d0e874402d694acf945e83290e6e7f04a24a64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5056 zcmcIoUsL1O6<>of<`|5*WLYoUX;g2Tg-I$GXEV*1?6yW0tWvbr zkz`tu;js^W?l;I&r(dRT?Mxr?0Wx{%H|V)ne=LL7U8e~z*8TJQopaB>d$^zfdU!R2 zr@|4nsjK_6D_q_P{uLF5uH!p~V+og|UXQwh;S7eRMO{%4>J8zv(H7*o(*7AjJ!j+^ zv?}x+r*F}+VL792*`){=P`gXr^7Y<$sQad4i<}(5)(6xZ>IM~#ng=J;*Sor}caAtu zM`Apk)|jVrzPArxSi0v4@igayuRy@R;poyb4Z-tq(hxo{JmxA9kJirs2M6Rj3H zr8+*)7(WdapQ%2=FhEmO=ZC7Oy5WBhVB5qv@b$s)-LdVPA?=(vHocjS;XeDtOEdIP zt=o+qa)@EP6Pu73^cnm|fM3oVzvM}P5P8IliHH}k_qKl;((zEoU@3P)!v?{>{gb=v z9=Be&`u^QjKQd9c;ZeB3M>~`U%nrdq>FX89Pi6;Mg*3~wVoFHutdLE}b;EE)Hy0Q9 z_dL&ngiXv z(aZs6xnEr3n5PkDn%zW&ZzV5bL+^GmdmYTL2%ixaQRX}04g zasiuI3?0K{g&WB|vw!7##XL9D=W{43Dgm}dvD8znf8;$_{gdNreb*TcHM3hJOyKrY zDBRn*4$GnBAizp>$j0U?!h6k@(r78|3+?PwZOW2zsL1ug1CoJ-=JP^||9(SbMc7S*Wq2TcXnG>vF6Bv|5d%~057h9z@>k*4ZP{`RUd?bW`n(-q zM%2amgn-0Sgo;=B#4T|zP0KRve$6nPkGi03zCVmio9+oJU_8-lR=SBoNVi8MrA?sXI_u8a? zEH3hVdlbQ=f-DBtRp}V=cfeJESO*V-no0jKf=?}4F+u5HX;_IzBo7&^d#ua`wf7;c zVFl&=lEw>cP<;!Kji$M_D=g24x_`y1>mexK#!4x#<>3O~o#B(6XRvgwTO%4) ztgT4(_~hqo_01V|e=!!fxEiA>AFQsj*l`3SO6)56i)B9Z!&_7L z0*dMgZ&uURu?kPJU{1a1Ylh}jg2pE`*KtbU@d{;`_lduNCD-)c1cf1A*^f*zHCbA8 z3WeB0d>idd-uhkGDVX^eLG-Tq=D~op~?K^Ie7WvA@GmjX+L@C6OLs;j5 zfFZ(eV^;jS+>Nsf_+)fqVL63OFANSX!9_V&d8SJDg9`ax!((qESdy$g&id(W)(P}D zV3E5GTkhD?N#Z^y{$EYwlpuNap!DYyWMi{pCneR|@=>F8x0A|3T570m^ztfXRarV? z-B#e_rrbJgv`%WLl8mj@2CU&{?MSX2D93D1nh?mVXKK5qoJMm?EI3;7u@X&Wco~YF zS^8!H9!=ieA#9-C+IJHWAXAgt%DIg0$icF7TvJZ4-_5WLRL?Ny zAdK3Qp#oFP%lk9BE*d`|* zUZ^{~+>g6iHu`!YEwyCn?+Z_k_=}4uu@@IHb_>4sobP>G`^N%&n81Z<-EYFFOAf+3 z#ZEQ+n!9%-zx%-(Z1S7`w|^$b$$l75mmJQ0#LEmC$9Fz?7QaD!96b6Y-iTP}o5qy) OA-*$s%DIJGfd2wdi-vmu diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php deleted file mode 100644 index ca519f51d7a8..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderConfig.php +++ /dev/null @@ -1,45 +0,0 @@ -internalAddGeneratedFile( - ' -Ó -4google/cloud/recommender/v1/recommender_config.protogoogle.cloud.recommender.v1google/api/resource.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"­ -RecommenderConfig -name ( _ -recommender_generation_config ( 28.google.cloud.recommender.v1.RecommenderGenerationConfig -etag ( / - update_time ( 2.google.protobuf.Timestamp - revision_id ( BàAàAT - annotations ( 2?.google.cloud.recommender.v1.RecommenderConfig.AnnotationsEntry - display_name ( 2 -AnnotationsEntry -key (  -value ( :8:¬êA¨ -,recommender.googleapis.com/RecommenderConfigIprojects/{project}/locations/{location}/recommenders/{recommender}/configSorganizations/{organization}/locations/{location}/recommenders/{recommender}/configXbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config"F -RecommenderGenerationConfig\' -params ( 2.google.protobuf.StructB£ -com.google.cloud.recommender.v1BRecommenderConfigProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb¢CRECªGoogle.Cloud.Recommender.V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php b/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php deleted file mode 100644 index 4ea8a97c2522..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/GPBMetadata/Google/Cloud/Recommender/V1/RecommenderService.php +++ /dev/null @@ -1,127 +0,0 @@ -internalAddGeneratedFile( - ' -óF -5google/cloud/recommender/v1/recommender_service.protogoogle.cloud.recommender.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto)google/cloud/recommender/v1/insight.proto5google/cloud/recommender/v1/insight_type_config.proto0google/cloud/recommender/v1/recommendation.proto4google/cloud/recommender/v1/recommender_config.proto google/protobuf/field_mask.proto"› -ListInsightsRequest> -parent ( B.àAúA( -&recommender.googleapis.com/InsightType - page_size (BàA - -page_token ( BàA -filter ( BàA"g -ListInsightsResponse6 -insights ( 2$.google.cloud.recommender.v1.Insight -next_page_token ( "M -GetInsightRequest8 -name ( B*àAúA$ -"recommender.googleapis.com/Insight"ˆ -MarkInsightAcceptedRequest8 -name ( B*àAúA$ -"recommender.googleapis.com/Insightg -state_metadata ( 2J.google.cloud.recommender.v1.MarkInsightAcceptedRequest.StateMetadataEntryBàA -etag ( BàA4 -StateMetadataEntry -key (  -value ( :8" -ListRecommendationsRequest> -parent ( B.àAúA( -&recommender.googleapis.com/Recommender - page_size (BàA - -page_token ( BàA -filter ( "| -ListRecommendationsResponseD -recommendations ( 2+.google.cloud.recommender.v1.Recommendation -next_page_token ( "[ -GetRecommendationRequest? -name ( B1àAúA+ -)recommender.googleapis.com/Recommendation"s -"MarkRecommendationDismissedRequest? -name ( B1àAúA+ -)recommender.googleapis.com/Recommendation -etag ( "– - MarkRecommendationClaimedRequest? -name ( B1àAúA+ -)recommender.googleapis.com/Recommendationh -state_metadata ( 2P.google.cloud.recommender.v1.MarkRecommendationClaimedRequest.StateMetadataEntry -etag ( BàA4 -StateMetadataEntry -key (  -value ( :8"š -"MarkRecommendationSucceededRequest? -name ( B1àAúA+ -)recommender.googleapis.com/Recommendationj -state_metadata ( 2R.google.cloud.recommender.v1.MarkRecommendationSucceededRequest.StateMetadataEntry -etag ( BàA4 -StateMetadataEntry -key (  -value ( :8"” -MarkRecommendationFailedRequest? -name ( B1àAúA+ -)recommender.googleapis.com/Recommendationg -state_metadata ( 2O.google.cloud.recommender.v1.MarkRecommendationFailedRequest.StateMetadataEntry -etag ( BàA4 -StateMetadataEntry -key (  -value ( :8"a -GetRecommenderConfigRequestB -name ( B4àAúA. -,recommender.googleapis.com/RecommenderConfig"¹ -UpdateRecommenderConfigRequestO -recommender_config ( 2..google.cloud.recommender.v1.RecommenderConfigBàA/ - update_mask ( 2.google.protobuf.FieldMask - validate_only ("a -GetInsightTypeConfigRequestB -name ( B4àAúA. -,recommender.googleapis.com/InsightTypeConfig"º -UpdateInsightTypeConfigRequestP -insight_type_config ( 2..google.cloud.recommender.v1.InsightTypeConfigBàA/ - update_mask ( 2.google.protobuf.FieldMask - validate_only (2Ö. - Recommender‹ - ListInsights0.google.cloud.recommender.v1.ListInsightsRequest1.google.cloud.recommender.v1.ListInsightsResponse"•‚Óä“…;/v1/{parent=projects/*/locations/*/insightTypes/*}/insightsZDB/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insightsZ<:/v1/{parent=folders/*/locations/*/insightTypes/*}/insightsZB@/v1/{parent=organizations/*/locations/*/insightTypes/*}/insightsÚAparentø - -GetInsight..google.cloud.recommender.v1.GetInsightRequest$.google.cloud.recommender.v1.Insight"“‚Óä“…;/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}ZDB/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}Z<:/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}ZB@/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}ÚAnameÞ -MarkInsightAccepted7.google.cloud.recommender.v1.MarkInsightAcceptedRequest$.google.cloud.recommender.v1.Insight"ç‚Óä“Å"H/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZT"O/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZL"G/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ZR"M/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted:*ÚAname,state_metadata,etagÌ -ListRecommendations7.google.cloud.recommender.v1.ListRecommendationsRequest8.google.cloud.recommender.v1.ListRecommendationsResponse"Á‚Óä“¡B/v1/{parent=projects/*/locations/*/recommenders/*}/recommendationsZKI/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendationsZCA/v1/{parent=folders/*/locations/*/recommenders/*}/recommendationsZIG/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendationsÚAparentÚA parent,filter© -GetRecommendation5.google.cloud.recommender.v1.GetRecommendationRequest+.google.cloud.recommender.v1.Recommendation"¯‚Óä“¡B/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}ZKI/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}ZCA/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}ZIG/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}ÚAnameú -MarkRecommendationDismissed?.google.cloud.recommender.v1.MarkRecommendationDismissedRequest+.google.cloud.recommender.v1.Recommendation"ì‚Óä“å"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*Z\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*ZT"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*ZZ"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed:*‰ -MarkRecommendationClaimed=.google.cloud.recommender.v1.MarkRecommendationClaimedRequest+.google.cloud.recommender.v1.Recommendation"ÿ‚Óä“Ý"N/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZZ"U/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZR"M/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ZX"S/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed:*ÚAname,state_metadata,etag• -MarkRecommendationSucceeded?.google.cloud.recommender.v1.MarkRecommendationSucceededRequest+.google.cloud.recommender.v1.Recommendation"‡‚Óä“å"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*Z\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ZT"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ZZ"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:*ÚAname,state_metadata,etagƒ -MarkRecommendationFailed<.google.cloud.recommender.v1.MarkRecommendationFailedRequest+.google.cloud.recommender.v1.Recommendation"û‚Óä“Ù"M/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZY"T/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZQ"L/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ZW"R/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed:*ÚAname,state_metadata,etagÌ -GetRecommenderConfig8.google.cloud.recommender.v1.GetRecommenderConfigRequest..google.cloud.recommender.v1.RecommenderConfig"É‚Óä“»7/v1/{name=projects/*/locations/*/recommenders/*/config}Z>/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}ÚAnameá -UpdateRecommenderConfig;.google.cloud.recommender.v1.UpdateRecommenderConfigRequest..google.cloud.recommender.v1.RecommenderConfig"Ø‚Óä“°2J/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}:recommender_configZe2O/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}:recommender_configZg2Q/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}:recommender_configÚArecommender_config,update_maskÌ -GetInsightTypeConfig8.google.cloud.recommender.v1.GetInsightTypeConfigRequest..google.cloud.recommender.v1.InsightTypeConfig"É‚Óä“»7/v1/{name=projects/*/locations/*/insightTypes/*/config}Z>/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}ÚAnameè -UpdateInsightTypeConfig;.google.cloud.recommender.v1.UpdateInsightTypeConfigRequest..google.cloud.recommender.v1.InsightTypeConfig"ß‚Ó䓶2K/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}:insight_type_configZg2P/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}:insight_type_configZi2R/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}:insight_type_configÚAinsight_type_config,update_maskNÊArecommender.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB -com.google.cloud.recommender.v1BRecommenderProtoPZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb¢CRECªGoogle.Cloud.Recommender.V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php deleted file mode 100644 index e981e6aba9ee..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/CostProjection.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.recommender.v1.CostProjection - */ -class CostProjection extends \Google\Protobuf\Internal\Message -{ - /** - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * - * Generated from protobuf field .google.type.Money cost = 1; - */ - protected $cost = null; - /** - * Duration for which this cost applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - */ - protected $duration = null; - /** - * The approximate cost savings in the billing account's local currency. - * - * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; - */ - protected $cost_in_local_currency = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Type\Money $cost - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * @type \Google\Protobuf\Duration $duration - * Duration for which this cost applies. - * @type \Google\Type\Money $cost_in_local_currency - * The approximate cost savings in the billing account's local currency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * - * Generated from protobuf field .google.type.Money cost = 1; - * @return \Google\Type\Money|null - */ - public function getCost() - { - return $this->cost; - } - - public function hasCost() - { - return isset($this->cost); - } - - public function clearCost() - { - unset($this->cost); - } - - /** - * An approximate projection on amount saved or amount incurred. Negative cost - * units indicate cost savings and positive cost units indicate increase. - * See google.type.Money documentation for positive/negative units. - * A user's permissions may affect whether the cost is computed using list - * prices or custom contract prices. - * - * Generated from protobuf field .google.type.Money cost = 1; - * @param \Google\Type\Money $var - * @return $this - */ - public function setCost($var) - { - GPBUtil::checkMessage($var, \Google\Type\Money::class); - $this->cost = $var; - - return $this; - } - - /** - * Duration for which this cost applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Duration for which this cost applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * The approximate cost savings in the billing account's local currency. - * - * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; - * @return \Google\Type\Money|null - */ - public function getCostInLocalCurrency() - { - return $this->cost_in_local_currency; - } - - public function hasCostInLocalCurrency() - { - return isset($this->cost_in_local_currency); - } - - public function clearCostInLocalCurrency() - { - unset($this->cost_in_local_currency); - } - - /** - * The approximate cost savings in the billing account's local currency. - * - * Generated from protobuf field .google.type.Money cost_in_local_currency = 3; - * @param \Google\Type\Money $var - * @return $this - */ - public function setCostInLocalCurrency($var) - { - GPBUtil::checkMessage($var, \Google\Type\Money::class); - $this->cost_in_local_currency = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php deleted file mode 100644 index 4eefd045c8d4..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recommender.v1.GetInsightRequest - */ -class GetInsightRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the insight. Please see - * {@see RecommenderClient::insightName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetInsightRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the insight. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php deleted file mode 100644 index cf71aa698a60..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetInsightTypeConfigRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.recommender.v1.GetInsightTypeConfigRequest - */ -class GetInsightTypeConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the InsightTypeConfig to get. - * - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * Please see {@see RecommenderClient::insightTypeConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetInsightTypeConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the InsightTypeConfig to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php deleted file mode 100644 index b15ce7896af4..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommendationRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recommender.v1.GetRecommendationRequest - */ -class GetRecommendationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetRecommendationRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php deleted file mode 100644 index ff82145c37d0..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/GetRecommenderConfigRequest.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.recommender.v1.GetRecommenderConfigRequest - */ -class GetRecommenderConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the Recommendation Config to get. - * - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * Please see {@see RecommenderClient::recommenderConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\GetRecommenderConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the Recommendation Config to get. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php deleted file mode 100644 index 1ae4e1147913..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact.php +++ /dev/null @@ -1,208 +0,0 @@ -google.cloud.recommender.v1.Impact - */ -class Impact extends \Google\Protobuf\Internal\Message -{ - /** - * Category that is being targeted. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; - */ - protected $category = 0; - protected $projection; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $category - * Category that is being targeted. - * @type \Google\Cloud\Recommender\V1\CostProjection $cost_projection - * Use with CategoryType.COST - * @type \Google\Cloud\Recommender\V1\SecurityProjection $security_projection - * Use with CategoryType.SECURITY - * @type \Google\Cloud\Recommender\V1\SustainabilityProjection $sustainability_projection - * Use with CategoryType.SUSTAINABILITY - * @type \Google\Cloud\Recommender\V1\ReliabilityProjection $reliability_projection - * Use with CategoryType.RELIABILITY - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Category that is being targeted. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; - * @return int - */ - public function getCategory() - { - return $this->category; - } - - /** - * Category that is being targeted. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact.Category category = 1; - * @param int $var - * @return $this - */ - public function setCategory($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Impact\Category::class); - $this->category = $var; - - return $this; - } - - /** - * Use with CategoryType.COST - * - * Generated from protobuf field .google.cloud.recommender.v1.CostProjection cost_projection = 100; - * @return \Google\Cloud\Recommender\V1\CostProjection|null - */ - public function getCostProjection() - { - return $this->readOneof(100); - } - - public function hasCostProjection() - { - return $this->hasOneof(100); - } - - /** - * Use with CategoryType.COST - * - * Generated from protobuf field .google.cloud.recommender.v1.CostProjection cost_projection = 100; - * @param \Google\Cloud\Recommender\V1\CostProjection $var - * @return $this - */ - public function setCostProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\CostProjection::class); - $this->writeOneof(100, $var); - - return $this; - } - - /** - * Use with CategoryType.SECURITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SecurityProjection security_projection = 101; - * @return \Google\Cloud\Recommender\V1\SecurityProjection|null - */ - public function getSecurityProjection() - { - return $this->readOneof(101); - } - - public function hasSecurityProjection() - { - return $this->hasOneof(101); - } - - /** - * Use with CategoryType.SECURITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SecurityProjection security_projection = 101; - * @param \Google\Cloud\Recommender\V1\SecurityProjection $var - * @return $this - */ - public function setSecurityProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SecurityProjection::class); - $this->writeOneof(101, $var); - - return $this; - } - - /** - * Use with CategoryType.SUSTAINABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102; - * @return \Google\Cloud\Recommender\V1\SustainabilityProjection|null - */ - public function getSustainabilityProjection() - { - return $this->readOneof(102); - } - - public function hasSustainabilityProjection() - { - return $this->hasOneof(102); - } - - /** - * Use with CategoryType.SUSTAINABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102; - * @param \Google\Cloud\Recommender\V1\SustainabilityProjection $var - * @return $this - */ - public function setSustainabilityProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SustainabilityProjection::class); - $this->writeOneof(102, $var); - - return $this; - } - - /** - * Use with CategoryType.RELIABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; - * @return \Google\Cloud\Recommender\V1\ReliabilityProjection|null - */ - public function getReliabilityProjection() - { - return $this->readOneof(103); - } - - public function hasReliabilityProjection() - { - return $this->hasOneof(103); - } - - /** - * Use with CategoryType.RELIABILITY - * - * Generated from protobuf field .google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103; - * @param \Google\Cloud\Recommender\V1\ReliabilityProjection $var - * @return $this - */ - public function setReliabilityProjection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ReliabilityProjection::class); - $this->writeOneof(103, $var); - - return $this; - } - - /** - * @return string - */ - public function getProjection() - { - return $this->whichOneof("projection"); - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php deleted file mode 100644 index 3edc36ada2dc..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Impact/Category.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.recommender.v1.Impact.Category - */ -class Category -{ - /** - * Default unspecified category. Don't use directly. - * - * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; - */ - const CATEGORY_UNSPECIFIED = 0; - /** - * Indicates a potential increase or decrease in cost. - * - * Generated from protobuf enum COST = 1; - */ - const COST = 1; - /** - * Indicates a potential increase or decrease in security. - * - * Generated from protobuf enum SECURITY = 2; - */ - const SECURITY = 2; - /** - * Indicates a potential increase or decrease in performance. - * - * Generated from protobuf enum PERFORMANCE = 3; - */ - const PERFORMANCE = 3; - /** - * Indicates a potential increase or decrease in manageability. - * - * Generated from protobuf enum MANAGEABILITY = 4; - */ - const MANAGEABILITY = 4; - /** - * Indicates a potential increase or decrease in sustainability. - * - * Generated from protobuf enum SUSTAINABILITY = 5; - */ - const SUSTAINABILITY = 5; - /** - * Indicates a potential increase or decrease in reliability. - * - * Generated from protobuf enum RELIABILITY = 6; - */ - const RELIABILITY = 6; - - private static $valueToName = [ - self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', - self::COST => 'COST', - self::SECURITY => 'SECURITY', - self::PERFORMANCE => 'PERFORMANCE', - self::MANAGEABILITY => 'MANAGEABILITY', - self::SUSTAINABILITY => 'SUSTAINABILITY', - self::RELIABILITY => 'RELIABILITY', - ]; - - 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(Category::class, \Google\Cloud\Recommender\V1\Impact_Category::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php deleted file mode 100644 index 544481b24ea5..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight.php +++ /dev/null @@ -1,502 +0,0 @@ -google.cloud.recommender.v1.Insight - */ -class Insight extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the insight. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Fully qualified resource names that this insight is targeting. - * - * Generated from protobuf field repeated string target_resources = 9; - */ - private $target_resources; - /** - * Insight subtype. Insight content schema will be stable for a given subtype. - * - * Generated from protobuf field string insight_subtype = 10; - */ - protected $insight_subtype = ''; - /** - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * - * Generated from protobuf field .google.protobuf.Struct content = 3; - */ - protected $content = null; - /** - * Timestamp of the latest data used to generate the insight. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - */ - protected $last_refresh_time = null; - /** - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * - * Generated from protobuf field .google.protobuf.Duration observation_period = 5; - */ - protected $observation_period = null; - /** - * Information state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; - */ - protected $state_info = null; - /** - * Category being targeted by the insight. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; - */ - protected $category = 0; - /** - * Insight's severity. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; - */ - protected $severity = 0; - /** - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Recommendations derived from this insight. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; - */ - private $associated_recommendations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of the insight. - * @type string $description - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * @type array|\Google\Protobuf\Internal\RepeatedField $target_resources - * Fully qualified resource names that this insight is targeting. - * @type string $insight_subtype - * Insight subtype. Insight content schema will be stable for a given subtype. - * @type \Google\Protobuf\Struct $content - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * @type \Google\Protobuf\Timestamp $last_refresh_time - * Timestamp of the latest data used to generate the insight. - * @type \Google\Protobuf\Duration $observation_period - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * @type \Google\Cloud\Recommender\V1\InsightStateInfo $state_info - * Information state and metadata. - * @type int $category - * Category being targeted by the insight. - * @type int $severity - * Insight's severity. - * @type string $etag - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * @type array<\Google\Cloud\Recommender\V1\Insight\RecommendationReference>|\Google\Protobuf\Internal\RepeatedField $associated_recommendations - * Recommendations derived from this insight. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); - parent::__construct($data); - } - - /** - * Name of the insight. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the insight. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Fully qualified resource names that this insight is targeting. - * - * Generated from protobuf field repeated string target_resources = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTargetResources() - { - return $this->target_resources; - } - - /** - * Fully qualified resource names that this insight is targeting. - * - * Generated from protobuf field repeated string target_resources = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTargetResources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->target_resources = $arr; - - return $this; - } - - /** - * Insight subtype. Insight content schema will be stable for a given subtype. - * - * Generated from protobuf field string insight_subtype = 10; - * @return string - */ - public function getInsightSubtype() - { - return $this->insight_subtype; - } - - /** - * Insight subtype. Insight content schema will be stable for a given subtype. - * - * Generated from protobuf field string insight_subtype = 10; - * @param string $var - * @return $this - */ - public function setInsightSubtype($var) - { - GPBUtil::checkString($var, True); - $this->insight_subtype = $var; - - return $this; - } - - /** - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * - * Generated from protobuf field .google.protobuf.Struct content = 3; - * @return \Google\Protobuf\Struct|null - */ - public function getContent() - { - return $this->content; - } - - public function hasContent() - { - return isset($this->content); - } - - public function clearContent() - { - unset($this->content); - } - - /** - * A struct of custom fields to explain the insight. - * Example: "grantedPermissionsCount": "1000" - * - * Generated from protobuf field .google.protobuf.Struct content = 3; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->content = $var; - - return $this; - } - - /** - * Timestamp of the latest data used to generate the insight. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastRefreshTime() - { - return $this->last_refresh_time; - } - - public function hasLastRefreshTime() - { - return isset($this->last_refresh_time); - } - - public function clearLastRefreshTime() - { - unset($this->last_refresh_time); - } - - /** - * Timestamp of the latest data used to generate the insight. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastRefreshTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_refresh_time = $var; - - return $this; - } - - /** - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * - * Generated from protobuf field .google.protobuf.Duration observation_period = 5; - * @return \Google\Protobuf\Duration|null - */ - public function getObservationPeriod() - { - return $this->observation_period; - } - - public function hasObservationPeriod() - { - return isset($this->observation_period); - } - - public function clearObservationPeriod() - { - unset($this->observation_period); - } - - /** - * Observation period that led to the insight. The source data used to - * generate the insight ends at last_refresh_time and begins at - * (last_refresh_time - observation_period). - * - * Generated from protobuf field .google.protobuf.Duration observation_period = 5; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setObservationPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->observation_period = $var; - - return $this; - } - - /** - * Information state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; - * @return \Google\Cloud\Recommender\V1\InsightStateInfo|null - */ - public function getStateInfo() - { - return $this->state_info; - } - - public function hasStateInfo() - { - return isset($this->state_info); - } - - public function clearStateInfo() - { - unset($this->state_info); - } - - /** - * Information state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo state_info = 6; - * @param \Google\Cloud\Recommender\V1\InsightStateInfo $var - * @return $this - */ - public function setStateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightStateInfo::class); - $this->state_info = $var; - - return $this; - } - - /** - * Category being targeted by the insight. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; - * @return int - */ - public function getCategory() - { - return $this->category; - } - - /** - * Category being targeted by the insight. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Category category = 7; - * @param int $var - * @return $this - */ - public function setCategory($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Insight\Category::class); - $this->category = $var; - - return $this; - } - - /** - * Insight's severity. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * Insight's severity. - * - * Generated from protobuf field .google.cloud.recommender.v1.Insight.Severity severity = 15; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Insight\Severity::class); - $this->severity = $var; - - return $this; - } - - /** - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the Insight. Provides optimistic locking when updating - * states. - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Recommendations derived from this insight. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAssociatedRecommendations() - { - return $this->associated_recommendations; - } - - /** - * Recommendations derived from this insight. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight.RecommendationReference associated_recommendations = 8; - * @param array<\Google\Cloud\Recommender\V1\Insight\RecommendationReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAssociatedRecommendations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Insight\RecommendationReference::class); - $this->associated_recommendations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php deleted file mode 100644 index 2bd1978a8018..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Category.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.recommender.v1.Insight.Category - */ -class Category -{ - /** - * Unspecified category. - * - * Generated from protobuf enum CATEGORY_UNSPECIFIED = 0; - */ - const CATEGORY_UNSPECIFIED = 0; - /** - * The insight is related to cost. - * - * Generated from protobuf enum COST = 1; - */ - const COST = 1; - /** - * The insight is related to security. - * - * Generated from protobuf enum SECURITY = 2; - */ - const SECURITY = 2; - /** - * The insight is related to performance. - * - * Generated from protobuf enum PERFORMANCE = 3; - */ - const PERFORMANCE = 3; - /** - * This insight is related to manageability. - * - * Generated from protobuf enum MANAGEABILITY = 4; - */ - const MANAGEABILITY = 4; - /** - * The insight is related to sustainability. - * - * Generated from protobuf enum SUSTAINABILITY = 5; - */ - const SUSTAINABILITY = 5; - /** - * This insight is related to reliability. - * - * Generated from protobuf enum RELIABILITY = 6; - */ - const RELIABILITY = 6; - - private static $valueToName = [ - self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', - self::COST => 'COST', - self::SECURITY => 'SECURITY', - self::PERFORMANCE => 'PERFORMANCE', - self::MANAGEABILITY => 'MANAGEABILITY', - self::SUSTAINABILITY => 'SUSTAINABILITY', - self::RELIABILITY => 'RELIABILITY', - ]; - - 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(Category::class, \Google\Cloud\Recommender\V1\Insight_Category::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php deleted file mode 100644 index 2b8fdf78c012..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/RecommendationReference.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.recommender.v1.Insight.RecommendationReference - */ -class RecommendationReference extends \Google\Protobuf\Internal\Message -{ - /** - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * - * Generated from protobuf field string recommendation = 1; - */ - protected $recommendation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $recommendation - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); - parent::__construct($data); - } - - /** - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * - * Generated from protobuf field string recommendation = 1; - * @return string - */ - public function getRecommendation() - { - return $this->recommendation; - } - - /** - * Recommendation resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - * - * Generated from protobuf field string recommendation = 1; - * @param string $var - * @return $this - */ - public function setRecommendation($var) - { - GPBUtil::checkString($var, True); - $this->recommendation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RecommendationReference::class, \Google\Cloud\Recommender\V1\Insight_RecommendationReference::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php deleted file mode 100644 index 4370e3d0118e..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Insight/Severity.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.recommender.v1.Insight.Severity - */ -class Severity -{ - /** - * Insight has unspecified severity. - * - * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; - */ - const SEVERITY_UNSPECIFIED = 0; - /** - * Insight has low severity. - * - * Generated from protobuf enum LOW = 1; - */ - const LOW = 1; - /** - * Insight has medium severity. - * - * Generated from protobuf enum MEDIUM = 2; - */ - const MEDIUM = 2; - /** - * Insight has high severity. - * - * Generated from protobuf enum HIGH = 3; - */ - const HIGH = 3; - /** - * Insight has critical severity. - * - * Generated from protobuf enum CRITICAL = 4; - */ - const CRITICAL = 4; - - private static $valueToName = [ - self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', - self::LOW => 'LOW', - self::MEDIUM => 'MEDIUM', - self::HIGH => 'HIGH', - self::CRITICAL => 'CRITICAL', - ]; - - 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(Severity::class, \Google\Cloud\Recommender\V1\Insight_Severity::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php deleted file mode 100644 index e34f0b84d941..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recommender.v1.InsightStateInfo - */ -class InsightStateInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Insight state. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; - */ - protected $state = 0; - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Insight state. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * A map of metadata for the state, provided by user or automations systems. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Insight::initOnce(); - parent::__construct($data); - } - - /** - * Insight state. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Insight state. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightStateInfo.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\InsightStateInfo\State::class); - $this->state = $var; - - return $this; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php deleted file mode 100644 index 648ce14b4594..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightStateInfo/State.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.recommender.v1.InsightStateInfo.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Insight is active. Content for ACTIVE insights can be updated by Google. - * ACTIVE insights can be marked DISMISSED OR ACCEPTED. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Some action has been taken based on this insight. Insights become - * accepted when a recommendation derived from the insight has been marked - * CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked - * ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED - * insights can only be marked ACCEPTED (which may update state metadata). - * - * Generated from protobuf enum ACCEPTED = 2; - */ - const ACCEPTED = 2; - /** - * Insight is dismissed. Content for DISMISSED insights can be updated by - * Google. DISMISSED insights can be marked as ACTIVE. - * - * Generated from protobuf enum DISMISSED = 3; - */ - const DISMISSED = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::ACCEPTED => 'ACCEPTED', - self::DISMISSED => 'DISMISSED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Recommender\V1\InsightStateInfo_State::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php deleted file mode 100644 index dc2cf99dabcd..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeConfig.php +++ /dev/null @@ -1,347 +0,0 @@ -google.cloud.recommender.v1.InsightTypeConfig - */ -class InsightTypeConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; - */ - protected $insight_type_generation_config = null; - /** - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - */ - private $annotations; - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * @type \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig $insight_type_generation_config - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * @type string $etag - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * @type \Google\Protobuf\Timestamp $update_time - * Last time when the config was updated. - * @type string $revision_id - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * @type string $display_name - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\InsightTypeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of insight type config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; - * @return \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig|null - */ - public function getInsightTypeGenerationConfig() - { - return $this->insight_type_generation_config; - } - - public function hasInsightTypeGenerationConfig() - { - return isset($this->insight_type_generation_config); - } - - public function clearInsightTypeGenerationConfig() - { - unset($this->insight_type_generation_config); - } - - /** - * InsightTypeGenerationConfig which configures the generation of - * insights for this insight type. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeGenerationConfig insight_type_generation_config = 2; - * @param \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig $var - * @return $this - */ - public function setInsightTypeGenerationConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightTypeGenerationConfig::class); - $this->insight_type_generation_config = $var; - - return $this; - } - - /** - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the InsightTypeConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @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); - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php deleted file mode 100644 index 93d2117a35ce..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/InsightTypeGenerationConfig.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.recommender.v1.InsightTypeGenerationConfig - */ -class InsightTypeGenerationConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - */ - protected $params = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $params - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\InsightTypeConfig::initOnce(); - parent::__construct($data); - } - - /** - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @return \Google\Protobuf\Struct|null - */ - public function getParams() - { - return $this->params; - } - - public function hasParams() - { - return isset($this->params); - } - - public function clearParams() - { - unset($this->params); - } - - /** - * Parameters for this InsightTypeGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParams($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php deleted file mode 100644 index d61b254dc69a..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsRequest.php +++ /dev/null @@ -1,319 +0,0 @@ -google.cloud.recommender.v1.ListInsightsRequest - */ -class ListInsightsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. Please see - * {@see RecommenderClient::insightTypeName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\ListInsightsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * @type string $page_token - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * @type string $filter - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * * `stateInfo.state` - * * `insightSubtype` - * * `severity` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `insightSubtype = PERMISSIONS_USAGE` - * * `severity = CRITICAL OR severity = HIGH` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php deleted file mode 100644 index 559624b870fb..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListInsightsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommender.v1.ListInsightsResponse - */ -class ListInsightsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The set of insights for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; - */ - private $insights; - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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\Recommender\V1\Insight>|\Google\Protobuf\Internal\RepeatedField $insights - * The set of insights for the `parent` resource. - * @type string $next_page_token - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * The set of insights for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInsights() - { - return $this->insights; - } - - /** - * The set of insights for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Insight insights = 1; - * @param array<\Google\Cloud\Recommender\V1\Insight>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInsights($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Insight::class); - $this->insights = $arr; - - return $this; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php deleted file mode 100644 index 4d1306e50f46..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsRequest.php +++ /dev/null @@ -1,378 +0,0 @@ -google.cloud.recommender.v1.ListRecommendationsRequest - */ -class ListRecommendationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 5; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. Please see - * {@see RecommenderClient::recommenderName()} for help formatting this field. - * - * @return \Google\Cloud\Recommender\V1\ListRecommendationsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. Please see - * {@see RecommenderClient::recommenderName()} for help formatting this field. - * @param string $filter Filter expression to restrict the recommendations returned. Supported - * filter fields: - * - * * `state_info.state` - * - * * `recommenderSubtype` - * - * * `priority` - * - * * `targetResources` - * - * Examples: - * - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * - * * `priority = P1 OR priority = P2` - * - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * - * The max allowed filter length is 500 characters. - * - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * @return \Google\Cloud\Recommender\V1\ListRecommendationsRequest - * - * @experimental - */ - public static function buildFromParentFilter(string $parent, string $filter): self - { - return (new self()) - ->setParent($parent) - ->setFilter($filter); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * @type int $page_size - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * @type string $page_token - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * @type string $filter - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The container resource on which to execute the request. - * Acceptable formats: - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. If not specified, the server will - * determine the number of results to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. If present, retrieves the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters must be identical to those in the previous call. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 5; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * * `state_info.state` - * * `recommenderSubtype` - * * `priority` - * * `targetResources` - * Examples: - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * * `priority = P1 OR priority = P2` - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * The max allowed filter length is 500 characters. - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * - * Generated from protobuf field string filter = 5; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php deleted file mode 100644 index e1f49c49e2b3..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ListRecommendationsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommender.v1.ListRecommendationsResponse - */ -class ListRecommendationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The set of recommendations for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; - */ - private $recommendations; - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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\Recommender\V1\Recommendation>|\Google\Protobuf\Internal\RepeatedField $recommendations - * The set of recommendations for the `parent` resource. - * @type string $next_page_token - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * The set of recommendations for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRecommendations() - { - return $this->recommendations; - } - - /** - * The set of recommendations for the `parent` resource. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation recommendations = 1; - * @param array<\Google\Cloud\Recommender\V1\Recommendation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRecommendations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Recommendation::class); - $this->recommendations = $arr; - - return $this; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be used to request the next page of results. This field is - * empty if there are no additional results. - * - * 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/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php deleted file mode 100644 index 44812d4b120b..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkInsightAcceptedRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.recommender.v1.MarkInsightAcceptedRequest - */ -class MarkInsightAcceptedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * - * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Insight. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the insight. Please see - * {@see RecommenderClient::insightName()} for help formatting this field. - * @param array $stateMetadata Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * @param string $etag Required. Fingerprint of the Insight. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkInsightAcceptedRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the insight. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * @type string $etag - * Required. Fingerprint of the Insight. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the insight. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * - * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * - * Generated from protobuf field map state_metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Insight. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Insight. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php deleted file mode 100644 index a95547ef0f17..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationClaimedRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationClaimedRequest - */ -class MarkRecommendationClaimedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * @param array $stateMetadata State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkRecommendationClaimedRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @type string $etag - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php deleted file mode 100644 index 41cc6032babd..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationDismissedRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationDismissedRequest - */ -class MarkRecommendationDismissedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 2; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type string $etag - * Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 2; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 2; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php deleted file mode 100644 index 9130a402746f..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationFailedRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationFailedRequest - */ -class MarkRecommendationFailedRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * @param array $stateMetadata State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkRecommendationFailedRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @type string $etag - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php deleted file mode 100644 index 5d95a39fbe78..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/MarkRecommendationSucceededRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -google.cloud.recommender.v1.MarkRecommendationSucceededRequest - */ -class MarkRecommendationSucceededRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the recommendation. Please see - * {@see RecommenderClient::recommendationName()} for help formatting this field. - * @param array $stateMetadata State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * @return \Google\Cloud\Recommender\V1\MarkRecommendationSucceededRequest - * - * @experimental - */ - public static function build(string $name, array $stateMetadata, string $etag): self - { - return (new self()) - ->setName($name) - ->setStateMetadata($stateMetadata) - ->setEtag($etag); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the recommendation. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @type string $etag - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the recommendation. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Required. Fingerprint of the Recommendation. Provides optimistic locking. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php deleted file mode 100644 index 096085bea6f7..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Operation.php +++ /dev/null @@ -1,564 +0,0 @@ -google.cloud.recommender.v1.Operation - */ -class Operation extends \Google\Protobuf\Internal\Message -{ - /** - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * - * Generated from protobuf field string action = 1; - */ - protected $action = ''; - /** - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * - * Generated from protobuf field string resource_type = 2; - */ - protected $resource_type = ''; - /** - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * - * Generated from protobuf field string resource = 3; - */ - protected $resource = ''; - /** - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * - * Generated from protobuf field string path = 4; - */ - protected $path = ''; - /** - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * - * Generated from protobuf field string source_resource = 5; - */ - protected $source_resource = ''; - /** - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * - * Generated from protobuf field string source_path = 6; - */ - protected $source_path = ''; - /** - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_filters = 8; - */ - private $path_filters; - /** - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_value_matchers = 11; - */ - private $path_value_matchers; - protected $path_value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $action - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * @type string $resource_type - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * @type string $resource - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * @type string $path - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * @type string $source_resource - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * @type string $source_path - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * @type \Google\Protobuf\Value $value - * Value for the `path` field. Will be set for actions:'add'/'replace'. - * Maybe set for action: 'test'. Either this or `value_matcher` will be set - * for 'test' operation. An exact match must be performed. - * @type \Google\Cloud\Recommender\V1\ValueMatcher $value_matcher - * Can be set for action 'test' for advanced matching for the value of - * 'path' field. Either this or `value` will be set for 'test' operation. - * @type array|\Google\Protobuf\Internal\MapField $path_filters - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * @type array|\Google\Protobuf\Internal\MapField $path_value_matchers - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * - * Generated from protobuf field string action = 1; - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - * 'copy', 'test' and custom operations. This field is case-insensitive and - * always populated. - * - * Generated from protobuf field string action = 1; - * @param string $var - * @return $this - */ - public function setAction($var) - { - GPBUtil::checkString($var, True); - $this->action = $var; - - return $this; - } - - /** - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * - * Generated from protobuf field string resource_type = 2; - * @return string - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Type of GCP resource being modified/tested. This field is always populated. - * Example: cloudresourcemanager.googleapis.com/Project, - * compute.googleapis.com/Instance - * - * Generated from protobuf field string resource_type = 2; - * @param string $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkString($var, True); - $this->resource_type = $var; - - return $this; - } - - /** - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * - * Generated from protobuf field string resource = 3; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Contains the fully qualified resource name. This field is always populated. - * ex: //cloudresourcemanager.googleapis.com/projects/foo. - * - * Generated from protobuf field string resource = 3; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * - * Generated from protobuf field string path = 4; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path to the target field being operated on. If the operation is at the - * resource level, then path should be "/". This field is always populated. - * - * Generated from protobuf field string path = 4; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * - * Generated from protobuf field string source_resource = 5; - * @return string - */ - public function getSourceResource() - { - return $this->source_resource; - } - - /** - * Can be set with action 'copy' to copy resource configuration across - * different resources of the same type. Example: A resource clone can be - * done via action = 'copy', path = "/", from = "/", - * source_resource = and resource_name = . - * This field is empty for all other values of `action`. - * - * Generated from protobuf field string source_resource = 5; - * @param string $var - * @return $this - */ - public function setSourceResource($var) - { - GPBUtil::checkString($var, True); - $this->source_resource = $var; - - return $this; - } - - /** - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * - * Generated from protobuf field string source_path = 6; - * @return string - */ - public function getSourcePath() - { - return $this->source_path; - } - - /** - * Can be set with action 'copy' or 'move' to indicate the source field within - * resource or source_resource, ignored if provided for other operation types. - * - * Generated from protobuf field string source_path = 6; - * @param string $var - * @return $this - */ - public function setSourcePath($var) - { - GPBUtil::checkString($var, True); - $this->source_path = $var; - - return $this; - } - - /** - * Value for the `path` field. Will be set for actions:'add'/'replace'. - * Maybe set for action: 'test'. Either this or `value_matcher` will be set - * for 'test' operation. An exact match must be performed. - * - * Generated from protobuf field .google.protobuf.Value value = 7; - * @return \Google\Protobuf\Value|null - */ - public function getValue() - { - return $this->readOneof(7); - } - - public function hasValue() - { - return $this->hasOneof(7); - } - - /** - * Value for the `path` field. Will be set for actions:'add'/'replace'. - * Maybe set for action: 'test'. Either this or `value_matcher` will be set - * for 'test' operation. An exact match must be performed. - * - * Generated from protobuf field .google.protobuf.Value value = 7; - * @param \Google\Protobuf\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Can be set for action 'test' for advanced matching for the value of - * 'path' field. Either this or `value` will be set for 'test' operation. - * - * Generated from protobuf field .google.cloud.recommender.v1.ValueMatcher value_matcher = 10; - * @return \Google\Cloud\Recommender\V1\ValueMatcher|null - */ - public function getValueMatcher() - { - return $this->readOneof(10); - } - - public function hasValueMatcher() - { - return $this->hasOneof(10); - } - - /** - * Can be set for action 'test' for advanced matching for the value of - * 'path' field. Either this or `value` will be set for 'test' operation. - * - * Generated from protobuf field .google.cloud.recommender.v1.ValueMatcher value_matcher = 10; - * @param \Google\Cloud\Recommender\V1\ValueMatcher $var - * @return $this - */ - public function setValueMatcher($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ValueMatcher::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_filters = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPathFilters() - { - return $this->path_filters; - } - - /** - * Set of filters to apply if `path` refers to array elements or nested array - * elements in order to narrow down to a single unique element that is being - * tested/modified. - * This is intended to be an exact match per filter. To perform advanced - * matching, use path_value_matchers. - * * Example: - * ``` - * { - * "/versions/*/name" : "it-123" - * "/versions/*/targetSize/percent": 20 - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/condition" : null - * } - * ``` - * * Example: - * ``` - * { - * "/bindings/*/role": "roles/owner" - * "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - * } - * ``` - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_filters = 8; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPathFilters($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->path_filters = $arr; - - return $this; - } - - /** - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_value_matchers = 11; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPathValueMatchers() - { - return $this->path_value_matchers; - } - - /** - * Similar to path_filters, this contains set of filters to apply if `path` - * field refers to array elements. This is meant to support value matching - * beyond exact match. To perform exact match, use path_filters. - * When both path_filters and path_value_matchers are set, an implicit AND - * must be performed. - * - * Generated from protobuf field map path_value_matchers = 11; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPathValueMatchers($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\ValueMatcher::class); - $this->path_value_matchers = $arr; - - return $this; - } - - /** - * @return string - */ - public function getPathValue() - { - return $this->whichOneof("path_value"); - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php deleted file mode 100644 index f074d103714a..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/OperationGroup.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.recommender.v1.OperationGroup - */ -class OperationGroup extends \Google\Protobuf\Internal\Message -{ - /** - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; - */ - private $operations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Recommender\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $operations - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOperations() - { - return $this->operations; - } - - /** - * List of operations across one or more resources that belong to this group. - * Loosely based on RFC6902 and should be performed in the order they appear. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Operation operations = 1; - * @param array<\Google\Cloud\Recommender\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOperations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Operation::class); - $this->operations = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php deleted file mode 100644 index 0883027776d1..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation.php +++ /dev/null @@ -1,546 +0,0 @@ -google.cloud.recommender.v1.Recommendation - */ -class Recommendation extends \Google\Protobuf\Internal\Message -{ - /** - * Name of recommendation. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * - * Generated from protobuf field string recommender_subtype = 12; - */ - protected $recommender_subtype = ''; - /** - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - */ - protected $last_refresh_time = null; - /** - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; - */ - protected $primary_impact = null; - /** - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; - */ - private $additional_impact; - /** - * Recommendation's priority. - * - * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; - */ - protected $priority = 0; - /** - * Content of the recommendation describing recommended changes to resources. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; - */ - protected $content = null; - /** - * Information for state. Contains state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; - */ - protected $state_info = null; - /** - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Insights that led to this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; - */ - private $associated_insights; - /** - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * - * Generated from protobuf field string xor_group_id = 18; - */ - protected $xor_group_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of recommendation. - * @type string $description - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * @type string $recommender_subtype - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * @type \Google\Protobuf\Timestamp $last_refresh_time - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * @type \Google\Cloud\Recommender\V1\Impact $primary_impact - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * @type array<\Google\Cloud\Recommender\V1\Impact>|\Google\Protobuf\Internal\RepeatedField $additional_impact - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * @type int $priority - * Recommendation's priority. - * @type \Google\Cloud\Recommender\V1\RecommendationContent $content - * Content of the recommendation describing recommended changes to resources. - * @type \Google\Cloud\Recommender\V1\RecommendationStateInfo $state_info - * Information for state. Contains state and metadata. - * @type string $etag - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * @type array<\Google\Cloud\Recommender\V1\Recommendation\InsightReference>|\Google\Protobuf\Internal\RepeatedField $associated_insights - * Insights that led to this recommendation. - * @type string $xor_group_id - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Name of recommendation. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of recommendation. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Free-form human readable summary in English. The maximum length is 500 - * characters. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * - * Generated from protobuf field string recommender_subtype = 12; - * @return string - */ - public function getRecommenderSubtype() - { - return $this->recommender_subtype; - } - - /** - * Contains an identifier for a subtype of recommendations produced for the - * same recommender. Subtype is a function of content and impact, meaning a - * new subtype might be added when significant changes to `content` or - * `primary_impact.category` are introduced. See the Recommenders section - * to see a list of subtypes for a given Recommender. - * Examples: - * For recommender = "google.iam.policy.Recommender", - * recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - * - * Generated from protobuf field string recommender_subtype = 12; - * @param string $var - * @return $this - */ - public function setRecommenderSubtype($var) - { - GPBUtil::checkString($var, True); - $this->recommender_subtype = $var; - - return $this; - } - - /** - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getLastRefreshTime() - { - return $this->last_refresh_time; - } - - public function hasLastRefreshTime() - { - return isset($this->last_refresh_time); - } - - public function clearLastRefreshTime() - { - unset($this->last_refresh_time); - } - - /** - * Last time this recommendation was refreshed by the system that created it - * in the first place. - * - * Generated from protobuf field .google.protobuf.Timestamp last_refresh_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setLastRefreshTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->last_refresh_time = $var; - - return $this; - } - - /** - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; - * @return \Google\Cloud\Recommender\V1\Impact|null - */ - public function getPrimaryImpact() - { - return $this->primary_impact; - } - - public function hasPrimaryImpact() - { - return isset($this->primary_impact); - } - - public function clearPrimaryImpact() - { - unset($this->primary_impact); - } - - /** - * The primary impact that this recommendation can have while trying to - * optimize for one category. - * - * Generated from protobuf field .google.cloud.recommender.v1.Impact primary_impact = 5; - * @param \Google\Cloud\Recommender\V1\Impact $var - * @return $this - */ - public function setPrimaryImpact($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\Impact::class); - $this->primary_impact = $var; - - return $this; - } - - /** - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdditionalImpact() - { - return $this->additional_impact; - } - - /** - * Optional set of additional impact that this recommendation may have when - * trying to optimize for the primary category. These may be positive - * or negative. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Impact additional_impact = 6; - * @param array<\Google\Cloud\Recommender\V1\Impact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdditionalImpact($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Impact::class); - $this->additional_impact = $arr; - - return $this; - } - - /** - * Recommendation's priority. - * - * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; - * @return int - */ - public function getPriority() - { - return $this->priority; - } - - /** - * Recommendation's priority. - * - * Generated from protobuf field .google.cloud.recommender.v1.Recommendation.Priority priority = 17; - * @param int $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Recommendation\Priority::class); - $this->priority = $var; - - return $this; - } - - /** - * Content of the recommendation describing recommended changes to resources. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; - * @return \Google\Cloud\Recommender\V1\RecommendationContent|null - */ - public function getContent() - { - return $this->content; - } - - public function hasContent() - { - return isset($this->content); - } - - public function clearContent() - { - unset($this->content); - } - - /** - * Content of the recommendation describing recommended changes to resources. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationContent content = 7; - * @param \Google\Cloud\Recommender\V1\RecommendationContent $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommendationContent::class); - $this->content = $var; - - return $this; - } - - /** - * Information for state. Contains state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; - * @return \Google\Cloud\Recommender\V1\RecommendationStateInfo|null - */ - public function getStateInfo() - { - return $this->state_info; - } - - public function hasStateInfo() - { - return isset($this->state_info); - } - - public function clearStateInfo() - { - unset($this->state_info); - } - - /** - * Information for state. Contains state and metadata. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo state_info = 10; - * @param \Google\Cloud\Recommender\V1\RecommendationStateInfo $var - * @return $this - */ - public function setStateInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo::class); - $this->state_info = $var; - - return $this; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the Recommendation. Provides optimistic locking when - * updating states. - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Insights that led to this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAssociatedInsights() - { - return $this->associated_insights; - } - - /** - * Insights that led to this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14; - * @param array<\Google\Cloud\Recommender\V1\Recommendation\InsightReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAssociatedInsights($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\Recommendation\InsightReference::class); - $this->associated_insights = $arr; - - return $this; - } - - /** - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * - * Generated from protobuf field string xor_group_id = 18; - * @return string - */ - public function getXorGroupId() - { - return $this->xor_group_id; - } - - /** - * Corresponds to a mutually exclusive group ID within a recommender. - * A non-empty ID indicates that the recommendation belongs to a mutually - * exclusive group. This means that only one recommendation within the group - * is suggested to be applied. - * - * Generated from protobuf field string xor_group_id = 18; - * @param string $var - * @return $this - */ - public function setXorGroupId($var) - { - GPBUtil::checkString($var, True); - $this->xor_group_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php deleted file mode 100644 index bbf72313b89d..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/InsightReference.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.recommender.v1.Recommendation.InsightReference - */ -class InsightReference extends \Google\Protobuf\Internal\Message -{ - /** - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * - * Generated from protobuf field string insight = 1; - */ - protected $insight = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $insight - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * - * Generated from protobuf field string insight = 1; - * @return string - */ - public function getInsight() - { - return $this->insight; - } - - /** - * Insight resource name, e.g. - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - * - * Generated from protobuf field string insight = 1; - * @param string $var - * @return $this - */ - public function setInsight($var) - { - GPBUtil::checkString($var, True); - $this->insight = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InsightReference::class, \Google\Cloud\Recommender\V1\Recommendation_InsightReference::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php deleted file mode 100644 index 0077380a5659..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/Recommendation/Priority.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.recommender.v1.Recommendation.Priority - */ -class Priority -{ - /** - * Recommendation has unspecified priority. - * - * Generated from protobuf enum PRIORITY_UNSPECIFIED = 0; - */ - const PRIORITY_UNSPECIFIED = 0; - /** - * Recommendation has P4 priority (lowest priority). - * - * Generated from protobuf enum P4 = 1; - */ - const P4 = 1; - /** - * Recommendation has P3 priority (second lowest priority). - * - * Generated from protobuf enum P3 = 2; - */ - const P3 = 2; - /** - * Recommendation has P2 priority (second highest priority). - * - * Generated from protobuf enum P2 = 3; - */ - const P2 = 3; - /** - * Recommendation has P1 priority (highest priority). - * - * Generated from protobuf enum P1 = 4; - */ - const P1 = 4; - - private static $valueToName = [ - self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED', - self::P4 => 'P4', - self::P3 => 'P3', - self::P2 => 'P2', - self::P1 => 'P1', - ]; - - 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(Priority::class, \Google\Cloud\Recommender\V1\Recommendation_Priority::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php deleted file mode 100644 index 8f9bc53a3a93..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationContent.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.recommender.v1.RecommendationContent - */ -class RecommendationContent extends \Google\Protobuf\Internal\Message -{ - /** - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; - */ - private $operation_groups; - /** - * Condensed overview information about the recommendation. - * - * Generated from protobuf field .google.protobuf.Struct overview = 3; - */ - protected $overview = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Recommender\V1\OperationGroup>|\Google\Protobuf\Internal\RepeatedField $operation_groups - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * @type \Google\Protobuf\Struct $overview - * Condensed overview information about the recommendation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOperationGroups() - { - return $this->operation_groups; - } - - /** - * Operations to one or more Google Cloud resources grouped in such a way - * that, all operations within one group are expected to be performed - * atomically and in an order. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.OperationGroup operation_groups = 2; - * @param array<\Google\Cloud\Recommender\V1\OperationGroup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOperationGroups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Recommender\V1\OperationGroup::class); - $this->operation_groups = $arr; - - return $this; - } - - /** - * Condensed overview information about the recommendation. - * - * Generated from protobuf field .google.protobuf.Struct overview = 3; - * @return \Google\Protobuf\Struct|null - */ - public function getOverview() - { - return $this->overview; - } - - public function hasOverview() - { - return isset($this->overview); - } - - public function clearOverview() - { - unset($this->overview); - } - - /** - * Condensed overview information about the recommendation. - * - * Generated from protobuf field .google.protobuf.Struct overview = 3; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setOverview($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->overview = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php deleted file mode 100644 index af3d2fa1cc79..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.recommender.v1.RecommendationStateInfo - */ -class RecommendationStateInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; - */ - protected $state = 0; - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - */ - private $state_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * @type array|\Google\Protobuf\Internal\MapField $state_metadata - * A map of metadata for the state, provided by user or automations systems. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommendationStateInfo.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo\State::class); - $this->state = $var; - - return $this; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getStateMetadata() - { - return $this->state_metadata; - } - - /** - * A map of metadata for the state, provided by user or automations systems. - * - * Generated from protobuf field map state_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setStateMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->state_metadata = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php deleted file mode 100644 index 4813573e86d2..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommendationStateInfo/State.php +++ /dev/null @@ -1,95 +0,0 @@ -google.cloud.recommender.v1.RecommendationStateInfo.State - */ -class State -{ - /** - * Default state. Don't use directly. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Recommendation is active and can be applied. Recommendations content can - * be updated by Google. - * ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Recommendation is in claimed state. Recommendations content is - * immutable and cannot be updated by Google. - * CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. - * - * Generated from protobuf enum CLAIMED = 6; - */ - const CLAIMED = 6; - /** - * Recommendation is in succeeded state. Recommendations content is - * immutable and cannot be updated by Google. - * SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * Recommendation is in failed state. Recommendations content is immutable - * and cannot be updated by Google. - * FAILED recommendations can be marked as SUCCEEDED, or FAILED. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * Recommendation is in dismissed state. Recommendation content can be - * updated by Google. - * DISMISSED recommendations can be marked as ACTIVE. - * - * Generated from protobuf enum DISMISSED = 5; - */ - const DISMISSED = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::CLAIMED => 'CLAIMED', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::DISMISSED => 'DISMISSED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Recommender\V1\RecommendationStateInfo_State::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php deleted file mode 100644 index 8e6b676d2551..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderConfig.php +++ /dev/null @@ -1,347 +0,0 @@ -google.cloud.recommender.v1.RecommenderConfig - */ -class RecommenderConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; - */ - protected $recommender_generation_config = null; - /** - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - */ - private $annotations; - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * @type \Google\Cloud\Recommender\V1\RecommenderGenerationConfig $recommender_generation_config - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * @type string $etag - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * @type \Google\Protobuf\Timestamp $update_time - * Last time when the config was updated. - * @type string $revision_id - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * @type string $display_name - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderConfig::initOnce(); - parent::__construct($data); - } - - /** - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of recommender config. - * Eg, - * projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; - * @return \Google\Cloud\Recommender\V1\RecommenderGenerationConfig|null - */ - public function getRecommenderGenerationConfig() - { - return $this->recommender_generation_config; - } - - public function hasRecommenderGenerationConfig() - { - return isset($this->recommender_generation_config); - } - - public function clearRecommenderGenerationConfig() - { - unset($this->recommender_generation_config); - } - - /** - * RecommenderGenerationConfig which configures the Generation of - * recommendations for this recommender. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderGenerationConfig recommender_generation_config = 2; - * @param \Google\Cloud\Recommender\V1\RecommenderGenerationConfig $var - * @return $this - */ - public function setRecommenderGenerationConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommenderGenerationConfig::class); - $this->recommender_generation_config = $var; - - return $this; - } - - /** - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Fingerprint of the RecommenderConfig. Provides optimistic locking when - * updating. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @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); - } - - /** - * Last time when the config was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. Immutable. The revision ID of the config. - * A new revision is committed whenever the config is changed in any way. - * The format is an 8-character hexadecimal string. - * - * Generated from protobuf field string revision_id = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Allows clients to store small amounts of arbitrary data. Annotations must - * follow the Kubernetes syntax. - * The total size of all keys and values combined is limited to 256k. - * Key can have 2 segments: prefix (optional) and name (required), - * separated by a slash (/). - * Prefix must be a DNS subdomain. - * Name must be 63 characters or less, begin and end with alphanumerics, - * with dashes (-), underscores (_), dots (.), and alphanumerics between. - * - * Generated from protobuf field map annotations = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A user-settable field to provide a human-readable name to be used in user - * interfaces. - * - * Generated from protobuf field string display_name = 7; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php deleted file mode 100644 index 7c2e642c0a83..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/RecommenderGenerationConfig.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.recommender.v1.RecommenderGenerationConfig - */ -class RecommenderGenerationConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - */ - protected $params = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $params - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderConfig::initOnce(); - parent::__construct($data); - } - - /** - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @return \Google\Protobuf\Struct|null - */ - public function getParams() - { - return $this->params; - } - - public function hasParams() - { - return isset($this->params); - } - - public function clearParams() - { - unset($this->params); - } - - /** - * Parameters for this RecommenderGenerationConfig. These configs can be used - * by or are applied to all subtypes. - * - * Generated from protobuf field .google.protobuf.Struct params = 1; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParams($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php deleted file mode 100644 index 10f00f46f499..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection.php +++ /dev/null @@ -1,111 +0,0 @@ -google.cloud.recommender.v1.ReliabilityProjection - */ -class ReliabilityProjection extends \Google\Protobuf\Internal\Message -{ - /** - * Reliability risks mitigated by this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; - */ - private $risks; - /** - * Per-recommender projection. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - */ - protected $details = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $risks - * Reliability risks mitigated by this recommendation. - * @type \Google\Protobuf\Struct $details - * Per-recommender projection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Reliability risks mitigated by this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRisks() - { - return $this->risks; - } - - /** - * Reliability risks mitigated by this recommendation. - * - * Generated from protobuf field repeated .google.cloud.recommender.v1.ReliabilityProjection.RiskType risks = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRisks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Recommender\V1\ReliabilityProjection\RiskType::class); - $this->risks = $arr; - - return $this; - } - - /** - * Per-recommender projection. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @return \Google\Protobuf\Struct|null - */ - public function getDetails() - { - return $this->details; - } - - public function hasDetails() - { - return isset($this->details); - } - - public function clearDetails() - { - unset($this->details); - } - - /** - * Per-recommender projection. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->details = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php deleted file mode 100644 index 3f37986fd3a7..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ReliabilityProjection/RiskType.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.recommender.v1.ReliabilityProjection.RiskType - */ -class RiskType -{ - /** - * Default unspecified risk. Don't use directly. - * - * Generated from protobuf enum RISK_TYPE_UNSPECIFIED = 0; - */ - const RISK_TYPE_UNSPECIFIED = 0; - /** - * Potential service downtime. - * - * Generated from protobuf enum SERVICE_DISRUPTION = 1; - */ - const SERVICE_DISRUPTION = 1; - /** - * Potential data loss. - * - * Generated from protobuf enum DATA_LOSS = 2; - */ - const DATA_LOSS = 2; - /** - * Potential access denial. The service is still up but some or all clients - * can't access it. - * - * Generated from protobuf enum ACCESS_DENY = 3; - */ - const ACCESS_DENY = 3; - - private static $valueToName = [ - self::RISK_TYPE_UNSPECIFIED => 'RISK_TYPE_UNSPECIFIED', - self::SERVICE_DISRUPTION => 'SERVICE_DISRUPTION', - self::DATA_LOSS => 'DATA_LOSS', - self::ACCESS_DENY => 'ACCESS_DENY', - ]; - - 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(RiskType::class, \Google\Cloud\Recommender\V1\ReliabilityProjection_RiskType::class); - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php deleted file mode 100644 index dffe739191c5..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SecurityProjection.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.recommender.v1.SecurityProjection - */ -class SecurityProjection extends \Google\Protobuf\Internal\Message -{ - /** - * Additional security impact details that is provided by the recommender. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - */ - protected $details = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Struct $details - * Additional security impact details that is provided by the recommender. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Additional security impact details that is provided by the recommender. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @return \Google\Protobuf\Struct|null - */ - public function getDetails() - { - return $this->details; - } - - public function hasDetails() - { - return isset($this->details); - } - - public function clearDetails() - { - unset($this->details); - } - - /** - * Additional security impact details that is provided by the recommender. - * - * Generated from protobuf field .google.protobuf.Struct details = 2; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->details = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php deleted file mode 100644 index a1d4678563e6..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/SustainabilityProjection.php +++ /dev/null @@ -1,116 +0,0 @@ -google.cloud.recommender.v1.SustainabilityProjection - */ -class SustainabilityProjection extends \Google\Protobuf\Internal\Message -{ - /** - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * - * Generated from protobuf field double kg_c_o2e = 1; - */ - protected $kg_c_o2e = 0.0; - /** - * Duration for which this sustainability applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - */ - protected $duration = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $kg_c_o2e - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * @type \Google\Protobuf\Duration $duration - * Duration for which this sustainability applies. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * - * Generated from protobuf field double kg_c_o2e = 1; - * @return float - */ - public function getKgCO2E() - { - return $this->kg_c_o2e; - } - - /** - * Carbon Footprint generated in kg of CO2 equivalent. - * Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - * - * Generated from protobuf field double kg_c_o2e = 1; - * @param float $var - * @return $this - */ - public function setKgCO2E($var) - { - GPBUtil::checkDouble($var); - $this->kg_c_o2e = $var; - - return $this; - } - - /** - * Duration for which this sustainability applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Duration for which this sustainability applies. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php deleted file mode 100644 index 6c402f186c4c..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateInsightTypeConfigRequest.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.recommender.v1.UpdateInsightTypeConfigRequest - */ -class UpdateInsightTypeConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The InsightTypeConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $insight_type_config = null; - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\Recommender\V1\InsightTypeConfig $insightTypeConfig Required. The InsightTypeConfig to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. - * - * @return \Google\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Recommender\V1\InsightTypeConfig $insightTypeConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setInsightTypeConfig($insightTypeConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Recommender\V1\InsightTypeConfig $insight_type_config - * Required. The InsightTypeConfig to update. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to be updated. - * @type bool $validate_only - * If true, validate the request and preview the change, but do not actually - * update it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The InsightTypeConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Recommender\V1\InsightTypeConfig|null - */ - public function getInsightTypeConfig() - { - return $this->insight_type_config; - } - - public function hasInsightTypeConfig() - { - return isset($this->insight_type_config); - } - - public function clearInsightTypeConfig() - { - unset($this->insight_type_config); - } - - /** - * Required. The InsightTypeConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.InsightTypeConfig insight_type_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Recommender\V1\InsightTypeConfig $var - * @return $this - */ - public function setInsightTypeConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\InsightTypeConfig::class); - $this->insight_type_config = $var; - - return $this; - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php deleted file mode 100644 index 9977e4f6feff..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/UpdateRecommenderConfigRequest.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.recommender.v1.UpdateRecommenderConfigRequest - */ -class UpdateRecommenderConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The RecommenderConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $recommender_config = null; - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - - /** - * @param \Google\Cloud\Recommender\V1\RecommenderConfig $recommenderConfig Required. The RecommenderConfig to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. - * - * @return \Google\Cloud\Recommender\V1\UpdateRecommenderConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Recommender\V1\RecommenderConfig $recommenderConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setRecommenderConfig($recommenderConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Recommender\V1\RecommenderConfig $recommender_config - * Required. The RecommenderConfig to update. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to be updated. - * @type bool $validate_only - * If true, validate the request and preview the change, but do not actually - * update it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\RecommenderService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The RecommenderConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Recommender\V1\RecommenderConfig|null - */ - public function getRecommenderConfig() - { - return $this->recommender_config; - } - - public function hasRecommenderConfig() - { - return isset($this->recommender_config); - } - - public function clearRecommenderConfig() - { - unset($this->recommender_config); - } - - /** - * Required. The RecommenderConfig to update. - * - * Generated from protobuf field .google.cloud.recommender.v1.RecommenderConfig recommender_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Recommender\V1\RecommenderConfig $var - * @return $this - */ - public function setRecommenderConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\RecommenderConfig::class); - $this->recommender_config = $var; - - return $this; - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If true, validate the request and preview the change, but do not actually - * update it. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php b/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php deleted file mode 100644 index eac350eddd64..000000000000 --- a/owl-bot-staging/Recommender/v1/proto/src/Google/Cloud/Recommender/V1/ValueMatcher.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.recommender.v1.ValueMatcher - */ -class ValueMatcher extends \Google\Protobuf\Internal\Message -{ - protected $match_variant; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $matches_pattern - * To be used for full regex matching. The regular expression is using the - * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - * used with RE2::FullMatch - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce(); - parent::__construct($data); - } - - /** - * To be used for full regex matching. The regular expression is using the - * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - * used with RE2::FullMatch - * - * Generated from protobuf field string matches_pattern = 1; - * @return string - */ - public function getMatchesPattern() - { - return $this->readOneof(1); - } - - public function hasMatchesPattern() - { - return $this->hasOneof(1); - } - - /** - * To be used for full regex matching. The regular expression is using the - * Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - * used with RE2::FullMatch - * - * Generated from protobuf field string matches_pattern = 1; - * @param string $var - * @return $this - */ - public function setMatchesPattern($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getMatchVariant() - { - return $this->whichOneof("match_variant"); - } - -} - diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php deleted file mode 100644 index 5c502b5e1b7b..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight.php +++ /dev/null @@ -1,72 +0,0 @@ -getInsight($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::insightName( - '[PROJECT]', - '[LOCATION]', - '[INSIGHT_TYPE]', - '[INSIGHT]' - ); - - get_insight_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetInsight_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php deleted file mode 100644 index 7fb4e53aee22..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_insight_type_config.php +++ /dev/null @@ -1,81 +0,0 @@ -getInsightTypeConfig($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::insightTypeConfigName( - '[PROJECT]', - '[LOCATION]', - '[INSIGHT_TYPE]' - ); - - get_insight_type_config_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php deleted file mode 100644 index 261705b1f737..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommendation.php +++ /dev/null @@ -1,72 +0,0 @@ -getRecommendation($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - - get_recommendation_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetRecommendation_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php deleted file mode 100644 index cb5294a103d8..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/get_recommender_config.php +++ /dev/null @@ -1,81 +0,0 @@ -getRecommenderConfig($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommenderConfigName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]' - ); - - get_recommender_config_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_GetRecommenderConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php deleted file mode 100644 index 660b2ab3e744..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_insights.php +++ /dev/null @@ -1,88 +0,0 @@ -listInsights($formattedParent); - - /** @var Insight $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecommenderClient::insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - - list_insights_sample($formattedParent); -} -// [END recommender_v1_generated_Recommender_ListInsights_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php deleted file mode 100644 index 956fe8c23c1e..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/list_recommendations.php +++ /dev/null @@ -1,88 +0,0 @@ -listRecommendations($formattedParent); - - /** @var Recommendation $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RecommenderClient::recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - - list_recommendations_sample($formattedParent); -} -// [END recommender_v1_generated_Recommender_ListRecommendations_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php deleted file mode 100644 index f0cc08eb2b59..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_insight_accepted.php +++ /dev/null @@ -1,78 +0,0 @@ -markInsightAccepted($formattedName, $etag); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::insightName( - '[PROJECT]', - '[LOCATION]', - '[INSIGHT_TYPE]', - '[INSIGHT]' - ); - $etag = '[ETAG]'; - - mark_insight_accepted_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkInsightAccepted_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php deleted file mode 100644 index e40aecdd3327..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_claimed.php +++ /dev/null @@ -1,82 +0,0 @@ -markRecommendationClaimed($formattedName, $etag); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - $etag = '[ETAG]'; - - mark_recommendation_claimed_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php deleted file mode 100644 index e0abf3faa2bc..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_dismissed.php +++ /dev/null @@ -1,79 +0,0 @@ -markRecommendationDismissed($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - - mark_recommendation_dismissed_sample($formattedName); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php deleted file mode 100644 index d5b860a3002a..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_failed.php +++ /dev/null @@ -1,83 +0,0 @@ -markRecommendationFailed($formattedName, $etag); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - $etag = '[ETAG]'; - - mark_recommendation_failed_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php deleted file mode 100644 index 818360175e54..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/mark_recommendation_succeeded.php +++ /dev/null @@ -1,83 +0,0 @@ -markRecommendationSucceeded($formattedName, $etag); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RecommenderClient::recommendationName( - '[PROJECT]', - '[LOCATION]', - '[RECOMMENDER]', - '[RECOMMENDATION]' - ); - $etag = '[ETAG]'; - - mark_recommendation_succeeded_sample($formattedName, $etag); -} -// [END recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php deleted file mode 100644 index a2ce44db01ba..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_insight_type_config.php +++ /dev/null @@ -1,57 +0,0 @@ -updateInsightTypeConfig($insightTypeConfig); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php b/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php deleted file mode 100644 index 1398b72423c8..000000000000 --- a/owl-bot-staging/Recommender/v1/samples/V1/RecommenderClient/update_recommender_config.php +++ /dev/null @@ -1,57 +0,0 @@ -updateRecommenderConfig($recommenderConfig); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] diff --git a/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php b/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php deleted file mode 100644 index c9b9e3ad9e6b..000000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/Client/RecommenderClient.php +++ /dev/null @@ -1,1167 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/recommender_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/recommender_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/recommender_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/recommender_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * - * @return string The formatted billing_account_location_insight_type resource. - */ - public static function billingAccountLocationInsightTypeName(string $billingAccount, string $location, string $insightType): string - { - return self::getPathTemplate('billingAccountLocationInsightType')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type_config resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * - * @return string The formatted billing_account_location_insight_type_config resource. - */ - public static function billingAccountLocationInsightTypeConfigName(string $billingAccount, string $location, string $insightType): string - { - return self::getPathTemplate('billingAccountLocationInsightTypeConfig')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type_insight resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted billing_account_location_insight_type_insight resource. - */ - public static function billingAccountLocationInsightTypeInsightName(string $billingAccount, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('billingAccountLocationInsightTypeInsight')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * - * @return string The formatted billing_account_location_recommender resource. - */ - public static function billingAccountLocationRecommenderName(string $billingAccount, string $location, string $recommender): string - { - return self::getPathTemplate('billingAccountLocationRecommender')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender_config resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * - * @return string The formatted billing_account_location_recommender_config resource. - */ - public static function billingAccountLocationRecommenderConfigName(string $billingAccount, string $location, string $recommender): string - { - return self::getPathTemplate('billingAccountLocationRecommenderConfig')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender_recommendation resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted billing_account_location_recommender_recommendation resource. - */ - public static function billingAccountLocationRecommenderRecommendationName(string $billingAccount, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('billingAccountLocationRecommenderRecommendation')->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_insight_type resource. - * - * @param string $folder - * @param string $location - * @param string $insightType - * - * @return string The formatted folder_location_insight_type resource. - */ - public static function folderLocationInsightTypeName(string $folder, string $location, string $insightType): string - { - return self::getPathTemplate('folderLocationInsightType')->render([ - 'folder' => $folder, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_insight_type_insight resource. - * - * @param string $folder - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted folder_location_insight_type_insight resource. - */ - public static function folderLocationInsightTypeInsightName(string $folder, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('folderLocationInsightTypeInsight')->render([ - 'folder' => $folder, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_recommender resource. - * - * @param string $folder - * @param string $location - * @param string $recommender - * - * @return string The formatted folder_location_recommender resource. - */ - public static function folderLocationRecommenderName(string $folder, string $location, string $recommender): string - { - return self::getPathTemplate('folderLocationRecommender')->render([ - 'folder' => $folder, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_recommender_recommendation resource. - * - * @param string $folder - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted folder_location_recommender_recommendation resource. - */ - public static function folderLocationRecommenderRecommendationName(string $folder, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('folderLocationRecommenderRecommendation')->render([ - 'folder' => $folder, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a insight - * resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted insight resource. - */ - public static function insightName(string $project, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('insight')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a insight_type - * resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted insight_type resource. - */ - public static function insightTypeName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('insightType')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * insight_type_config resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted insight_type_config resource. - */ - public static function insightTypeConfigName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('insightTypeConfig')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * - * @return string The formatted organization_location_insight_type resource. - */ - public static function organizationLocationInsightTypeName(string $organization, string $location, string $insightType): string - { - return self::getPathTemplate('organizationLocationInsightType')->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type_config resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * - * @return string The formatted organization_location_insight_type_config resource. - */ - public static function organizationLocationInsightTypeConfigName(string $organization, string $location, string $insightType): string - { - return self::getPathTemplate('organizationLocationInsightTypeConfig')->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type_insight resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted organization_location_insight_type_insight resource. - */ - public static function organizationLocationInsightTypeInsightName(string $organization, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('organizationLocationInsightTypeInsight')->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * - * @return string The formatted organization_location_recommender resource. - */ - public static function organizationLocationRecommenderName(string $organization, string $location, string $recommender): string - { - return self::getPathTemplate('organizationLocationRecommender')->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender_config resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * - * @return string The formatted organization_location_recommender_config resource. - */ - public static function organizationLocationRecommenderConfigName(string $organization, string $location, string $recommender): string - { - return self::getPathTemplate('organizationLocationRecommenderConfig')->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender_recommendation resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted organization_location_recommender_recommendation resource. - */ - public static function organizationLocationRecommenderRecommendationName(string $organization, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('organizationLocationRecommenderRecommendation')->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted project_location_insight_type resource. - */ - public static function projectLocationInsightTypeName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('projectLocationInsightType')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type_config resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted project_location_insight_type_config resource. - */ - public static function projectLocationInsightTypeConfigName(string $project, string $location, string $insightType): string - { - return self::getPathTemplate('projectLocationInsightTypeConfig')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type_insight resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted project_location_insight_type_insight resource. - */ - public static function projectLocationInsightTypeInsightName(string $project, string $location, string $insightType, string $insight): string - { - return self::getPathTemplate('projectLocationInsightTypeInsight')->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted project_location_recommender resource. - */ - public static function projectLocationRecommenderName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('projectLocationRecommender')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender_config resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted project_location_recommender_config resource. - */ - public static function projectLocationRecommenderConfigName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('projectLocationRecommenderConfig')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender_recommendation resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted project_location_recommender_recommendation resource. - */ - public static function projectLocationRecommenderRecommendationName(string $project, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('projectLocationRecommenderRecommendation')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * recommendation resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted recommendation resource. - */ - public static function recommendationName(string $project, string $location, string $recommender, string $recommendation): string - { - return self::getPathTemplate('recommendation')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a recommender - * resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted recommender resource. - */ - public static function recommenderName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('recommender')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * recommender_config resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted recommender_config resource. - */ - public static function recommenderConfigName(string $project, string $location, string $recommender): string - { - return self::getPathTemplate('recommenderConfig')->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - billingAccountLocationInsightType: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type} - * - billingAccountLocationInsightTypeConfig: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config - * - billingAccountLocationInsightTypeInsight: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - billingAccountLocationRecommender: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender} - * - billingAccountLocationRecommenderConfig: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config - * - billingAccountLocationRecommenderRecommendation: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - folderLocationInsightType: folders/{folder}/locations/{location}/insightTypes/{insight_type} - * - folderLocationInsightTypeInsight: folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - folderLocationRecommender: folders/{folder}/locations/{location}/recommenders/{recommender} - * - folderLocationRecommenderRecommendation: folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - insight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - insightType: projects/{project}/locations/{location}/insightTypes/{insight_type} - * - insightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config - * - organizationLocationInsightType: organizations/{organization}/locations/{location}/insightTypes/{insight_type} - * - organizationLocationInsightTypeConfig: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config - * - organizationLocationInsightTypeInsight: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - organizationLocationRecommender: organizations/{organization}/locations/{location}/recommenders/{recommender} - * - organizationLocationRecommenderConfig: organizations/{organization}/locations/{location}/recommenders/{recommender}/config - * - organizationLocationRecommenderRecommendation: organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - projectLocationInsightType: projects/{project}/locations/{location}/insightTypes/{insight_type} - * - projectLocationInsightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config - * - projectLocationInsightTypeInsight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - projectLocationRecommender: projects/{project}/locations/{location}/recommenders/{recommender} - * - projectLocationRecommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config - * - projectLocationRecommenderRecommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - recommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - recommender: projects/{project}/locations/{location}/recommenders/{recommender} - * - recommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recommender.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** 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); - } - - /** - * Gets the requested insight. Requires the recommender.*.get IAM permission - * for the specified insight type. - * - * The async variant is {@see RecommenderClient::getInsightAsync()} . - * - * @param GetInsightRequest $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 Insight - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInsight(GetInsightRequest $request, array $callOptions = []): Insight - { - return $this->startApiCall('GetInsight', $request, $callOptions)->wait(); - } - - /** - * Gets the requested InsightTypeConfig. There is only one instance of the - * config for each InsightType. - * - * The async variant is {@see RecommenderClient::getInsightTypeConfigAsync()} . - * - * @param GetInsightTypeConfigRequest $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 InsightTypeConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInsightTypeConfig(GetInsightTypeConfigRequest $request, array $callOptions = []): InsightTypeConfig - { - return $this->startApiCall('GetInsightTypeConfig', $request, $callOptions)->wait(); - } - - /** - * Gets the requested recommendation. Requires the recommender.*.get - * IAM permission for the specified recommender. - * - * The async variant is {@see RecommenderClient::getRecommendationAsync()} . - * - * @param GetRecommendationRequest $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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getRecommendation(GetRecommendationRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('GetRecommendation', $request, $callOptions)->wait(); - } - - /** - * Gets the requested Recommender Config. There is only one instance of the - * config for each Recommender. - * - * The async variant is {@see RecommenderClient::getRecommenderConfigAsync()} . - * - * @param GetRecommenderConfigRequest $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 RecommenderConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getRecommenderConfig(GetRecommenderConfigRequest $request, array $callOptions = []): RecommenderConfig - { - return $this->startApiCall('GetRecommenderConfig', $request, $callOptions)->wait(); - } - - /** - * Lists insights for the specified Cloud Resource. Requires the - * recommender.*.list IAM permission for the specified insight type. - * - * The async variant is {@see RecommenderClient::listInsightsAsync()} . - * - * @param ListInsightsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listInsights(ListInsightsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListInsights', $request, $callOptions); - } - - /** - * Lists recommendations for the specified Cloud Resource. Requires the - * recommender.*.list IAM permission for the specified recommender. - * - * The async variant is {@see RecommenderClient::listRecommendationsAsync()} . - * - * @param ListRecommendationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listRecommendations(ListRecommendationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListRecommendations', $request, $callOptions); - } - - /** - * Marks the Insight State as Accepted. Users can use this method to - * indicate to the Recommender API that they have applied some action based - * on the insight. This stops the insight content from being updated. - * - * MarkInsightAccepted can be applied to insights in ACTIVE state. Requires - * the recommender.*.update IAM permission for the specified insight. - * - * The async variant is {@see RecommenderClient::markInsightAcceptedAsync()} . - * - * @param MarkInsightAcceptedRequest $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 Insight - * - * @throws ApiException Thrown if the API call fails. - */ - public function markInsightAccepted(MarkInsightAcceptedRequest $request, array $callOptions = []): Insight - { - return $this->startApiCall('MarkInsightAccepted', $request, $callOptions)->wait(); - } - - /** - * Marks the Recommendation State as Claimed. Users can use this method to - * indicate to the Recommender API that they are starting to apply the - * recommendation themselves. This stops the recommendation content from being - * updated. Associated insights are frozen and placed in the ACCEPTED state. - * - * MarkRecommendationClaimed can be applied to recommendations in CLAIMED, - * SUCCEEDED, FAILED, or ACTIVE state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is {@see RecommenderClient::markRecommendationClaimedAsync()} - * . - * - * @param MarkRecommendationClaimedRequest $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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationClaimed(MarkRecommendationClaimedRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationClaimed', $request, $callOptions)->wait(); - } - - /** - * Mark the Recommendation State as Dismissed. Users can use this method to - * indicate to the Recommender API that an ACTIVE recommendation has to - * be marked back as DISMISSED. - * - * MarkRecommendationDismissed can be applied to recommendations in ACTIVE - * state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is - * {@see RecommenderClient::markRecommendationDismissedAsync()} . - * - * @param MarkRecommendationDismissedRequest $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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationDismissed(MarkRecommendationDismissedRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationDismissed', $request, $callOptions)->wait(); - } - - /** - * Marks the Recommendation State as Failed. Users can use this method to - * indicate to the Recommender API that they have applied the recommendation - * themselves, and the operation failed. This stops the recommendation content - * from being updated. Associated insights are frozen and placed in the - * ACCEPTED state. - * - * MarkRecommendationFailed can be applied to recommendations in ACTIVE, - * CLAIMED, SUCCEEDED, or FAILED state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is {@see RecommenderClient::markRecommendationFailedAsync()} . - * - * @param MarkRecommendationFailedRequest $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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationFailed(MarkRecommendationFailedRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationFailed', $request, $callOptions)->wait(); - } - - /** - * Marks the Recommendation State as Succeeded. Users can use this method to - * indicate to the Recommender API that they have applied the recommendation - * themselves, and the operation was successful. This stops the recommendation - * content from being updated. Associated insights are frozen and placed in - * the ACCEPTED state. - * - * MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, - * CLAIMED, SUCCEEDED, or FAILED state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * The async variant is - * {@see RecommenderClient::markRecommendationSucceededAsync()} . - * - * @param MarkRecommendationSucceededRequest $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 Recommendation - * - * @throws ApiException Thrown if the API call fails. - */ - public function markRecommendationSucceeded(MarkRecommendationSucceededRequest $request, array $callOptions = []): Recommendation - { - return $this->startApiCall('MarkRecommendationSucceeded', $request, $callOptions)->wait(); - } - - /** - * Updates an InsightTypeConfig change. This will create a new revision of the - * config. - * - * The async variant is {@see RecommenderClient::updateInsightTypeConfigAsync()} . - * - * @param UpdateInsightTypeConfigRequest $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 InsightTypeConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateInsightTypeConfig(UpdateInsightTypeConfigRequest $request, array $callOptions = []): InsightTypeConfig - { - return $this->startApiCall('UpdateInsightTypeConfig', $request, $callOptions)->wait(); - } - - /** - * Updates a Recommender Config. This will create a new revision of the - * config. - * - * The async variant is {@see RecommenderClient::updateRecommenderConfigAsync()} . - * - * @param UpdateRecommenderConfigRequest $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 RecommenderConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateRecommenderConfig(UpdateRecommenderConfigRequest $request, array $callOptions = []): RecommenderConfig - { - return $this->startApiCall('UpdateRecommenderConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Recommender/v1/src/V1/Gapic/RecommenderGapicClient.php b/owl-bot-staging/Recommender/v1/src/V1/Gapic/RecommenderGapicClient.php deleted file mode 100644 index 59c6daf9f6dc..000000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/Gapic/RecommenderGapicClient.php +++ /dev/null @@ -1,1962 +0,0 @@ -insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - * $response = $recommenderClient->getInsight($formattedName); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Recommender\V1\Client\RecommenderClient} to use the new surface. - */ -class RecommenderGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.recommender.v1.Recommender'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'recommender.googleapis.com'; - - /** 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 $billingAccountLocationInsightTypeNameTemplate; - - private static $billingAccountLocationInsightTypeConfigNameTemplate; - - private static $billingAccountLocationInsightTypeInsightNameTemplate; - - private static $billingAccountLocationRecommenderNameTemplate; - - private static $billingAccountLocationRecommenderConfigNameTemplate; - - private static $billingAccountLocationRecommenderRecommendationNameTemplate; - - private static $folderLocationInsightTypeNameTemplate; - - private static $folderLocationInsightTypeInsightNameTemplate; - - private static $folderLocationRecommenderNameTemplate; - - private static $folderLocationRecommenderRecommendationNameTemplate; - - private static $insightNameTemplate; - - private static $insightTypeNameTemplate; - - private static $insightTypeConfigNameTemplate; - - private static $organizationLocationInsightTypeNameTemplate; - - private static $organizationLocationInsightTypeConfigNameTemplate; - - private static $organizationLocationInsightTypeInsightNameTemplate; - - private static $organizationLocationRecommenderNameTemplate; - - private static $organizationLocationRecommenderConfigNameTemplate; - - private static $organizationLocationRecommenderRecommendationNameTemplate; - - private static $projectLocationInsightTypeNameTemplate; - - private static $projectLocationInsightTypeConfigNameTemplate; - - private static $projectLocationInsightTypeInsightNameTemplate; - - private static $projectLocationRecommenderNameTemplate; - - private static $projectLocationRecommenderConfigNameTemplate; - - private static $projectLocationRecommenderRecommendationNameTemplate; - - private static $recommendationNameTemplate; - - private static $recommenderNameTemplate; - - private static $recommenderConfigNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/recommender_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/recommender_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/recommender_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/recommender_rest_client_config.php', - ], - ], - ]; - } - - private static function getBillingAccountLocationInsightTypeNameTemplate() - { - if (self::$billingAccountLocationInsightTypeNameTemplate == null) { - self::$billingAccountLocationInsightTypeNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}'); - } - - return self::$billingAccountLocationInsightTypeNameTemplate; - } - - private static function getBillingAccountLocationInsightTypeConfigNameTemplate() - { - if (self::$billingAccountLocationInsightTypeConfigNameTemplate == null) { - self::$billingAccountLocationInsightTypeConfigNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config'); - } - - return self::$billingAccountLocationInsightTypeConfigNameTemplate; - } - - private static function getBillingAccountLocationInsightTypeInsightNameTemplate() - { - if (self::$billingAccountLocationInsightTypeInsightNameTemplate == null) { - self::$billingAccountLocationInsightTypeInsightNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}'); - } - - return self::$billingAccountLocationInsightTypeInsightNameTemplate; - } - - private static function getBillingAccountLocationRecommenderNameTemplate() - { - if (self::$billingAccountLocationRecommenderNameTemplate == null) { - self::$billingAccountLocationRecommenderNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}'); - } - - return self::$billingAccountLocationRecommenderNameTemplate; - } - - private static function getBillingAccountLocationRecommenderConfigNameTemplate() - { - if (self::$billingAccountLocationRecommenderConfigNameTemplate == null) { - self::$billingAccountLocationRecommenderConfigNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config'); - } - - return self::$billingAccountLocationRecommenderConfigNameTemplate; - } - - private static function getBillingAccountLocationRecommenderRecommendationNameTemplate() - { - if (self::$billingAccountLocationRecommenderRecommendationNameTemplate == null) { - self::$billingAccountLocationRecommenderRecommendationNameTemplate = new PathTemplate('billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}'); - } - - return self::$billingAccountLocationRecommenderRecommendationNameTemplate; - } - - private static function getFolderLocationInsightTypeNameTemplate() - { - if (self::$folderLocationInsightTypeNameTemplate == null) { - self::$folderLocationInsightTypeNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/insightTypes/{insight_type}'); - } - - return self::$folderLocationInsightTypeNameTemplate; - } - - private static function getFolderLocationInsightTypeInsightNameTemplate() - { - if (self::$folderLocationInsightTypeInsightNameTemplate == null) { - self::$folderLocationInsightTypeInsightNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}'); - } - - return self::$folderLocationInsightTypeInsightNameTemplate; - } - - private static function getFolderLocationRecommenderNameTemplate() - { - if (self::$folderLocationRecommenderNameTemplate == null) { - self::$folderLocationRecommenderNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/recommenders/{recommender}'); - } - - return self::$folderLocationRecommenderNameTemplate; - } - - private static function getFolderLocationRecommenderRecommendationNameTemplate() - { - if (self::$folderLocationRecommenderRecommendationNameTemplate == null) { - self::$folderLocationRecommenderRecommendationNameTemplate = new PathTemplate('folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}'); - } - - return self::$folderLocationRecommenderRecommendationNameTemplate; - } - - private static function getInsightNameTemplate() - { - if (self::$insightNameTemplate == null) { - self::$insightNameTemplate = new PathTemplate('projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}'); - } - - return self::$insightNameTemplate; - } - - private static function getInsightTypeNameTemplate() - { - if (self::$insightTypeNameTemplate == null) { - self::$insightTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/insightTypes/{insight_type}'); - } - - return self::$insightTypeNameTemplate; - } - - private static function getInsightTypeConfigNameTemplate() - { - if (self::$insightTypeConfigNameTemplate == null) { - self::$insightTypeConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/insightTypes/{insight_type}/config'); - } - - return self::$insightTypeConfigNameTemplate; - } - - private static function getOrganizationLocationInsightTypeNameTemplate() - { - if (self::$organizationLocationInsightTypeNameTemplate == null) { - self::$organizationLocationInsightTypeNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/insightTypes/{insight_type}'); - } - - return self::$organizationLocationInsightTypeNameTemplate; - } - - private static function getOrganizationLocationInsightTypeConfigNameTemplate() - { - if (self::$organizationLocationInsightTypeConfigNameTemplate == null) { - self::$organizationLocationInsightTypeConfigNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config'); - } - - return self::$organizationLocationInsightTypeConfigNameTemplate; - } - - private static function getOrganizationLocationInsightTypeInsightNameTemplate() - { - if (self::$organizationLocationInsightTypeInsightNameTemplate == null) { - self::$organizationLocationInsightTypeInsightNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}'); - } - - return self::$organizationLocationInsightTypeInsightNameTemplate; - } - - private static function getOrganizationLocationRecommenderNameTemplate() - { - if (self::$organizationLocationRecommenderNameTemplate == null) { - self::$organizationLocationRecommenderNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/recommenders/{recommender}'); - } - - return self::$organizationLocationRecommenderNameTemplate; - } - - private static function getOrganizationLocationRecommenderConfigNameTemplate() - { - if (self::$organizationLocationRecommenderConfigNameTemplate == null) { - self::$organizationLocationRecommenderConfigNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/recommenders/{recommender}/config'); - } - - return self::$organizationLocationRecommenderConfigNameTemplate; - } - - private static function getOrganizationLocationRecommenderRecommendationNameTemplate() - { - if (self::$organizationLocationRecommenderRecommendationNameTemplate == null) { - self::$organizationLocationRecommenderRecommendationNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}'); - } - - return self::$organizationLocationRecommenderRecommendationNameTemplate; - } - - private static function getProjectLocationInsightTypeNameTemplate() - { - if (self::$projectLocationInsightTypeNameTemplate == null) { - self::$projectLocationInsightTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/insightTypes/{insight_type}'); - } - - return self::$projectLocationInsightTypeNameTemplate; - } - - private static function getProjectLocationInsightTypeConfigNameTemplate() - { - if (self::$projectLocationInsightTypeConfigNameTemplate == null) { - self::$projectLocationInsightTypeConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/insightTypes/{insight_type}/config'); - } - - return self::$projectLocationInsightTypeConfigNameTemplate; - } - - private static function getProjectLocationInsightTypeInsightNameTemplate() - { - if (self::$projectLocationInsightTypeInsightNameTemplate == null) { - self::$projectLocationInsightTypeInsightNameTemplate = new PathTemplate('projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}'); - } - - return self::$projectLocationInsightTypeInsightNameTemplate; - } - - private static function getProjectLocationRecommenderNameTemplate() - { - if (self::$projectLocationRecommenderNameTemplate == null) { - self::$projectLocationRecommenderNameTemplate = new PathTemplate('projects/{project}/locations/{location}/recommenders/{recommender}'); - } - - return self::$projectLocationRecommenderNameTemplate; - } - - private static function getProjectLocationRecommenderConfigNameTemplate() - { - if (self::$projectLocationRecommenderConfigNameTemplate == null) { - self::$projectLocationRecommenderConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/recommenders/{recommender}/config'); - } - - return self::$projectLocationRecommenderConfigNameTemplate; - } - - private static function getProjectLocationRecommenderRecommendationNameTemplate() - { - if (self::$projectLocationRecommenderRecommendationNameTemplate == null) { - self::$projectLocationRecommenderRecommendationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}'); - } - - return self::$projectLocationRecommenderRecommendationNameTemplate; - } - - private static function getRecommendationNameTemplate() - { - if (self::$recommendationNameTemplate == null) { - self::$recommendationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}'); - } - - return self::$recommendationNameTemplate; - } - - private static function getRecommenderNameTemplate() - { - if (self::$recommenderNameTemplate == null) { - self::$recommenderNameTemplate = new PathTemplate('projects/{project}/locations/{location}/recommenders/{recommender}'); - } - - return self::$recommenderNameTemplate; - } - - private static function getRecommenderConfigNameTemplate() - { - if (self::$recommenderConfigNameTemplate == null) { - self::$recommenderConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/recommenders/{recommender}/config'); - } - - return self::$recommenderConfigNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'billingAccountLocationInsightType' => self::getBillingAccountLocationInsightTypeNameTemplate(), - 'billingAccountLocationInsightTypeConfig' => self::getBillingAccountLocationInsightTypeConfigNameTemplate(), - 'billingAccountLocationInsightTypeInsight' => self::getBillingAccountLocationInsightTypeInsightNameTemplate(), - 'billingAccountLocationRecommender' => self::getBillingAccountLocationRecommenderNameTemplate(), - 'billingAccountLocationRecommenderConfig' => self::getBillingAccountLocationRecommenderConfigNameTemplate(), - 'billingAccountLocationRecommenderRecommendation' => self::getBillingAccountLocationRecommenderRecommendationNameTemplate(), - 'folderLocationInsightType' => self::getFolderLocationInsightTypeNameTemplate(), - 'folderLocationInsightTypeInsight' => self::getFolderLocationInsightTypeInsightNameTemplate(), - 'folderLocationRecommender' => self::getFolderLocationRecommenderNameTemplate(), - 'folderLocationRecommenderRecommendation' => self::getFolderLocationRecommenderRecommendationNameTemplate(), - 'insight' => self::getInsightNameTemplate(), - 'insightType' => self::getInsightTypeNameTemplate(), - 'insightTypeConfig' => self::getInsightTypeConfigNameTemplate(), - 'organizationLocationInsightType' => self::getOrganizationLocationInsightTypeNameTemplate(), - 'organizationLocationInsightTypeConfig' => self::getOrganizationLocationInsightTypeConfigNameTemplate(), - 'organizationLocationInsightTypeInsight' => self::getOrganizationLocationInsightTypeInsightNameTemplate(), - 'organizationLocationRecommender' => self::getOrganizationLocationRecommenderNameTemplate(), - 'organizationLocationRecommenderConfig' => self::getOrganizationLocationRecommenderConfigNameTemplate(), - 'organizationLocationRecommenderRecommendation' => self::getOrganizationLocationRecommenderRecommendationNameTemplate(), - 'projectLocationInsightType' => self::getProjectLocationInsightTypeNameTemplate(), - 'projectLocationInsightTypeConfig' => self::getProjectLocationInsightTypeConfigNameTemplate(), - 'projectLocationInsightTypeInsight' => self::getProjectLocationInsightTypeInsightNameTemplate(), - 'projectLocationRecommender' => self::getProjectLocationRecommenderNameTemplate(), - 'projectLocationRecommenderConfig' => self::getProjectLocationRecommenderConfigNameTemplate(), - 'projectLocationRecommenderRecommendation' => self::getProjectLocationRecommenderRecommendationNameTemplate(), - 'recommendation' => self::getRecommendationNameTemplate(), - 'recommender' => self::getRecommenderNameTemplate(), - 'recommenderConfig' => self::getRecommenderConfigNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * - * @return string The formatted billing_account_location_insight_type resource. - */ - public static function billingAccountLocationInsightTypeName($billingAccount, $location, $insightType) - { - return self::getBillingAccountLocationInsightTypeNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type_config resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * - * @return string The formatted billing_account_location_insight_type_config resource. - */ - public static function billingAccountLocationInsightTypeConfigName($billingAccount, $location, $insightType) - { - return self::getBillingAccountLocationInsightTypeConfigNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_insight_type_insight resource. - * - * @param string $billingAccount - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted billing_account_location_insight_type_insight resource. - */ - public static function billingAccountLocationInsightTypeInsightName($billingAccount, $location, $insightType, $insight) - { - return self::getBillingAccountLocationInsightTypeInsightNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * - * @return string The formatted billing_account_location_recommender resource. - */ - public static function billingAccountLocationRecommenderName($billingAccount, $location, $recommender) - { - return self::getBillingAccountLocationRecommenderNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender_config resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * - * @return string The formatted billing_account_location_recommender_config resource. - */ - public static function billingAccountLocationRecommenderConfigName($billingAccount, $location, $recommender) - { - return self::getBillingAccountLocationRecommenderConfigNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * billing_account_location_recommender_recommendation resource. - * - * @param string $billingAccount - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted billing_account_location_recommender_recommendation resource. - */ - public static function billingAccountLocationRecommenderRecommendationName($billingAccount, $location, $recommender, $recommendation) - { - return self::getBillingAccountLocationRecommenderRecommendationNameTemplate()->render([ - 'billing_account' => $billingAccount, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_insight_type resource. - * - * @param string $folder - * @param string $location - * @param string $insightType - * - * @return string The formatted folder_location_insight_type resource. - */ - public static function folderLocationInsightTypeName($folder, $location, $insightType) - { - return self::getFolderLocationInsightTypeNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_insight_type_insight resource. - * - * @param string $folder - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted folder_location_insight_type_insight resource. - */ - public static function folderLocationInsightTypeInsightName($folder, $location, $insightType, $insight) - { - return self::getFolderLocationInsightTypeInsightNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_recommender resource. - * - * @param string $folder - * @param string $location - * @param string $recommender - * - * @return string The formatted folder_location_recommender resource. - */ - public static function folderLocationRecommenderName($folder, $location, $recommender) - { - return self::getFolderLocationRecommenderNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_location_recommender_recommendation resource. - * - * @param string $folder - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted folder_location_recommender_recommendation resource. - */ - public static function folderLocationRecommenderRecommendationName($folder, $location, $recommender, $recommendation) - { - return self::getFolderLocationRecommenderRecommendationNameTemplate()->render([ - 'folder' => $folder, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a insight - * resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted insight resource. - */ - public static function insightName($project, $location, $insightType, $insight) - { - return self::getInsightNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a insight_type - * resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted insight_type resource. - */ - public static function insightTypeName($project, $location, $insightType) - { - return self::getInsightTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * insight_type_config resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted insight_type_config resource. - */ - public static function insightTypeConfigName($project, $location, $insightType) - { - return self::getInsightTypeConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * - * @return string The formatted organization_location_insight_type resource. - */ - public static function organizationLocationInsightTypeName($organization, $location, $insightType) - { - return self::getOrganizationLocationInsightTypeNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type_config resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * - * @return string The formatted organization_location_insight_type_config resource. - */ - public static function organizationLocationInsightTypeConfigName($organization, $location, $insightType) - { - return self::getOrganizationLocationInsightTypeConfigNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_insight_type_insight resource. - * - * @param string $organization - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted organization_location_insight_type_insight resource. - */ - public static function organizationLocationInsightTypeInsightName($organization, $location, $insightType, $insight) - { - return self::getOrganizationLocationInsightTypeInsightNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * - * @return string The formatted organization_location_recommender resource. - */ - public static function organizationLocationRecommenderName($organization, $location, $recommender) - { - return self::getOrganizationLocationRecommenderNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender_config resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * - * @return string The formatted organization_location_recommender_config resource. - */ - public static function organizationLocationRecommenderConfigName($organization, $location, $recommender) - { - return self::getOrganizationLocationRecommenderConfigNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_location_recommender_recommendation resource. - * - * @param string $organization - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted organization_location_recommender_recommendation resource. - */ - public static function organizationLocationRecommenderRecommendationName($organization, $location, $recommender, $recommendation) - { - return self::getOrganizationLocationRecommenderRecommendationNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted project_location_insight_type resource. - */ - public static function projectLocationInsightTypeName($project, $location, $insightType) - { - return self::getProjectLocationInsightTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type_config resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * - * @return string The formatted project_location_insight_type_config resource. - */ - public static function projectLocationInsightTypeConfigName($project, $location, $insightType) - { - return self::getProjectLocationInsightTypeConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_insight_type_insight resource. - * - * @param string $project - * @param string $location - * @param string $insightType - * @param string $insight - * - * @return string The formatted project_location_insight_type_insight resource. - */ - public static function projectLocationInsightTypeInsightName($project, $location, $insightType, $insight) - { - return self::getProjectLocationInsightTypeInsightNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'insight_type' => $insightType, - 'insight' => $insight, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted project_location_recommender resource. - */ - public static function projectLocationRecommenderName($project, $location, $recommender) - { - return self::getProjectLocationRecommenderNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender_config resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted project_location_recommender_config resource. - */ - public static function projectLocationRecommenderConfigName($project, $location, $recommender) - { - return self::getProjectLocationRecommenderConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_recommender_recommendation resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted project_location_recommender_recommendation resource. - */ - public static function projectLocationRecommenderRecommendationName($project, $location, $recommender, $recommendation) - { - return self::getProjectLocationRecommenderRecommendationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * recommendation resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * @param string $recommendation - * - * @return string The formatted recommendation resource. - */ - public static function recommendationName($project, $location, $recommender, $recommendation) - { - return self::getRecommendationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - 'recommendation' => $recommendation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a recommender - * resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted recommender resource. - */ - public static function recommenderName($project, $location, $recommender) - { - return self::getRecommenderNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * recommender_config resource. - * - * @param string $project - * @param string $location - * @param string $recommender - * - * @return string The formatted recommender_config resource. - */ - public static function recommenderConfigName($project, $location, $recommender) - { - return self::getRecommenderConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'recommender' => $recommender, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - billingAccountLocationInsightType: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type} - * - billingAccountLocationInsightTypeConfig: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config - * - billingAccountLocationInsightTypeInsight: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - billingAccountLocationRecommender: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender} - * - billingAccountLocationRecommenderConfig: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config - * - billingAccountLocationRecommenderRecommendation: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - folderLocationInsightType: folders/{folder}/locations/{location}/insightTypes/{insight_type} - * - folderLocationInsightTypeInsight: folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - folderLocationRecommender: folders/{folder}/locations/{location}/recommenders/{recommender} - * - folderLocationRecommenderRecommendation: folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - insight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - insightType: projects/{project}/locations/{location}/insightTypes/{insight_type} - * - insightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config - * - organizationLocationInsightType: organizations/{organization}/locations/{location}/insightTypes/{insight_type} - * - organizationLocationInsightTypeConfig: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config - * - organizationLocationInsightTypeInsight: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - organizationLocationRecommender: organizations/{organization}/locations/{location}/recommenders/{recommender} - * - organizationLocationRecommenderConfig: organizations/{organization}/locations/{location}/recommenders/{recommender}/config - * - organizationLocationRecommenderRecommendation: organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - projectLocationInsightType: projects/{project}/locations/{location}/insightTypes/{insight_type} - * - projectLocationInsightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config - * - projectLocationInsightTypeInsight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight} - * - projectLocationRecommender: projects/{project}/locations/{location}/recommenders/{recommender} - * - projectLocationRecommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config - * - projectLocationRecommenderRecommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - recommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation} - * - recommender: projects/{project}/locations/{location}/recommenders/{recommender} - * - recommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 'recommender.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Gets the requested insight. Requires the recommender.*.get IAM permission - * for the specified insight type. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - * $response = $recommenderClient->getInsight($formattedName); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the insight. - * @param array $optionalArgs { - * 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 \Google\Cloud\Recommender\V1\Insight - * - * @throws ApiException if the remote call fails - */ - public function getInsight($name, array $optionalArgs = []) - { - $request = new GetInsightRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInsight', Insight::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the requested InsightTypeConfig. There is only one instance of the - * config for each InsightType. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - * $response = $recommenderClient->getInsightTypeConfig($formattedName); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the InsightTypeConfig to get. - * - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - * @param array $optionalArgs { - * 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 \Google\Cloud\Recommender\V1\InsightTypeConfig - * - * @throws ApiException if the remote call fails - */ - public function getInsightTypeConfig($name, array $optionalArgs = []) - { - $request = new GetInsightTypeConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInsightTypeConfig', InsightTypeConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the requested recommendation. Requires the recommender.*.get - * IAM permission for the specified recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - * $response = $recommenderClient->getRecommendation($formattedName); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the recommendation. - * @param array $optionalArgs { - * 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 \Google\Cloud\Recommender\V1\Recommendation - * - * @throws ApiException if the remote call fails - */ - public function getRecommendation($name, array $optionalArgs = []) - { - $request = new GetRecommendationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetRecommendation', Recommendation::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the requested Recommender Config. There is only one instance of the - * config for each Recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - * $response = $recommenderClient->getRecommenderConfig($formattedName); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the Recommendation Config to get. - * - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - * @param array $optionalArgs { - * 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 \Google\Cloud\Recommender\V1\RecommenderConfig - * - * @throws ApiException if the remote call fails - */ - public function getRecommenderConfig($name, array $optionalArgs = []) - { - $request = new GetRecommenderConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetRecommenderConfig', RecommenderConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists insights for the specified Cloud Resource. Requires the - * recommender.*.list IAM permission for the specified insight type. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedParent = $recommenderClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - * // Iterate over pages of elements - * $pagedResponse = $recommenderClient->listInsights($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recommenderClient->listInsights($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * INSIGHT_TYPE_ID refers to supported insight types: - * https://cloud.google.com/recommender/docs/insights/insight-types. - * @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 string $filter - * Optional. Filter expression to restrict the insights returned. Supported - * filter fields: - * - * * `stateInfo.state` - * - * * `insightSubtype` - * - * * `severity` - * - * * `targetResources` - * - * Examples: - * - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * - * * `insightSubtype = PERMISSIONS_USAGE` - * - * * `severity = CRITICAL OR severity = HIGH` - * - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * - * * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - * - * The max allowed filter length is 500 characters. - * - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * @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 - */ - public function listInsights($parent, array $optionalArgs = []) - { - $request = new ListInsightsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListInsights', $optionalArgs, ListInsightsResponse::class, $request); - } - - /** - * Lists recommendations for the specified Cloud Resource. Requires the - * recommender.*.list IAM permission for the specified recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedParent = $recommenderClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - * // Iterate over pages of elements - * $pagedResponse = $recommenderClient->listRecommendations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $recommenderClient->listRecommendations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $parent Required. The container resource on which to execute the request. - * Acceptable formats: - * - * * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - * - * LOCATION here refers to GCP Locations: - * https://cloud.google.com/about/locations/ - * RECOMMENDER_ID refers to supported recommenders: - * https://cloud.google.com/recommender/docs/recommenders. - * @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 string $filter - * Filter expression to restrict the recommendations returned. Supported - * filter fields: - * - * * `state_info.state` - * - * * `recommenderSubtype` - * - * * `priority` - * - * * `targetResources` - * - * Examples: - * - * * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - * - * * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - * - * * `priority = P1 OR priority = P2` - * - * * `targetResources : - * //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - * - * * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - * - * The max allowed filter length is 500 characters. - * - * (These expressions are based on the filter language described at - * https://google.aip.dev/160) - * @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 - */ - public function listRecommendations($parent, array $optionalArgs = []) - { - $request = new ListRecommendationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListRecommendations', $optionalArgs, ListRecommendationsResponse::class, $request); - } - - /** - * Marks the Insight State as Accepted. Users can use this method to - * indicate to the Recommender API that they have applied some action based - * on the insight. This stops the insight content from being updated. - * - * MarkInsightAccepted can be applied to insights in ACTIVE state. Requires - * the recommender.*.update IAM permission for the specified insight. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - * $etag = 'etag'; - * $response = $recommenderClient->markInsightAccepted($formattedName, $etag); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the insight. - * @param string $etag Required. Fingerprint of the Insight. Provides optimistic locking. - * @param array $optionalArgs { - * Optional. - * - * @type array $stateMetadata - * Optional. State properties user wish to include with this state. Full - * replace of the current state_metadata. - * @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\Cloud\Recommender\V1\Insight - * - * @throws ApiException if the remote call fails - */ - public function markInsightAccepted($name, $etag, array $optionalArgs = []) - { - $request = new MarkInsightAcceptedRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEtag($etag); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['stateMetadata'])) { - $request->setStateMetadata($optionalArgs['stateMetadata']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MarkInsightAccepted', Insight::class, $optionalArgs, $request)->wait(); - } - - /** - * Marks the Recommendation State as Claimed. Users can use this method to - * indicate to the Recommender API that they are starting to apply the - * recommendation themselves. This stops the recommendation content from being - * updated. Associated insights are frozen and placed in the ACCEPTED state. - * - * MarkRecommendationClaimed can be applied to recommendations in CLAIMED, - * SUCCEEDED, FAILED, or ACTIVE state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - * $etag = 'etag'; - * $response = $recommenderClient->markRecommendationClaimed($formattedName, $etag); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the recommendation. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * @param array $optionalArgs { - * Optional. - * - * @type array $stateMetadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @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\Cloud\Recommender\V1\Recommendation - * - * @throws ApiException if the remote call fails - */ - public function markRecommendationClaimed($name, $etag, array $optionalArgs = []) - { - $request = new MarkRecommendationClaimedRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEtag($etag); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['stateMetadata'])) { - $request->setStateMetadata($optionalArgs['stateMetadata']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MarkRecommendationClaimed', Recommendation::class, $optionalArgs, $request)->wait(); - } - - /** - * Mark the Recommendation State as Dismissed. Users can use this method to - * indicate to the Recommender API that an ACTIVE recommendation has to - * be marked back as DISMISSED. - * - * MarkRecommendationDismissed can be applied to recommendations in ACTIVE - * state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - * $response = $recommenderClient->markRecommendationDismissed($formattedName); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the recommendation. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Fingerprint of the Recommendation. Provides optimistic locking. - * @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\Cloud\Recommender\V1\Recommendation - * - * @throws ApiException if the remote call fails - */ - public function markRecommendationDismissed($name, array $optionalArgs = []) - { - $request = new MarkRecommendationDismissedRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MarkRecommendationDismissed', Recommendation::class, $optionalArgs, $request)->wait(); - } - - /** - * Marks the Recommendation State as Failed. Users can use this method to - * indicate to the Recommender API that they have applied the recommendation - * themselves, and the operation failed. This stops the recommendation content - * from being updated. Associated insights are frozen and placed in the - * ACCEPTED state. - * - * MarkRecommendationFailed can be applied to recommendations in ACTIVE, - * CLAIMED, SUCCEEDED, or FAILED state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - * $etag = 'etag'; - * $response = $recommenderClient->markRecommendationFailed($formattedName, $etag); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the recommendation. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * @param array $optionalArgs { - * Optional. - * - * @type array $stateMetadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @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\Cloud\Recommender\V1\Recommendation - * - * @throws ApiException if the remote call fails - */ - public function markRecommendationFailed($name, $etag, array $optionalArgs = []) - { - $request = new MarkRecommendationFailedRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEtag($etag); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['stateMetadata'])) { - $request->setStateMetadata($optionalArgs['stateMetadata']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MarkRecommendationFailed', Recommendation::class, $optionalArgs, $request)->wait(); - } - - /** - * Marks the Recommendation State as Succeeded. Users can use this method to - * indicate to the Recommender API that they have applied the recommendation - * themselves, and the operation was successful. This stops the recommendation - * content from being updated. Associated insights are frozen and placed in - * the ACCEPTED state. - * - * MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, - * CLAIMED, SUCCEEDED, or FAILED state. - * - * Requires the recommender.*.update IAM permission for the specified - * recommender. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $formattedName = $recommenderClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - * $etag = 'etag'; - * $response = $recommenderClient->markRecommendationSucceeded($formattedName, $etag); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the recommendation. - * @param string $etag Required. Fingerprint of the Recommendation. Provides optimistic locking. - * @param array $optionalArgs { - * Optional. - * - * @type array $stateMetadata - * State properties to include with this state. Overwrites any existing - * `state_metadata`. - * Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - * Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - * @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\Cloud\Recommender\V1\Recommendation - * - * @throws ApiException if the remote call fails - */ - public function markRecommendationSucceeded($name, $etag, array $optionalArgs = []) - { - $request = new MarkRecommendationSucceededRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setEtag($etag); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['stateMetadata'])) { - $request->setStateMetadata($optionalArgs['stateMetadata']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MarkRecommendationSucceeded', Recommendation::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an InsightTypeConfig change. This will create a new revision of the - * config. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $insightTypeConfig = new InsightTypeConfig(); - * $response = $recommenderClient->updateInsightTypeConfig($insightTypeConfig); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param InsightTypeConfig $insightTypeConfig Required. The InsightTypeConfig to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to be updated. - * @type bool $validateOnly - * If true, validate the request and preview the change, but do not actually - * update it. - * @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\Cloud\Recommender\V1\InsightTypeConfig - * - * @throws ApiException if the remote call fails - */ - public function updateInsightTypeConfig($insightTypeConfig, array $optionalArgs = []) - { - $request = new UpdateInsightTypeConfigRequest(); - $requestParamHeaders = []; - $request->setInsightTypeConfig($insightTypeConfig); - $requestParamHeaders['insight_type_config.name'] = $insightTypeConfig->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateInsightTypeConfig', InsightTypeConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a Recommender Config. This will create a new revision of the - * config. - * - * Sample code: - * ``` - * $recommenderClient = new RecommenderClient(); - * try { - * $recommenderConfig = new RecommenderConfig(); - * $response = $recommenderClient->updateRecommenderConfig($recommenderConfig); - * } finally { - * $recommenderClient->close(); - * } - * ``` - * - * @param RecommenderConfig $recommenderConfig Required. The RecommenderConfig to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to be updated. - * @type bool $validateOnly - * If true, validate the request and preview the change, but do not actually - * update it. - * @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\Cloud\Recommender\V1\RecommenderConfig - * - * @throws ApiException if the remote call fails - */ - public function updateRecommenderConfig($recommenderConfig, array $optionalArgs = []) - { - $request = new UpdateRecommenderConfigRequest(); - $requestParamHeaders = []; - $request->setRecommenderConfig($recommenderConfig); - $requestParamHeaders['recommender_config.name'] = $recommenderConfig->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateRecommenderConfig', RecommenderConfig::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Recommender/v1/src/V1/RecommenderClient.php b/owl-bot-staging/Recommender/v1/src/V1/RecommenderClient.php deleted file mode 100644 index 61d7d1f46db5..000000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/RecommenderClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.recommender.v1.Recommender' => [ - 'GetInsight' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Insight', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetInsightTypeConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\InsightTypeConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommendation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommenderConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\RecommenderConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListInsights' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInsights', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\ListInsightsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListRecommendations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRecommendations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\ListRecommendationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'MarkInsightAccepted' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Insight', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationClaimed' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationDismissed' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationFailed' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationSucceeded' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\Recommendation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInsightTypeConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\InsightTypeConfig', - 'headerParams' => [ - [ - 'keyName' => 'insight_type_config.name', - 'fieldAccessors' => [ - 'getInsightTypeConfig', - 'getName', - ], - ], - ], - ], - 'UpdateRecommenderConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Recommender\V1\RecommenderConfig', - 'headerParams' => [ - [ - 'keyName' => 'recommender_config.name', - 'fieldAccessors' => [ - 'getRecommenderConfig', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'billingAccountLocationInsightType' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}', - 'billingAccountLocationInsightTypeConfig' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config', - 'billingAccountLocationInsightTypeInsight' => 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'billingAccountLocationRecommender' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}', - 'billingAccountLocationRecommenderConfig' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config', - 'billingAccountLocationRecommenderRecommendation' => 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'folderLocationInsightType' => 'folders/{folder}/locations/{location}/insightTypes/{insight_type}', - 'folderLocationInsightTypeInsight' => 'folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'folderLocationRecommender' => 'folders/{folder}/locations/{location}/recommenders/{recommender}', - 'folderLocationRecommenderRecommendation' => 'folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'insight' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'insightType' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}', - 'insightTypeConfig' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/config', - 'organizationLocationInsightType' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}', - 'organizationLocationInsightTypeConfig' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config', - 'organizationLocationInsightTypeInsight' => 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'organizationLocationRecommender' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}', - 'organizationLocationRecommenderConfig' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}/config', - 'organizationLocationRecommenderRecommendation' => 'organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'projectLocationInsightType' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}', - 'projectLocationInsightTypeConfig' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/config', - 'projectLocationInsightTypeInsight' => 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}', - 'projectLocationRecommender' => 'projects/{project}/locations/{location}/recommenders/{recommender}', - 'projectLocationRecommenderConfig' => 'projects/{project}/locations/{location}/recommenders/{recommender}/config', - 'projectLocationRecommenderRecommendation' => 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'recommendation' => 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}', - 'recommender' => 'projects/{project}/locations/{location}/recommenders/{recommender}', - 'recommenderConfig' => 'projects/{project}/locations/{location}/recommenders/{recommender}/config', - ], - ], - ], -]; diff --git a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php b/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php deleted file mode 100644 index 99442217b5f0..000000000000 --- a/owl-bot-staging/Recommender/v1/src/V1/resources/recommender_rest_client_config.php +++ /dev/null @@ -1,346 +0,0 @@ - [ - 'google.cloud.recommender.v1.Recommender' => [ - 'GetInsight' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetInsightTypeConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/config}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/config}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommendation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRecommenderConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/config}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/config}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListInsights' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/insightTypes/*}/insights', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/insightTypes/*}/insights', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRecommendations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=folders/*/locations/*/recommenders/*}/recommendations', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MarkInsightAccepted' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationClaimed' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationDismissed' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationFailed' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MarkRecommendationSucceeded' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateInsightTypeConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}', - 'body' => 'insight_type_config', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}', - 'body' => 'insight_type_config', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}', - 'body' => 'insight_type_config', - ], - ], - 'placeholders' => [ - 'insight_type_config.name' => [ - 'getters' => [ - 'getInsightTypeConfig', - 'getName', - ], - ], - ], - ], - 'UpdateRecommenderConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}', - 'body' => 'recommender_config', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}', - 'body' => 'recommender_config', - ], - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}', - 'body' => 'recommender_config', - ], - ], - 'placeholders' => [ - 'recommender_config.name' => [ - 'getters' => [ - 'getRecommenderConfig', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php b/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php deleted file mode 100644 index c277a8ff0e36..000000000000 --- a/owl-bot-staging/Recommender/v1/tests/Unit/V1/Client/RecommenderClientTest.php +++ /dev/null @@ -1,1062 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RecommenderClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RecommenderClient($options); - } - - /** @test */ - public function getInsightTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag = 'etag3123477'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $request = (new GetInsightRequest()) - ->setName($formattedName); - $response = $gapicClient->getInsight($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInsightExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $request = (new GetInsightRequest()) - ->setName($formattedName); - try { - $gapicClient->getInsight($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 getInsightTypeConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new InsightTypeConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new GetInsightTypeConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getInsightTypeConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsightTypeConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInsightTypeConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new GetInsightTypeConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getInsightTypeConfig($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 getRecommendationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag = 'etag3123477'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new GetRecommendationRequest()) - ->setName($formattedName); - $response = $gapicClient->getRecommendation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommendation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRecommendationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new GetRecommendationRequest()) - ->setName($formattedName); - try { - $gapicClient->getRecommendation($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 getRecommenderConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new RecommenderConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new GetRecommenderConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getRecommenderConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommenderConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRecommenderConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new GetRecommenderConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getRecommenderConfig($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 listInsightsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $insightsElement = new Insight(); - $insights = [ - $insightsElement, - ]; - $expectedResponse = new ListInsightsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInsights($insights); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new ListInsightsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listInsights($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInsights()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/ListInsights', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInsightsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $request = (new ListInsightsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listInsights($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 listRecommendationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $recommendationsElement = new Recommendation(); - $recommendations = [ - $recommendationsElement, - ]; - $expectedResponse = new ListRecommendationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRecommendations($recommendations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new ListRecommendationsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listRecommendations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRecommendations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/ListRecommendations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRecommendationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $request = (new ListRecommendationsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listRecommendations($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 markInsightAcceptedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $etag = 'etag3123477'; - $request = (new MarkInsightAcceptedRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markInsightAccepted($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkInsightAccepted', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markInsightAcceptedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $etag = 'etag3123477'; - $request = (new MarkInsightAcceptedRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markInsightAccepted($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 markRecommendationClaimedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationClaimedRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markRecommendationClaimed($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationClaimed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationClaimedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationClaimedRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markRecommendationClaimed($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 markRecommendationDismissedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new MarkRecommendationDismissedRequest()) - ->setName($formattedName); - $response = $gapicClient->markRecommendationDismissed($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationDismissed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationDismissedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $request = (new MarkRecommendationDismissedRequest()) - ->setName($formattedName); - try { - $gapicClient->markRecommendationDismissed($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 markRecommendationFailedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationFailedRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markRecommendationFailed($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationFailed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationFailedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationFailedRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markRecommendationFailed($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 markRecommendationSucceededTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationSucceededRequest()) - ->setName($formattedName) - ->setEtag($etag); - $response = $gapicClient->markRecommendationSucceeded($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationSucceeded', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationSucceededExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $request = (new MarkRecommendationSucceededRequest()) - ->setName($formattedName) - ->setEtag($etag); - try { - $gapicClient->markRecommendationSucceeded($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 updateInsightTypeConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new InsightTypeConfig(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $insightTypeConfig = new InsightTypeConfig(); - $request = (new UpdateInsightTypeConfigRequest()) - ->setInsightTypeConfig($insightTypeConfig); - $response = $gapicClient->updateInsightTypeConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateInsightTypeConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getInsightTypeConfig(); - $this->assertProtobufEquals($insightTypeConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateInsightTypeConfigExceptionTest() - { - $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 - $insightTypeConfig = new InsightTypeConfig(); - $request = (new UpdateInsightTypeConfigRequest()) - ->setInsightTypeConfig($insightTypeConfig); - try { - $gapicClient->updateInsightTypeConfig($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 updateRecommenderConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new RecommenderConfig(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $recommenderConfig = new RecommenderConfig(); - $request = (new UpdateRecommenderConfigRequest()) - ->setRecommenderConfig($recommenderConfig); - $response = $gapicClient->updateRecommenderConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateRecommenderConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getRecommenderConfig(); - $this->assertProtobufEquals($recommenderConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRecommenderConfigExceptionTest() - { - $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 - $recommenderConfig = new RecommenderConfig(); - $request = (new UpdateRecommenderConfigRequest()) - ->setRecommenderConfig($recommenderConfig); - try { - $gapicClient->updateRecommenderConfig($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 getInsightAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag = 'etag3123477'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $request = (new GetInsightRequest()) - ->setName($formattedName); - $response = $gapicClient->getInsightAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Recommender/v1/tests/Unit/V1/RecommenderClientTest.php b/owl-bot-staging/Recommender/v1/tests/Unit/V1/RecommenderClientTest.php deleted file mode 100644 index e321889ef249..000000000000 --- a/owl-bot-staging/Recommender/v1/tests/Unit/V1/RecommenderClientTest.php +++ /dev/null @@ -1,954 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RecommenderClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RecommenderClient($options); - } - - /** @test */ - public function getInsightTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag = 'etag3123477'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $response = $gapicClient->getInsight($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsight', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInsightExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - try { - $gapicClient->getInsight($formattedName); - // 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 getInsightTypeConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new InsightTypeConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $response = $gapicClient->getInsightTypeConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetInsightTypeConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInsightTypeConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->insightTypeConfigName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - try { - $gapicClient->getInsightTypeConfig($formattedName); - // 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 getRecommendationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag = 'etag3123477'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $response = $gapicClient->getRecommendation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommendation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRecommendationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - try { - $gapicClient->getRecommendation($formattedName); - // 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 getRecommenderConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new RecommenderConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $response = $gapicClient->getRecommenderConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/GetRecommenderConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRecommenderConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommenderConfigName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - try { - $gapicClient->getRecommenderConfig($formattedName); - // 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 listInsightsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $insightsElement = new Insight(); - $insights = [ - $insightsElement, - ]; - $expectedResponse = new ListInsightsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInsights($insights); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - $response = $gapicClient->listInsights($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInsights()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/ListInsights', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInsightsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]'); - try { - $gapicClient->listInsights($formattedParent); - // 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 listRecommendationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $recommendationsElement = new Recommendation(); - $recommendations = [ - $recommendationsElement, - ]; - $expectedResponse = new ListRecommendationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRecommendations($recommendations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - $response = $gapicClient->listRecommendations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRecommendations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/ListRecommendations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRecommendationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]'); - try { - $gapicClient->listRecommendations($formattedParent); - // 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 markInsightAcceptedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $insightSubtype = 'insightSubtype-1491142701'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Insight(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setInsightSubtype($insightSubtype); - $expectedResponse->setEtag($etag2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $etag = 'etag3123477'; - $response = $gapicClient->markInsightAccepted($formattedName, $etag); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkInsightAccepted', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markInsightAcceptedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->insightName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]', '[INSIGHT]'); - $etag = 'etag3123477'; - try { - $gapicClient->markInsightAccepted($formattedName, $etag); - // 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 markRecommendationClaimedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $response = $gapicClient->markRecommendationClaimed($formattedName, $etag); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationClaimed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationClaimedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - try { - $gapicClient->markRecommendationClaimed($formattedName, $etag); - // 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 markRecommendationDismissedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $response = $gapicClient->markRecommendationDismissed($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationDismissed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationDismissedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - try { - $gapicClient->markRecommendationDismissed($formattedName); - // 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 markRecommendationFailedTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $response = $gapicClient->markRecommendationFailed($formattedName, $etag); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationFailed', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationFailedExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - try { - $gapicClient->markRecommendationFailed($formattedName, $etag); - // 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 markRecommendationSucceededTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $recommenderSubtype = 'recommenderSubtype-1488504412'; - $etag2 = 'etag2-1293302904'; - $xorGroupId = 'xorGroupId381095487'; - $expectedResponse = new Recommendation(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRecommenderSubtype($recommenderSubtype); - $expectedResponse->setEtag($etag2); - $expectedResponse->setXorGroupId($xorGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - $response = $gapicClient->markRecommendationSucceeded($formattedName, $etag); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/MarkRecommendationSucceeded', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getEtag(); - $this->assertProtobufEquals($etag, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function markRecommendationSucceededExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->recommendationName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]', '[RECOMMENDATION]'); - $etag = 'etag3123477'; - try { - $gapicClient->markRecommendationSucceeded($formattedName, $etag); - // 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 updateInsightTypeConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new InsightTypeConfig(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $insightTypeConfig = new InsightTypeConfig(); - $response = $gapicClient->updateInsightTypeConfig($insightTypeConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateInsightTypeConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getInsightTypeConfig(); - $this->assertProtobufEquals($insightTypeConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateInsightTypeConfigExceptionTest() - { - $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 - $insightTypeConfig = new InsightTypeConfig(); - try { - $gapicClient->updateInsightTypeConfig($insightTypeConfig); - // 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 updateRecommenderConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $revisionId = 'revisionId513861631'; - $displayName = 'displayName1615086568'; - $expectedResponse = new RecommenderConfig(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $recommenderConfig = new RecommenderConfig(); - $response = $gapicClient->updateRecommenderConfig($recommenderConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommender.v1.Recommender/UpdateRecommenderConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getRecommenderConfig(); - $this->assertProtobufEquals($recommenderConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRecommenderConfigExceptionTest() - { - $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 - $recommenderConfig = new RecommenderConfig(); - try { - $gapicClient->updateRecommenderConfig($recommenderConfig); - // 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()); - } -}