Brak opisu

PeopleService.php 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. * Service definition for PeopleService (v1).
  19. *
  20. * <p>
  21. * Provides access to information about profiles and contacts.</p>
  22. *
  23. * <p>
  24. * For more information about this service, see the API
  25. * <a href="https://developers.google.com/people/" target="_blank">Documentation</a>
  26. * </p>
  27. *
  28. * @author Google, Inc.
  29. */
  30. class Google_Service_PeopleService extends Google_Service
  31. {
  32. /** Manage your contacts. */
  33. const CONTACTS =
  34. "https://www.googleapis.com/auth/contacts";
  35. /** View your contacts. */
  36. const CONTACTS_READONLY =
  37. "https://www.googleapis.com/auth/contacts.readonly";
  38. /** Know the list of people in your circles, your age range, and language. */
  39. const PLUS_LOGIN =
  40. "https://www.googleapis.com/auth/plus.login";
  41. /** View your street addresses. */
  42. const USER_ADDRESSES_READ =
  43. "https://www.googleapis.com/auth/user.addresses.read";
  44. /** View your complete date of birth. */
  45. const USER_BIRTHDAY_READ =
  46. "https://www.googleapis.com/auth/user.birthday.read";
  47. /** View your email addresses. */
  48. const USER_EMAILS_READ =
  49. "https://www.googleapis.com/auth/user.emails.read";
  50. /** View your phone numbers. */
  51. const USER_PHONENUMBERS_READ =
  52. "https://www.googleapis.com/auth/user.phonenumbers.read";
  53. /** View your email address. */
  54. const USERINFO_EMAIL =
  55. "https://www.googleapis.com/auth/userinfo.email";
  56. /** View your basic profile info. */
  57. const USERINFO_PROFILE =
  58. "https://www.googleapis.com/auth/userinfo.profile";
  59. public $contactGroups;
  60. public $contactGroups_members;
  61. public $people;
  62. public $people_connections;
  63. /**
  64. * Constructs the internal representation of the PeopleService service.
  65. *
  66. * @param Google_Client $client
  67. */
  68. public function __construct(Google_Client $client)
  69. {
  70. parent::__construct($client);
  71. $this->rootUrl = 'https://people.googleapis.com/';
  72. $this->servicePath = '';
  73. $this->version = 'v1';
  74. $this->serviceName = 'people';
  75. $this->contactGroups = new Google_Service_PeopleService_Resource_ContactGroups(
  76. $this,
  77. $this->serviceName,
  78. 'contactGroups',
  79. array(
  80. 'methods' => array(
  81. 'batchGet' => array(
  82. 'path' => 'v1/contactGroups:batchGet',
  83. 'httpMethod' => 'GET',
  84. 'parameters' => array(
  85. 'maxMembers' => array(
  86. 'location' => 'query',
  87. 'type' => 'integer',
  88. ),
  89. 'resourceNames' => array(
  90. 'location' => 'query',
  91. 'type' => 'string',
  92. 'repeated' => true,
  93. ),
  94. ),
  95. ),'create' => array(
  96. 'path' => 'v1/contactGroups',
  97. 'httpMethod' => 'POST',
  98. 'parameters' => array(),
  99. ),'delete' => array(
  100. 'path' => 'v1/{+resourceName}',
  101. 'httpMethod' => 'DELETE',
  102. 'parameters' => array(
  103. 'resourceName' => array(
  104. 'location' => 'path',
  105. 'type' => 'string',
  106. 'required' => true,
  107. ),
  108. 'deleteContacts' => array(
  109. 'location' => 'query',
  110. 'type' => 'boolean',
  111. ),
  112. ),
  113. ),'get' => array(
  114. 'path' => 'v1/{+resourceName}',
  115. 'httpMethod' => 'GET',
  116. 'parameters' => array(
  117. 'resourceName' => array(
  118. 'location' => 'path',
  119. 'type' => 'string',
  120. 'required' => true,
  121. ),
  122. 'maxMembers' => array(
  123. 'location' => 'query',
  124. 'type' => 'integer',
  125. ),
  126. ),
  127. ),'list' => array(
  128. 'path' => 'v1/contactGroups',
  129. 'httpMethod' => 'GET',
  130. 'parameters' => array(
  131. 'pageSize' => array(
  132. 'location' => 'query',
  133. 'type' => 'integer',
  134. ),
  135. 'syncToken' => array(
  136. 'location' => 'query',
  137. 'type' => 'string',
  138. ),
  139. 'pageToken' => array(
  140. 'location' => 'query',
  141. 'type' => 'string',
  142. ),
  143. ),
  144. ),'update' => array(
  145. 'path' => 'v1/{+resourceName}',
  146. 'httpMethod' => 'PUT',
  147. 'parameters' => array(
  148. 'resourceName' => array(
  149. 'location' => 'path',
  150. 'type' => 'string',
  151. 'required' => true,
  152. ),
  153. ),
  154. ),
  155. )
  156. )
  157. );
  158. $this->contactGroups_members = new Google_Service_PeopleService_Resource_ContactGroupsMembers(
  159. $this,
  160. $this->serviceName,
  161. 'members',
  162. array(
  163. 'methods' => array(
  164. 'modify' => array(
  165. 'path' => 'v1/{+resourceName}/members:modify',
  166. 'httpMethod' => 'POST',
  167. 'parameters' => array(
  168. 'resourceName' => array(
  169. 'location' => 'path',
  170. 'type' => 'string',
  171. 'required' => true,
  172. ),
  173. ),
  174. ),
  175. )
  176. )
  177. );
  178. $this->people = new Google_Service_PeopleService_Resource_People(
  179. $this,
  180. $this->serviceName,
  181. 'people',
  182. array(
  183. 'methods' => array(
  184. 'createContact' => array(
  185. 'path' => 'v1/people:createContact',
  186. 'httpMethod' => 'POST',
  187. 'parameters' => array(
  188. 'parent' => array(
  189. 'location' => 'query',
  190. 'type' => 'string',
  191. ),
  192. ),
  193. ),'deleteContact' => array(
  194. 'path' => 'v1/{+resourceName}:deleteContact',
  195. 'httpMethod' => 'DELETE',
  196. 'parameters' => array(
  197. 'resourceName' => array(
  198. 'location' => 'path',
  199. 'type' => 'string',
  200. 'required' => true,
  201. ),
  202. ),
  203. ),'get' => array(
  204. 'path' => 'v1/{+resourceName}',
  205. 'httpMethod' => 'GET',
  206. 'parameters' => array(
  207. 'resourceName' => array(
  208. 'location' => 'path',
  209. 'type' => 'string',
  210. 'required' => true,
  211. ),
  212. 'personFields' => array(
  213. 'location' => 'query',
  214. 'type' => 'string',
  215. ),
  216. 'requestMask.includeField' => array(
  217. 'location' => 'query',
  218. 'type' => 'string',
  219. ),
  220. ),
  221. ),'getBatchGet' => array(
  222. 'path' => 'v1/people:batchGet',
  223. 'httpMethod' => 'GET',
  224. 'parameters' => array(
  225. 'requestMask.includeField' => array(
  226. 'location' => 'query',
  227. 'type' => 'string',
  228. ),
  229. 'resourceNames' => array(
  230. 'location' => 'query',
  231. 'type' => 'string',
  232. 'repeated' => true,
  233. ),
  234. 'personFields' => array(
  235. 'location' => 'query',
  236. 'type' => 'string',
  237. ),
  238. ),
  239. ),'updateContact' => array(
  240. 'path' => 'v1/{+resourceName}:updateContact',
  241. 'httpMethod' => 'PATCH',
  242. 'parameters' => array(
  243. 'resourceName' => array(
  244. 'location' => 'path',
  245. 'type' => 'string',
  246. 'required' => true,
  247. ),
  248. 'updatePersonFields' => array(
  249. 'location' => 'query',
  250. 'type' => 'string',
  251. ),
  252. ),
  253. ),
  254. )
  255. )
  256. );
  257. $this->people_connections = new Google_Service_PeopleService_Resource_PeopleConnections(
  258. $this,
  259. $this->serviceName,
  260. 'connections',
  261. array(
  262. 'methods' => array(
  263. 'list' => array(
  264. 'path' => 'v1/{+resourceName}/connections',
  265. 'httpMethod' => 'GET',
  266. 'parameters' => array(
  267. 'resourceName' => array(
  268. 'location' => 'path',
  269. 'type' => 'string',
  270. 'required' => true,
  271. ),
  272. 'requestSyncToken' => array(
  273. 'location' => 'query',
  274. 'type' => 'boolean',
  275. ),
  276. 'pageToken' => array(
  277. 'location' => 'query',
  278. 'type' => 'string',
  279. ),
  280. 'requestMask.includeField' => array(
  281. 'location' => 'query',
  282. 'type' => 'string',
  283. ),
  284. 'pageSize' => array(
  285. 'location' => 'query',
  286. 'type' => 'integer',
  287. ),
  288. 'syncToken' => array(
  289. 'location' => 'query',
  290. 'type' => 'string',
  291. ),
  292. 'personFields' => array(
  293. 'location' => 'query',
  294. 'type' => 'string',
  295. ),
  296. 'sortOrder' => array(
  297. 'location' => 'query',
  298. 'type' => 'string',
  299. ),
  300. ),
  301. ),
  302. )
  303. )
  304. );
  305. }
  306. }