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\PeopleService\Resource; 19 20use Google\Service\PeopleService\ListConnectionsResponse; 21 22/** 23 * The "connections" collection of methods. 24 * Typical usage is: 25 * <code> 26 * $peopleService = new Google\Service\PeopleService(...); 27 * $connections = $peopleService->connections; 28 * </code> 29 */ 30class PeopleConnections extends \Google\Service\Resource 31{ 32 /** 33 * Provides a list of the authenticated user's contacts. Sync tokens expire 7 34 * days after the full sync. A request with an expired sync token will result in 35 * a 410 error. In the case of such an error clients should make a full sync 36 * request without a `sync_token`. The first page of a full sync request has an 37 * additional quota. If the quota is exceeded, a 429 error will be returned. 38 * This quota is fixed and can not be increased. When the `sync_token` is 39 * specified, resources deleted since the last sync will be returned as a person 40 * with `PersonMetadata.deleted` set to true. When the `page_token` or 41 * `sync_token` is specified, all other request parameters must match the first 42 * call. Writes may have a propagation delay of several minutes for sync 43 * requests. Incremental syncs are not intended for read-after-write use cases. 44 * See example usage at [List the user's contacts that have 45 * changed](/people/v1/contacts#list_the_users_contacts_that_have_changed). 46 * (connections.listPeopleConnections) 47 * 48 * @param string $resourceName Required. The resource name to return connections 49 * for. Only `people/me` is valid. 50 * @param array $optParams Optional parameters. 51 * 52 * @opt_param int pageSize Optional. The number of connections to include in the 53 * response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if 54 * not set or set to 0. 55 * @opt_param string pageToken Optional. A page token, received from a previous 56 * response `next_page_token`. Provide this to retrieve the subsequent page. 57 * When paginating, all other parameters provided to `people.connections.list` 58 * must match the first call that provided the page token. 59 * @opt_param string personFields Required. A field mask to restrict which 60 * fields on each person are returned. Multiple fields can be specified by 61 * separating them with commas. Valid values are: * addresses * ageRanges * 62 * biographies * birthdays * calendarUrls * clientData * coverPhotos * 63 * emailAddresses * events * externalIds * genders * imClients * interests * 64 * locales * locations * memberships * metadata * miscKeywords * names * 65 * nicknames * occupations * organizations * phoneNumbers * photos * relations * 66 * sipAddresses * skills * urls * userDefined 67 * @opt_param string requestMask.includeField Required. Comma-separated list of 68 * person fields to be included in the response. Each path should start with 69 * `person.`: for example, `person.names` or `person.photos`. 70 * @opt_param bool requestSyncToken Optional. Whether the response should return 71 * `next_sync_token` on the last page of results. It can be used to get 72 * incremental changes since the last request by setting it on the request 73 * `sync_token`. More details about sync behavior at `people.connections.list`. 74 * @opt_param string sortOrder Optional. The order in which the connections 75 * should be sorted. Defaults to `LAST_MODIFIED_ASCENDING`. 76 * @opt_param string sources Optional. A mask of what source types to return. 77 * Defaults to READ_SOURCE_TYPE_CONTACT and READ_SOURCE_TYPE_PROFILE if not set. 78 * @opt_param string syncToken Optional. A sync token, received from a previous 79 * response `next_sync_token` Provide this to retrieve only the resources 80 * changed since the last request. When syncing, all other parameters provided 81 * to `people.connections.list` must match the first call that provided the sync 82 * token. More details about sync behavior at `people.connections.list`. 83 * @return ListConnectionsResponse 84 */ 85 public function listPeopleConnections($resourceName, $optParams = []) 86 { 87 $params = ['resourceName' => $resourceName]; 88 $params = array_merge($params, $optParams); 89 return $this->call('list', [$params], ListConnectionsResponse::class); 90 } 91} 92 93// Adding a class alias for backwards compatibility with the previous class name. 94class_alias(PeopleConnections::class, 'Google_Service_PeopleService_Resource_PeopleConnections'); 95