[e3d4e0a] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Copyright 2014 Google Inc.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
| 6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at
|
---|
| 8 | *
|
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | *
|
---|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
| 14 | * License for the specific language governing permissions and limitations under
|
---|
| 15 | * the License.
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | namespace Google\Service\Recommender\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Recommender\GoogleCloudRecommenderV1ListRecommendationsResponse;
|
---|
| 21 | use Google\Service\Recommender\GoogleCloudRecommenderV1MarkRecommendationClaimedRequest;
|
---|
| 22 | use Google\Service\Recommender\GoogleCloudRecommenderV1MarkRecommendationDismissedRequest;
|
---|
| 23 | use Google\Service\Recommender\GoogleCloudRecommenderV1MarkRecommendationFailedRequest;
|
---|
| 24 | use Google\Service\Recommender\GoogleCloudRecommenderV1MarkRecommendationSucceededRequest;
|
---|
| 25 | use Google\Service\Recommender\GoogleCloudRecommenderV1Recommendation;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "recommendations" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $recommenderService = new Google\Service\Recommender(...);
|
---|
| 32 | * $recommendations = $recommenderService->organizations_locations_recommenders_recommendations;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class OrganizationsLocationsRecommendersRecommendations extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Gets the requested recommendation. Requires the recommender.*.get IAM
|
---|
| 39 | * permission for the specified recommender. (recommendations.get)
|
---|
| 40 | *
|
---|
| 41 | * @param string $name Required. Name of the recommendation.
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return GoogleCloudRecommenderV1Recommendation
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function get($name, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['name' => $name];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('get', [$params], GoogleCloudRecommenderV1Recommendation::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Lists recommendations for the specified Cloud Resource. Requires the
|
---|
| 54 | * recommender.*.list IAM permission for the specified recommender.
|
---|
| 55 | * (recommendations.listOrganizationsLocationsRecommendersRecommendations)
|
---|
| 56 | *
|
---|
| 57 | * @param string $parent Required. The container resource on which to execute
|
---|
| 58 | * the request. Acceptable formats: * `projects/[PROJECT_NUMBER]/locations/[LOCA
|
---|
| 59 | * TION]/recommenders/[RECOMMENDER_ID]` *
|
---|
| 60 | * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` *
|
---|
| 61 | * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECO
|
---|
| 62 | * MMENDER_ID]` *
|
---|
| 63 | * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` * `o
|
---|
| 64 | * rganizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER
|
---|
| 65 | * _ID]` LOCATION here refers to GCP Locations:
|
---|
| 66 | * https://cloud.google.com/about/locations/ RECOMMENDER_ID refers to supported
|
---|
| 67 | * recommenders: https://cloud.google.com/recommender/docs/recommenders.
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | *
|
---|
| 70 | * @opt_param string filter Filter expression to restrict the recommendations
|
---|
| 71 | * returned. Supported filter fields: * `state_info.state` *
|
---|
| 72 | * `recommenderSubtype` * `priority` * `targetResources` Examples: *
|
---|
| 73 | * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` *
|
---|
| 74 | * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` *
|
---|
| 75 | * `priority = P1 OR priority = P2` * `targetResources :
|
---|
| 76 | * //compute.googleapis.com/projects/1234/zones/us-
|
---|
| 77 | * central1-a/instances/instance-1` * `stateInfo.state = ACTIVE AND (priority =
|
---|
| 78 | * P1 OR priority = P2)` The max allowed filter length is 500 characters. (These
|
---|
| 79 | * expressions are based on the filter language described at
|
---|
| 80 | * https://google.aip.dev/160)
|
---|
| 81 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
| 82 | * from this request. Non-positive values are ignored. If not specified, the
|
---|
| 83 | * server will determine the number of results to return.
|
---|
| 84 | * @opt_param string pageToken Optional. If present, retrieves the next batch of
|
---|
| 85 | * results from the preceding call to this method. `page_token` must be the
|
---|
| 86 | * value of `next_page_token` from the previous response. The values of other
|
---|
| 87 | * method parameters must be identical to those in the previous call.
|
---|
| 88 | * @return GoogleCloudRecommenderV1ListRecommendationsResponse
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function listOrganizationsLocationsRecommendersRecommendations($parent, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['parent' => $parent];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('list', [$params], GoogleCloudRecommenderV1ListRecommendationsResponse::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Marks the Recommendation State as Claimed. Users can use this method to
|
---|
| 99 | * indicate to the Recommender API that they are starting to apply the
|
---|
| 100 | * recommendation themselves. This stops the recommendation content from being
|
---|
| 101 | * updated. Associated insights are frozen and placed in the ACCEPTED state.
|
---|
| 102 | * MarkRecommendationClaimed can be applied to recommendations in CLAIMED,
|
---|
| 103 | * SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM
|
---|
| 104 | * permission for the specified recommender. (recommendations.markClaimed)
|
---|
| 105 | *
|
---|
| 106 | * @param string $name Required. Name of the recommendation.
|
---|
| 107 | * @param GoogleCloudRecommenderV1MarkRecommendationClaimedRequest $postBody
|
---|
| 108 | * @param array $optParams Optional parameters.
|
---|
| 109 | * @return GoogleCloudRecommenderV1Recommendation
|
---|
| 110 | * @throws \Google\Service\Exception
|
---|
| 111 | */
|
---|
| 112 | public function markClaimed($name, GoogleCloudRecommenderV1MarkRecommendationClaimedRequest $postBody, $optParams = [])
|
---|
| 113 | {
|
---|
| 114 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 115 | $params = array_merge($params, $optParams);
|
---|
| 116 | return $this->call('markClaimed', [$params], GoogleCloudRecommenderV1Recommendation::class);
|
---|
| 117 | }
|
---|
| 118 | /**
|
---|
| 119 | * Mark the Recommendation State as Dismissed. Users can use this method to
|
---|
| 120 | * indicate to the Recommender API that an ACTIVE recommendation has to be
|
---|
| 121 | * marked back as DISMISSED. MarkRecommendationDismissed can be applied to
|
---|
| 122 | * recommendations in ACTIVE state. Requires the recommender.*.update IAM
|
---|
| 123 | * permission for the specified recommender. (recommendations.markDismissed)
|
---|
| 124 | *
|
---|
| 125 | * @param string $name Required. Name of the recommendation.
|
---|
| 126 | * @param GoogleCloudRecommenderV1MarkRecommendationDismissedRequest $postBody
|
---|
| 127 | * @param array $optParams Optional parameters.
|
---|
| 128 | * @return GoogleCloudRecommenderV1Recommendation
|
---|
| 129 | * @throws \Google\Service\Exception
|
---|
| 130 | */
|
---|
| 131 | public function markDismissed($name, GoogleCloudRecommenderV1MarkRecommendationDismissedRequest $postBody, $optParams = [])
|
---|
| 132 | {
|
---|
| 133 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 134 | $params = array_merge($params, $optParams);
|
---|
| 135 | return $this->call('markDismissed', [$params], GoogleCloudRecommenderV1Recommendation::class);
|
---|
| 136 | }
|
---|
| 137 | /**
|
---|
| 138 | * Marks the Recommendation State as Failed. Users can use this method to
|
---|
| 139 | * indicate to the Recommender API that they have applied the recommendation
|
---|
| 140 | * themselves, and the operation failed. This stops the recommendation content
|
---|
| 141 | * from being updated. Associated insights are frozen and placed in the ACCEPTED
|
---|
| 142 | * state. MarkRecommendationFailed can be applied to recommendations in ACTIVE,
|
---|
| 143 | * CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM
|
---|
| 144 | * permission for the specified recommender. (recommendations.markFailed)
|
---|
| 145 | *
|
---|
| 146 | * @param string $name Required. Name of the recommendation.
|
---|
| 147 | * @param GoogleCloudRecommenderV1MarkRecommendationFailedRequest $postBody
|
---|
| 148 | * @param array $optParams Optional parameters.
|
---|
| 149 | * @return GoogleCloudRecommenderV1Recommendation
|
---|
| 150 | * @throws \Google\Service\Exception
|
---|
| 151 | */
|
---|
| 152 | public function markFailed($name, GoogleCloudRecommenderV1MarkRecommendationFailedRequest $postBody, $optParams = [])
|
---|
| 153 | {
|
---|
| 154 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 155 | $params = array_merge($params, $optParams);
|
---|
| 156 | return $this->call('markFailed', [$params], GoogleCloudRecommenderV1Recommendation::class);
|
---|
| 157 | }
|
---|
| 158 | /**
|
---|
| 159 | * Marks the Recommendation State as Succeeded. Users can use this method to
|
---|
| 160 | * indicate to the Recommender API that they have applied the recommendation
|
---|
| 161 | * themselves, and the operation was successful. This stops the recommendation
|
---|
| 162 | * content from being updated. Associated insights are frozen and placed in the
|
---|
| 163 | * ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations
|
---|
| 164 | * in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the
|
---|
| 165 | * recommender.*.update IAM permission for the specified recommender.
|
---|
| 166 | * (recommendations.markSucceeded)
|
---|
| 167 | *
|
---|
| 168 | * @param string $name Required. Name of the recommendation.
|
---|
| 169 | * @param GoogleCloudRecommenderV1MarkRecommendationSucceededRequest $postBody
|
---|
| 170 | * @param array $optParams Optional parameters.
|
---|
| 171 | * @return GoogleCloudRecommenderV1Recommendation
|
---|
| 172 | * @throws \Google\Service\Exception
|
---|
| 173 | */
|
---|
| 174 | public function markSucceeded($name, GoogleCloudRecommenderV1MarkRecommendationSucceededRequest $postBody, $optParams = [])
|
---|
| 175 | {
|
---|
| 176 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 177 | $params = array_merge($params, $optParams);
|
---|
| 178 | return $this->call('markSucceeded', [$params], GoogleCloudRecommenderV1Recommendation::class);
|
---|
| 179 | }
|
---|
| 180 | }
|
---|
| 181 |
|
---|
| 182 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 183 | class_alias(OrganizationsLocationsRecommendersRecommendations::class, 'Google_Service_Recommender_Resource_OrganizationsLocationsRecommendersRecommendations');
|
---|