[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\MyBusinessQA\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\MyBusinessQA\ListQuestionsResponse;
|
---|
| 21 | use Google\Service\MyBusinessQA\MybusinessqandaEmpty;
|
---|
| 22 | use Google\Service\MyBusinessQA\Question;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "questions" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $mybusinessqandaService = new Google\Service\MyBusinessQA(...);
|
---|
| 29 | * $questions = $mybusinessqandaService->locations_questions;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class LocationsQuestions extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Adds a question for the specified location. (questions.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $parent Required. The name of the location to write a question
|
---|
| 38 | * for.
|
---|
| 39 | * @param Question $postBody
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return Question
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function create($parent, Question $postBody, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('create', [$params], Question::class);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * Deletes a specific question written by the current user. (questions.delete)
|
---|
| 52 | *
|
---|
| 53 | * @param string $name Required. The name of the question to delete.
|
---|
| 54 | * @param array $optParams Optional parameters.
|
---|
| 55 | * @return MybusinessqandaEmpty
|
---|
| 56 | * @throws \Google\Service\Exception
|
---|
| 57 | */
|
---|
| 58 | public function delete($name, $optParams = [])
|
---|
| 59 | {
|
---|
| 60 | $params = ['name' => $name];
|
---|
| 61 | $params = array_merge($params, $optParams);
|
---|
| 62 | return $this->call('delete', [$params], MybusinessqandaEmpty::class);
|
---|
| 63 | }
|
---|
| 64 | /**
|
---|
| 65 | * Returns the paginated list of questions and some of its answers for a
|
---|
| 66 | * specified location. This operation is only valid if the specified location is
|
---|
| 67 | * verified. (questions.listLocationsQuestions)
|
---|
| 68 | *
|
---|
| 69 | * @param string $parent Required. The name of the location to fetch questions
|
---|
| 70 | * for.
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | *
|
---|
| 73 | * @opt_param int answersPerQuestion Optional. How many answers to fetch per
|
---|
| 74 | * question. The default and maximum `answers_per_question` values are 10.
|
---|
| 75 | * @opt_param string filter Optional. A filter constraining the questions to
|
---|
| 76 | * return. The only filter currently supported is "ignore_answered=true"
|
---|
| 77 | * @opt_param string orderBy Optional. The order to return the questions. Valid
|
---|
| 78 | * options include 'update_time desc' and 'upvote_count desc', which will return
|
---|
| 79 | * the questions sorted descendingly by the requested field. The default sort
|
---|
| 80 | * order is 'update_time desc'.
|
---|
| 81 | * @opt_param int pageSize Optional. How many questions to fetch per page. The
|
---|
| 82 | * default and maximum `page_size` values are 10.
|
---|
| 83 | * @opt_param string pageToken Optional. If specified, the next page of
|
---|
| 84 | * questions is retrieved.
|
---|
| 85 | * @return ListQuestionsResponse
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function listLocationsQuestions($parent, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['parent' => $parent];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('list', [$params], ListQuestionsResponse::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Updates a specific question written by the current user. (questions.patch)
|
---|
| 96 | *
|
---|
| 97 | * @param string $name Immutable. The unique name for the question.
|
---|
| 98 | * locations/questions This field will be ignored if set during question
|
---|
| 99 | * creation.
|
---|
| 100 | * @param Question $postBody
|
---|
| 101 | * @param array $optParams Optional parameters.
|
---|
| 102 | *
|
---|
| 103 | * @opt_param string updateMask Required. The specific fields to update. Only
|
---|
| 104 | * question text can be updated.
|
---|
| 105 | * @return Question
|
---|
| 106 | * @throws \Google\Service\Exception
|
---|
| 107 | */
|
---|
| 108 | public function patch($name, Question $postBody, $optParams = [])
|
---|
| 109 | {
|
---|
| 110 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 111 | $params = array_merge($params, $optParams);
|
---|
| 112 | return $this->call('patch', [$params], Question::class);
|
---|
| 113 | }
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 117 | class_alias(LocationsQuestions::class, 'Google_Service_MyBusinessQA_Resource_LocationsQuestions');
|
---|