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
18namespace Google\Service\AndroidPublisher\Resource;
19
20use Google\Service\AndroidPublisher\Review;
21use Google\Service\AndroidPublisher\ReviewsListResponse;
22use Google\Service\AndroidPublisher\ReviewsReplyRequest;
23use Google\Service\AndroidPublisher\ReviewsReplyResponse;
24
25/**
26 * The "reviews" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $androidpublisherService = new Google\Service\AndroidPublisher(...);
30 *   $reviews = $androidpublisherService->reviews;
31 *  </code>
32 */
33class Reviews extends \Google\Service\Resource
34{
35  /**
36   * Gets a single review. (reviews.get)
37   *
38   * @param string $packageName Package name of the app.
39   * @param string $reviewId Unique identifier for a review.
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string translationLanguage Language localization code.
43   * @return Review
44   */
45  public function get($packageName, $reviewId, $optParams = [])
46  {
47    $params = ['packageName' => $packageName, 'reviewId' => $reviewId];
48    $params = array_merge($params, $optParams);
49    return $this->call('get', [$params], Review::class);
50  }
51  /**
52   * Lists all reviews. (reviews.listReviews)
53   *
54   * @param string $packageName Package name of the app.
55   * @param array $optParams Optional parameters.
56   *
57   * @opt_param string maxResults How many results the list operation should
58   * return.
59   * @opt_param string startIndex The index of the first element to return.
60   * @opt_param string token Pagination token. If empty, list starts at the first
61   * review.
62   * @opt_param string translationLanguage Language localization code.
63   * @return ReviewsListResponse
64   */
65  public function listReviews($packageName, $optParams = [])
66  {
67    $params = ['packageName' => $packageName];
68    $params = array_merge($params, $optParams);
69    return $this->call('list', [$params], ReviewsListResponse::class);
70  }
71  /**
72   * Replies to a single review, or updates an existing reply. (reviews.reply)
73   *
74   * @param string $packageName Package name of the app.
75   * @param string $reviewId Unique identifier for a review.
76   * @param ReviewsReplyRequest $postBody
77   * @param array $optParams Optional parameters.
78   * @return ReviewsReplyResponse
79   */
80  public function reply($packageName, $reviewId, ReviewsReplyRequest $postBody, $optParams = [])
81  {
82    $params = ['packageName' => $packageName, 'reviewId' => $reviewId, 'postBody' => $postBody];
83    $params = array_merge($params, $optParams);
84    return $this->call('reply', [$params], ReviewsReplyResponse::class);
85  }
86}
87
88// Adding a class alias for backwards compatibility with the previous class name.
89class_alias(Reviews::class, 'Google_Service_AndroidPublisher_Resource_Reviews');
90