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