[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\Merchant\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Merchant\ListMerchantReviewsResponse;
|
---|
| 21 | use Google\Service\Merchant\MerchantReview;
|
---|
| 22 | use Google\Service\Merchant\MerchantapiEmpty;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "merchantReviews" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $merchantapiService = new Google\Service\Merchant(...);
|
---|
| 29 | * $merchantReviews = $merchantapiService->accounts_merchantReviews;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class AccountsMerchantReviews extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Deletes merchant review. (merchantReviews.delete)
|
---|
| 36 | *
|
---|
| 37 | * @param string $name Required. The ID of the merchant review. Format:
|
---|
| 38 | * accounts/{account}/merchantReviews/{merchantReview}
|
---|
| 39 | * @param array $optParams Optional parameters.
|
---|
| 40 | * @return MerchantapiEmpty
|
---|
| 41 | * @throws \Google\Service\Exception
|
---|
| 42 | */
|
---|
| 43 | public function delete($name, $optParams = [])
|
---|
| 44 | {
|
---|
| 45 | $params = ['name' => $name];
|
---|
| 46 | $params = array_merge($params, $optParams);
|
---|
| 47 | return $this->call('delete', [$params], MerchantapiEmpty::class);
|
---|
| 48 | }
|
---|
| 49 | /**
|
---|
| 50 | * Gets a merchant review. (merchantReviews.get)
|
---|
| 51 | *
|
---|
| 52 | * @param string $name Required. The ID of the merchant review. Format:
|
---|
| 53 | * accounts/{account}/merchantReviews/{merchantReview}
|
---|
| 54 | * @param array $optParams Optional parameters.
|
---|
| 55 | * @return MerchantReview
|
---|
| 56 | * @throws \Google\Service\Exception
|
---|
| 57 | */
|
---|
| 58 | public function get($name, $optParams = [])
|
---|
| 59 | {
|
---|
| 60 | $params = ['name' => $name];
|
---|
| 61 | $params = array_merge($params, $optParams);
|
---|
| 62 | return $this->call('get', [$params], MerchantReview::class);
|
---|
| 63 | }
|
---|
| 64 | /**
|
---|
| 65 | * Inserts a review for your Merchant Center account. If the review already
|
---|
| 66 | * exists, then the review is replaced with the new instance.
|
---|
| 67 | * (merchantReviews.insert)
|
---|
| 68 | *
|
---|
| 69 | * @param string $parent Required. The account where the merchant review will be
|
---|
| 70 | * inserted. Format: accounts/{account}
|
---|
| 71 | * @param MerchantReview $postBody
|
---|
| 72 | * @param array $optParams Optional parameters.
|
---|
| 73 | *
|
---|
| 74 | * @opt_param string dataSource Required. The data source of the [merchantreview
|
---|
| 75 | * ](https://support.google.com/merchants/answer/7045996?sjid=525358124421758197
|
---|
| 76 | * 6-EU) Format: `accounts/{account}/dataSources/{datasource}`.
|
---|
| 77 | * @return MerchantReview
|
---|
| 78 | * @throws \Google\Service\Exception
|
---|
| 79 | */
|
---|
| 80 | public function insert($parent, MerchantReview $postBody, $optParams = [])
|
---|
| 81 | {
|
---|
| 82 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 83 | $params = array_merge($params, $optParams);
|
---|
| 84 | return $this->call('insert', [$params], MerchantReview::class);
|
---|
| 85 | }
|
---|
| 86 | /**
|
---|
| 87 | * Lists merchant reviews. (merchantReviews.listAccountsMerchantReviews)
|
---|
| 88 | *
|
---|
| 89 | * @param string $parent Required. The account to list merchant reviews for.
|
---|
| 90 | * Format: accounts/{account}
|
---|
| 91 | * @param array $optParams Optional parameters.
|
---|
| 92 | *
|
---|
| 93 | * @opt_param int pageSize Optional. The maximum number of merchant reviews to
|
---|
| 94 | * return. The service can return fewer than this value. The maximum value is
|
---|
| 95 | * 1000; values above 1000 are coerced to 1000. If unspecified, the maximum
|
---|
| 96 | * number of reviews is returned.
|
---|
| 97 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
| 98 | * `ListMerchantReviews` call. Provide this to retrieve the subsequent page.
|
---|
| 99 | * When paginating, all other parameters provided to `ListMerchantReviews` must
|
---|
| 100 | * match the call that provided the page token.
|
---|
| 101 | * @return ListMerchantReviewsResponse
|
---|
| 102 | * @throws \Google\Service\Exception
|
---|
| 103 | */
|
---|
| 104 | public function listAccountsMerchantReviews($parent, $optParams = [])
|
---|
| 105 | {
|
---|
| 106 | $params = ['parent' => $parent];
|
---|
| 107 | $params = array_merge($params, $optParams);
|
---|
| 108 | return $this->call('list', [$params], ListMerchantReviewsResponse::class);
|
---|
| 109 | }
|
---|
| 110 | }
|
---|
| 111 |
|
---|
| 112 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 113 | class_alias(AccountsMerchantReviews::class, 'Google_Service_Merchant_Resource_AccountsMerchantReviews');
|
---|