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; 19 20use Google\Client; 21 22/** 23 * Service definition for PeopleService (v1). 24 * 25 * <p> 26 * Provides access to information about profiles and contacts.</p> 27 * 28 * <p> 29 * For more information about this service, see the API 30 * <a href="https://developers.google.com/people/" target="_blank">Documentation</a> 31 * </p> 32 * 33 * @author Google, Inc. 34 */ 35class PeopleService extends \Google\Service 36{ 37 /** See, edit, download, and permanently delete your contacts. */ 38 const CONTACTS = 39 "https://www.googleapis.com/auth/contacts"; 40 /** See and download contact info automatically saved in your "Other contacts". */ 41 const CONTACTS_OTHER_READONLY = 42 "https://www.googleapis.com/auth/contacts.other.readonly"; 43 /** See and download your contacts. */ 44 const CONTACTS_READONLY = 45 "https://www.googleapis.com/auth/contacts.readonly"; 46 /** See and download your organization's GSuite directory. */ 47 const DIRECTORY_READONLY = 48 "https://www.googleapis.com/auth/directory.readonly"; 49 /** View your street addresses. */ 50 const USER_ADDRESSES_READ = 51 "https://www.googleapis.com/auth/user.addresses.read"; 52 /** See and download your exact date of birth. */ 53 const USER_BIRTHDAY_READ = 54 "https://www.googleapis.com/auth/user.birthday.read"; 55 /** See and download all of your Google Account email addresses. */ 56 const USER_EMAILS_READ = 57 "https://www.googleapis.com/auth/user.emails.read"; 58 /** See your gender. */ 59 const USER_GENDER_READ = 60 "https://www.googleapis.com/auth/user.gender.read"; 61 /** See your education, work history and org info. */ 62 const USER_ORGANIZATION_READ = 63 "https://www.googleapis.com/auth/user.organization.read"; 64 /** See and download your personal phone numbers. */ 65 const USER_PHONENUMBERS_READ = 66 "https://www.googleapis.com/auth/user.phonenumbers.read"; 67 /** See your primary Google Account email address. */ 68 const USERINFO_EMAIL = 69 "https://www.googleapis.com/auth/userinfo.email"; 70 /** See your personal info, including any personal info you've made publicly available. */ 71 const USERINFO_PROFILE = 72 "https://www.googleapis.com/auth/userinfo.profile"; 73 74 public $contactGroups; 75 public $contactGroups_members; 76 public $otherContacts; 77 public $people; 78 public $people_connections; 79 80 /** 81 * Constructs the internal representation of the PeopleService service. 82 * 83 * @param Client|array $clientOrConfig The client used to deliver requests, or a 84 * config array to pass to a new Client instance. 85 * @param string $rootUrl The root URL used for requests to the service. 86 */ 87 public function __construct($clientOrConfig = [], $rootUrl = null) 88 { 89 parent::__construct($clientOrConfig); 90 $this->rootUrl = $rootUrl ?: 'https://people.googleapis.com/'; 91 $this->servicePath = ''; 92 $this->batchPath = 'batch'; 93 $this->version = 'v1'; 94 $this->serviceName = 'people'; 95 96 $this->contactGroups = new PeopleService\Resource\ContactGroups( 97 $this, 98 $this->serviceName, 99 'contactGroups', 100 [ 101 'methods' => [ 102 'batchGet' => [ 103 'path' => 'v1/contactGroups:batchGet', 104 'httpMethod' => 'GET', 105 'parameters' => [ 106 'groupFields' => [ 107 'location' => 'query', 108 'type' => 'string', 109 ], 110 'maxMembers' => [ 111 'location' => 'query', 112 'type' => 'integer', 113 ], 114 'resourceNames' => [ 115 'location' => 'query', 116 'type' => 'string', 117 'repeated' => true, 118 ], 119 ], 120 ],'create' => [ 121 'path' => 'v1/contactGroups', 122 'httpMethod' => 'POST', 123 'parameters' => [], 124 ],'delete' => [ 125 'path' => 'v1/{+resourceName}', 126 'httpMethod' => 'DELETE', 127 'parameters' => [ 128 'resourceName' => [ 129 'location' => 'path', 130 'type' => 'string', 131 'required' => true, 132 ], 133 'deleteContacts' => [ 134 'location' => 'query', 135 'type' => 'boolean', 136 ], 137 ], 138 ],'get' => [ 139 'path' => 'v1/{+resourceName}', 140 'httpMethod' => 'GET', 141 'parameters' => [ 142 'resourceName' => [ 143 'location' => 'path', 144 'type' => 'string', 145 'required' => true, 146 ], 147 'groupFields' => [ 148 'location' => 'query', 149 'type' => 'string', 150 ], 151 'maxMembers' => [ 152 'location' => 'query', 153 'type' => 'integer', 154 ], 155 ], 156 ],'list' => [ 157 'path' => 'v1/contactGroups', 158 'httpMethod' => 'GET', 159 'parameters' => [ 160 'groupFields' => [ 161 'location' => 'query', 162 'type' => 'string', 163 ], 164 'pageSize' => [ 165 'location' => 'query', 166 'type' => 'integer', 167 ], 168 'pageToken' => [ 169 'location' => 'query', 170 'type' => 'string', 171 ], 172 'syncToken' => [ 173 'location' => 'query', 174 'type' => 'string', 175 ], 176 ], 177 ],'update' => [ 178 'path' => 'v1/{+resourceName}', 179 'httpMethod' => 'PUT', 180 'parameters' => [ 181 'resourceName' => [ 182 'location' => 'path', 183 'type' => 'string', 184 'required' => true, 185 ], 186 ], 187 ], 188 ] 189 ] 190 ); 191 $this->contactGroups_members = new PeopleService\Resource\ContactGroupsMembers( 192 $this, 193 $this->serviceName, 194 'members', 195 [ 196 'methods' => [ 197 'modify' => [ 198 'path' => 'v1/{+resourceName}/members:modify', 199 'httpMethod' => 'POST', 200 'parameters' => [ 201 'resourceName' => [ 202 'location' => 'path', 203 'type' => 'string', 204 'required' => true, 205 ], 206 ], 207 ], 208 ] 209 ] 210 ); 211 $this->otherContacts = new PeopleService\Resource\OtherContacts( 212 $this, 213 $this->serviceName, 214 'otherContacts', 215 [ 216 'methods' => [ 217 'copyOtherContactToMyContactsGroup' => [ 218 'path' => 'v1/{+resourceName}:copyOtherContactToMyContactsGroup', 219 'httpMethod' => 'POST', 220 'parameters' => [ 221 'resourceName' => [ 222 'location' => 'path', 223 'type' => 'string', 224 'required' => true, 225 ], 226 ], 227 ],'list' => [ 228 'path' => 'v1/otherContacts', 229 'httpMethod' => 'GET', 230 'parameters' => [ 231 'pageSize' => [ 232 'location' => 'query', 233 'type' => 'integer', 234 ], 235 'pageToken' => [ 236 'location' => 'query', 237 'type' => 'string', 238 ], 239 'readMask' => [ 240 'location' => 'query', 241 'type' => 'string', 242 ], 243 'requestSyncToken' => [ 244 'location' => 'query', 245 'type' => 'boolean', 246 ], 247 'sources' => [ 248 'location' => 'query', 249 'type' => 'string', 250 'repeated' => true, 251 ], 252 'syncToken' => [ 253 'location' => 'query', 254 'type' => 'string', 255 ], 256 ], 257 ],'search' => [ 258 'path' => 'v1/otherContacts:search', 259 'httpMethod' => 'GET', 260 'parameters' => [ 261 'pageSize' => [ 262 'location' => 'query', 263 'type' => 'integer', 264 ], 265 'query' => [ 266 'location' => 'query', 267 'type' => 'string', 268 ], 269 'readMask' => [ 270 'location' => 'query', 271 'type' => 'string', 272 ], 273 ], 274 ], 275 ] 276 ] 277 ); 278 $this->people = new PeopleService\Resource\People( 279 $this, 280 $this->serviceName, 281 'people', 282 [ 283 'methods' => [ 284 'batchCreateContacts' => [ 285 'path' => 'v1/people:batchCreateContacts', 286 'httpMethod' => 'POST', 287 'parameters' => [], 288 ],'batchDeleteContacts' => [ 289 'path' => 'v1/people:batchDeleteContacts', 290 'httpMethod' => 'POST', 291 'parameters' => [], 292 ],'batchUpdateContacts' => [ 293 'path' => 'v1/people:batchUpdateContacts', 294 'httpMethod' => 'POST', 295 'parameters' => [], 296 ],'createContact' => [ 297 'path' => 'v1/people:createContact', 298 'httpMethod' => 'POST', 299 'parameters' => [ 300 'personFields' => [ 301 'location' => 'query', 302 'type' => 'string', 303 ], 304 'sources' => [ 305 'location' => 'query', 306 'type' => 'string', 307 'repeated' => true, 308 ], 309 ], 310 ],'deleteContact' => [ 311 'path' => 'v1/{+resourceName}:deleteContact', 312 'httpMethod' => 'DELETE', 313 'parameters' => [ 314 'resourceName' => [ 315 'location' => 'path', 316 'type' => 'string', 317 'required' => true, 318 ], 319 ], 320 ],'deleteContactPhoto' => [ 321 'path' => 'v1/{+resourceName}:deleteContactPhoto', 322 'httpMethod' => 'DELETE', 323 'parameters' => [ 324 'resourceName' => [ 325 'location' => 'path', 326 'type' => 'string', 327 'required' => true, 328 ], 329 'personFields' => [ 330 'location' => 'query', 331 'type' => 'string', 332 ], 333 'sources' => [ 334 'location' => 'query', 335 'type' => 'string', 336 'repeated' => true, 337 ], 338 ], 339 ],'get' => [ 340 'path' => 'v1/{+resourceName}', 341 'httpMethod' => 'GET', 342 'parameters' => [ 343 'resourceName' => [ 344 'location' => 'path', 345 'type' => 'string', 346 'required' => true, 347 ], 348 'personFields' => [ 349 'location' => 'query', 350 'type' => 'string', 351 ], 352 'requestMask.includeField' => [ 353 'location' => 'query', 354 'type' => 'string', 355 ], 356 'sources' => [ 357 'location' => 'query', 358 'type' => 'string', 359 'repeated' => true, 360 ], 361 ], 362 ],'getBatchGet' => [ 363 'path' => 'v1/people:batchGet', 364 'httpMethod' => 'GET', 365 'parameters' => [ 366 'personFields' => [ 367 'location' => 'query', 368 'type' => 'string', 369 ], 370 'requestMask.includeField' => [ 371 'location' => 'query', 372 'type' => 'string', 373 ], 374 'resourceNames' => [ 375 'location' => 'query', 376 'type' => 'string', 377 'repeated' => true, 378 ], 379 'sources' => [ 380 'location' => 'query', 381 'type' => 'string', 382 'repeated' => true, 383 ], 384 ], 385 ],'listDirectoryPeople' => [ 386 'path' => 'v1/people:listDirectoryPeople', 387 'httpMethod' => 'GET', 388 'parameters' => [ 389 'mergeSources' => [ 390 'location' => 'query', 391 'type' => 'string', 392 'repeated' => true, 393 ], 394 'pageSize' => [ 395 'location' => 'query', 396 'type' => 'integer', 397 ], 398 'pageToken' => [ 399 'location' => 'query', 400 'type' => 'string', 401 ], 402 'readMask' => [ 403 'location' => 'query', 404 'type' => 'string', 405 ], 406 'requestSyncToken' => [ 407 'location' => 'query', 408 'type' => 'boolean', 409 ], 410 'sources' => [ 411 'location' => 'query', 412 'type' => 'string', 413 'repeated' => true, 414 ], 415 'syncToken' => [ 416 'location' => 'query', 417 'type' => 'string', 418 ], 419 ], 420 ],'searchContacts' => [ 421 'path' => 'v1/people:searchContacts', 422 'httpMethod' => 'GET', 423 'parameters' => [ 424 'pageSize' => [ 425 'location' => 'query', 426 'type' => 'integer', 427 ], 428 'query' => [ 429 'location' => 'query', 430 'type' => 'string', 431 ], 432 'readMask' => [ 433 'location' => 'query', 434 'type' => 'string', 435 ], 436 'sources' => [ 437 'location' => 'query', 438 'type' => 'string', 439 'repeated' => true, 440 ], 441 ], 442 ],'searchDirectoryPeople' => [ 443 'path' => 'v1/people:searchDirectoryPeople', 444 'httpMethod' => 'GET', 445 'parameters' => [ 446 'mergeSources' => [ 447 'location' => 'query', 448 'type' => 'string', 449 'repeated' => true, 450 ], 451 'pageSize' => [ 452 'location' => 'query', 453 'type' => 'integer', 454 ], 455 'pageToken' => [ 456 'location' => 'query', 457 'type' => 'string', 458 ], 459 'query' => [ 460 'location' => 'query', 461 'type' => 'string', 462 ], 463 'readMask' => [ 464 'location' => 'query', 465 'type' => 'string', 466 ], 467 'sources' => [ 468 'location' => 'query', 469 'type' => 'string', 470 'repeated' => true, 471 ], 472 ], 473 ],'updateContact' => [ 474 'path' => 'v1/{+resourceName}:updateContact', 475 'httpMethod' => 'PATCH', 476 'parameters' => [ 477 'resourceName' => [ 478 'location' => 'path', 479 'type' => 'string', 480 'required' => true, 481 ], 482 'personFields' => [ 483 'location' => 'query', 484 'type' => 'string', 485 ], 486 'sources' => [ 487 'location' => 'query', 488 'type' => 'string', 489 'repeated' => true, 490 ], 491 'updatePersonFields' => [ 492 'location' => 'query', 493 'type' => 'string', 494 ], 495 ], 496 ],'updateContactPhoto' => [ 497 'path' => 'v1/{+resourceName}:updateContactPhoto', 498 'httpMethod' => 'PATCH', 499 'parameters' => [ 500 'resourceName' => [ 501 'location' => 'path', 502 'type' => 'string', 503 'required' => true, 504 ], 505 ], 506 ], 507 ] 508 ] 509 ); 510 $this->people_connections = new PeopleService\Resource\PeopleConnections( 511 $this, 512 $this->serviceName, 513 'connections', 514 [ 515 'methods' => [ 516 'list' => [ 517 'path' => 'v1/{+resourceName}/connections', 518 'httpMethod' => 'GET', 519 'parameters' => [ 520 'resourceName' => [ 521 'location' => 'path', 522 'type' => 'string', 523 'required' => true, 524 ], 525 'pageSize' => [ 526 'location' => 'query', 527 'type' => 'integer', 528 ], 529 'pageToken' => [ 530 'location' => 'query', 531 'type' => 'string', 532 ], 533 'personFields' => [ 534 'location' => 'query', 535 'type' => 'string', 536 ], 537 'requestMask.includeField' => [ 538 'location' => 'query', 539 'type' => 'string', 540 ], 541 'requestSyncToken' => [ 542 'location' => 'query', 543 'type' => 'boolean', 544 ], 545 'sortOrder' => [ 546 'location' => 'query', 547 'type' => 'string', 548 ], 549 'sources' => [ 550 'location' => 'query', 551 'type' => 'string', 552 'repeated' => true, 553 ], 554 'syncToken' => [ 555 'location' => 'query', 556 'type' => 'string', 557 ], 558 ], 559 ], 560 ] 561 ] 562 ); 563 } 564} 565 566// Adding a class alias for backwards compatibility with the previous class name. 567class_alias(PeopleService::class, 'Google_Service_PeopleService'); 568