MyBusinessQA.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. namespace Google\Service;
  18. use Google\Client;
  19. /**
  20. * Service definition for MyBusinessQA (v1).
  21. *
  22. * <p>
  23. * The My Business Q&A API allows questions and answers to be posted for
  24. * specific listings. Note - If you have a quota of 0 after enabling the API,
  25. * please request for GBP API access.</p>
  26. *
  27. * <p>
  28. * For more information about this service, see the API
  29. * <a href="https://developers.google.com/my-business/" target="_blank">Documentation</a>
  30. * </p>
  31. *
  32. * @author Google, Inc.
  33. */
  34. class MyBusinessQA extends \Google\Service
  35. {
  36. public $locations_questions;
  37. public $locations_questions_answers;
  38. public $rootUrlTemplate;
  39. /**
  40. * Constructs the internal representation of the MyBusinessQA service.
  41. *
  42. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  43. * config array to pass to a new Client instance.
  44. * @param string $rootUrl The root URL used for requests to the service.
  45. */
  46. public function __construct($clientOrConfig = [], $rootUrl = null)
  47. {
  48. parent::__construct($clientOrConfig);
  49. $this->rootUrl = $rootUrl ?: 'https://mybusinessqanda.googleapis.com/';
  50. $this->rootUrlTemplate = $rootUrl ?: 'https://mybusinessqanda.UNIVERSE_DOMAIN/';
  51. $this->servicePath = '';
  52. $this->batchPath = 'batch';
  53. $this->version = 'v1';
  54. $this->serviceName = 'mybusinessqanda';
  55. $this->locations_questions = new MyBusinessQA\Resource\LocationsQuestions(
  56. $this,
  57. $this->serviceName,
  58. 'questions',
  59. [
  60. 'methods' => [
  61. 'create' => [
  62. 'path' => 'v1/{+parent}',
  63. 'httpMethod' => 'POST',
  64. 'parameters' => [
  65. 'parent' => [
  66. 'location' => 'path',
  67. 'type' => 'string',
  68. 'required' => true,
  69. ],
  70. ],
  71. ],'delete' => [
  72. 'path' => 'v1/{+name}',
  73. 'httpMethod' => 'DELETE',
  74. 'parameters' => [
  75. 'name' => [
  76. 'location' => 'path',
  77. 'type' => 'string',
  78. 'required' => true,
  79. ],
  80. ],
  81. ],'list' => [
  82. 'path' => 'v1/{+parent}',
  83. 'httpMethod' => 'GET',
  84. 'parameters' => [
  85. 'parent' => [
  86. 'location' => 'path',
  87. 'type' => 'string',
  88. 'required' => true,
  89. ],
  90. 'answersPerQuestion' => [
  91. 'location' => 'query',
  92. 'type' => 'integer',
  93. ],
  94. 'filter' => [
  95. 'location' => 'query',
  96. 'type' => 'string',
  97. ],
  98. 'orderBy' => [
  99. 'location' => 'query',
  100. 'type' => 'string',
  101. ],
  102. 'pageSize' => [
  103. 'location' => 'query',
  104. 'type' => 'integer',
  105. ],
  106. 'pageToken' => [
  107. 'location' => 'query',
  108. 'type' => 'string',
  109. ],
  110. ],
  111. ],'patch' => [
  112. 'path' => 'v1/{+name}',
  113. 'httpMethod' => 'PATCH',
  114. 'parameters' => [
  115. 'name' => [
  116. 'location' => 'path',
  117. 'type' => 'string',
  118. 'required' => true,
  119. ],
  120. 'updateMask' => [
  121. 'location' => 'query',
  122. 'type' => 'string',
  123. ],
  124. ],
  125. ],
  126. ]
  127. ]
  128. );
  129. $this->locations_questions_answers = new MyBusinessQA\Resource\LocationsQuestionsAnswers(
  130. $this,
  131. $this->serviceName,
  132. 'answers',
  133. [
  134. 'methods' => [
  135. 'delete' => [
  136. 'path' => 'v1/{+name}/answers:delete',
  137. 'httpMethod' => 'DELETE',
  138. 'parameters' => [
  139. 'name' => [
  140. 'location' => 'path',
  141. 'type' => 'string',
  142. 'required' => true,
  143. ],
  144. ],
  145. ],'list' => [
  146. 'path' => 'v1/{+parent}/answers',
  147. 'httpMethod' => 'GET',
  148. 'parameters' => [
  149. 'parent' => [
  150. 'location' => 'path',
  151. 'type' => 'string',
  152. 'required' => true,
  153. ],
  154. 'orderBy' => [
  155. 'location' => 'query',
  156. 'type' => 'string',
  157. ],
  158. 'pageSize' => [
  159. 'location' => 'query',
  160. 'type' => 'integer',
  161. ],
  162. 'pageToken' => [
  163. 'location' => 'query',
  164. 'type' => 'string',
  165. ],
  166. ],
  167. ],'upsert' => [
  168. 'path' => 'v1/{+parent}/answers:upsert',
  169. 'httpMethod' => 'POST',
  170. 'parameters' => [
  171. 'parent' => [
  172. 'location' => 'path',
  173. 'type' => 'string',
  174. 'required' => true,
  175. ],
  176. ],
  177. ],
  178. ]
  179. ]
  180. );
  181. }
  182. }
  183. // Adding a class alias for backwards compatibility with the previous class name.
  184. class_alias(MyBusinessQA::class, 'Google_Service_MyBusinessQA');