diff --git a/types/gapi.client.people/gapi.client.people-tests.ts b/types/gapi.client.people/gapi.client.people-tests.ts index 95f1a10be8..1cbee55b77 100644 --- a/types/gapi.client.people/gapi.client.people-tests.ts +++ b/types/gapi.client.people/gapi.client.people-tests.ts @@ -1,7 +1,7 @@ -/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* This is stub file for gapi.client.people definition tests */ /* IMPORTANT. -* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. -* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +* This file was automatically generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator **/ gapi.load('client', () => { /** now we can use gapi.client */ @@ -12,35 +12,34 @@ gapi.load('client', () => { /** declare client_id registered in Google Developers Console */ const client_id = '<>'; const scope = [ - /** Manage your contacts */ + /** See, edit, download, and permanently delete your contacts */ 'https://www.googleapis.com/auth/contacts', - /** View your contacts */ + /** See and download your contacts */ 'https://www.googleapis.com/auth/contacts.readonly', - /** Know the list of people in your circles, your age range, and language */ - 'https://www.googleapis.com/auth/plus.login', /** View your street addresses */ 'https://www.googleapis.com/auth/user.addresses.read', /** View your complete date of birth */ 'https://www.googleapis.com/auth/user.birthday.read', /** View your email addresses */ 'https://www.googleapis.com/auth/user.emails.read', + /** See your education, work history and org info */ + 'https://www.googleapis.com/auth/user.organization.read', /** View your phone numbers */ 'https://www.googleapis.com/auth/user.phonenumbers.read', /** View your email address */ 'https://www.googleapis.com/auth/userinfo.email', - /** View your basic profile info */ + /** See your personal info, including any personal info you've made publicly available */ 'https://www.googleapis.com/auth/userinfo.profile', ]; - const immediate = true; + const immediate = false; gapi.auth.authorize({ client_id, scope, immediate }, authResult => { if (authResult && !authResult.error) { - /** handle succesfull authorization */ + /** handle successful authorization */ run(); } else { /** handle authorization error */ } }); - run(); }); async function run() { @@ -48,93 +47,1617 @@ gapi.load('client', () => { * Get a list of contact groups owned by the authenticated user by specifying * a list of contact group resource names. */ - await gapi.client.contactGroups.batchGet({ - maxMembers: 1, - resourceNames: "resourceNames", + await gapi.client.people.contactGroups.batchGet({ + maxMembers: 42, + resourceNames: "Test string", + }); + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ + await gapi.client.people.contactGroups.members.modify({ + resourceName: "Test string", + }, { + resourceNamesToAdd: [ + "Test string" ], + resourceNamesToRemove: [ + "Test string" ], }); /** Create a new contact group owned by the authenticated user. */ - await gapi.client.contactGroups.create({ + await gapi.client.people.contactGroups.create({ + }, { + contactGroup: { + etag: "Test string", + formattedName: "Test string", + groupType: "Test string", + memberCount: 42, + memberResourceNames: [ + "Test string" ], + metadata: { + deleted: true, + updateTime: "Test string", + }, + name: "Test string", + resourceName: "Test string", + }, + }); + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ + await gapi.client.people.contactGroups.members.modify({ + resourceName: "Test string", + }, { + resourceNamesToAdd: [ + "Test string" ], + resourceNamesToRemove: [ + "Test string" ], }); /** * Delete an existing contact group owned by the authenticated user by * specifying a contact group resource name. */ - await gapi.client.contactGroups.delete({ + await gapi.client.people.contactGroups.delete({ deleteContacts: true, - resourceName: "resourceName", + resourceName: "Test string", + }); + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ + await gapi.client.people.contactGroups.members.modify({ + resourceName: "Test string", + }, { + resourceNamesToAdd: [ + "Test string" ], + resourceNamesToRemove: [ + "Test string" ], }); /** * Get a specific contact group owned by the authenticated user by specifying * a contact group resource name. */ - await gapi.client.contactGroups.get({ - maxMembers: 1, - resourceName: "resourceName", + await gapi.client.people.contactGroups.get({ + maxMembers: 42, + resourceName: "Test string", + }); + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ + await gapi.client.people.contactGroups.members.modify({ + resourceName: "Test string", + }, { + resourceNamesToAdd: [ + "Test string" ], + resourceNamesToRemove: [ + "Test string" ], }); /** * List all contact groups owned by the authenticated user. Members of the * contact groups are not populated. */ - await gapi.client.contactGroups.list({ - pageSize: 1, - pageToken: "pageToken", - syncToken: "syncToken", + await gapi.client.people.contactGroups.list({ + pageSize: 42, + pageToken: "Test string", + syncToken: "Test string", + }); + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ + await gapi.client.people.contactGroups.members.modify({ + resourceName: "Test string", + }, { + resourceNamesToAdd: [ + "Test string" ], + resourceNamesToRemove: [ + "Test string" ], }); /** * Update the name of an existing contact group owned by the authenticated * user. */ - await gapi.client.contactGroups.update({ - resourceName: "resourceName", + await gapi.client.people.contactGroups.update({ + resourceName: "Test string", + }, { + contactGroup: { + etag: "Test string", + formattedName: "Test string", + groupType: "Test string", + memberCount: 42, + memberResourceNames: [ + "Test string" ], + metadata: { + deleted: true, + updateTime: "Test string", + }, + name: "Test string", + resourceName: "Test string", + }, + }); + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ + await gapi.client.people.contactGroups.members.modify({ + resourceName: "Test string", + }, { + resourceNamesToAdd: [ + "Test string" ], + resourceNamesToRemove: [ + "Test string" ], }); /** Create a new contact and return the person resource for that contact. */ - await gapi.client.people.createContact({ - parent: "parent", + await gapi.client.people.people.createContact({ + }, { + addresses: [ + { + city: "Test string", + country: "Test string", + countryCode: "Test string", + extendedAddress: "Test string", + formattedType: "Test string", + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + poBox: "Test string", + postalCode: "Test string", + region: "Test string", + streetAddress: "Test string", + type: "Test string", + } ], + ageRange: "Test string", + ageRanges: [ + { + ageRange: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + } ], + biographies: [ + { + contentType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + birthdays: [ + { + date: { + day: 42, + month: 42, + year: 42, + }, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + text: "Test string", + } ], + braggingRights: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + coverPhotos: [ + { + default: true, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + url: "Test string", + } ], + emailAddresses: [ + { + displayName: "Test string", + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + etag: "Test string", + events: [ + { + date: { + day: 42, + month: 42, + year: 42, + }, + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + } ], + genders: [ + { + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + imClients: [ + { + formattedProtocol: "Test string", + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + protocol: "Test string", + type: "Test string", + username: "Test string", + } ], + interests: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + locales: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + memberships: [ + { + contactGroupMembership: { + contactGroupId: "Test string", + contactGroupResourceName: "Test string", + }, + domainMembership: { + inViewerDomain: true, + }, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + } ], + metadata: { + deleted: true, + linkedPeopleResourceNames: [ + "Test string" ], + objectType: "Test string", + previousResourceNames: [ + "Test string" ], + sources: [ + { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + } ], + }, + names: [ + { + displayName: "Test string", + displayNameLastFirst: "Test string", + familyName: "Test string", + givenName: "Test string", + honorificPrefix: "Test string", + honorificSuffix: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + middleName: "Test string", + phoneticFamilyName: "Test string", + phoneticFullName: "Test string", + phoneticGivenName: "Test string", + phoneticHonorificPrefix: "Test string", + phoneticHonorificSuffix: "Test string", + phoneticMiddleName: "Test string", + } ], + nicknames: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + occupations: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + organizations: [ + { + current: true, + department: "Test string", + domain: "Test string", + endDate: { + day: 42, + month: 42, + year: 42, + }, + formattedType: "Test string", + jobDescription: "Test string", + location: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + name: "Test string", + phoneticName: "Test string", + startDate: { + day: 42, + month: 42, + year: 42, + }, + symbol: "Test string", + title: "Test string", + type: "Test string", + } ], + phoneNumbers: [ + { + canonicalForm: "Test string", + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + photos: [ + { + default: true, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + url: "Test string", + } ], + relations: [ + { + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + person: "Test string", + type: "Test string", + } ], + relationshipInterests: [ + { + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + relationshipStatuses: [ + { + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + residences: [ + { + current: true, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + resourceName: "Test string", + sipAddresses: [ + { + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + skills: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + taglines: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + urls: [ + { + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + userDefined: [ + { + key: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", }); /** Delete a contact person. Any non-contact data will not be deleted. */ - await gapi.client.people.deleteContact({ - resourceName: "resourceName", + await gapi.client.people.people.deleteContact({ + resourceName: "Test string", + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", + }); + /** Delete a contact's photo. */ + await gapi.client.people.people.deleteContactPhoto({ + personFields: "Test string", + resourceName: "Test string", + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", }); /** * Provides information about a person by specifying a resource name. Use * `people/me` to indicate the authenticated user. - *
+ * * The request throws a 400 error if 'personFields' is not specified. */ - await gapi.client.people.get({ - personFields: "personFields", - "requestMask.includeField": "requestMask.includeField", - resourceName: "resourceName", + await gapi.client.people.people.get({ + personFields: "Test string", + "requestMask.includeField": "Test string", + resourceName: "Test string", + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", }); /** * Provides information about a list of specific people by specifying a list * of requested resource names. Use `people/me` to indicate the authenticated * user. - *
+ * * The request throws a 400 error if 'personFields' is not specified. */ - await gapi.client.people.getBatchGet({ - personFields: "personFields", - "requestMask.includeField": "requestMask.includeField", - resourceNames: "resourceNames", + await gapi.client.people.people.getBatchGet({ + personFields: "Test string", + "requestMask.includeField": "Test string", + resourceNames: "Test string", + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", }); /** * Update contact data for an existing contact person. Any non-contact data * will not be modified. * * The request throws a 400 error if `updatePersonFields` is not specified. - *
+ * * The request throws a 400 error if `person.metadata.sources` is not * specified for the contact to be updated. - *
- * The request throws a 412 error if `person.metadata.sources.etag` is - * different than the contact's etag, which indicates the contact has changed - * since its data was read. Clients should get the latest person and re-apply - * their updates to the latest person. + * + * The request throws a 400 error with an error with reason + * `"failedPrecondition"` if `person.metadata.sources.etag` is different than + * the contact's etag, which indicates the contact has changed since its data + * was read. Clients should get the latest person and re-apply their updates + * to the latest person. */ - await gapi.client.people.updateContact({ - resourceName: "resourceName", - updatePersonFields: "updatePersonFields", + await gapi.client.people.people.updateContact({ + resourceName: "Test string", + updatePersonFields: "Test string", + }, { + addresses: [ + { + city: "Test string", + country: "Test string", + countryCode: "Test string", + extendedAddress: "Test string", + formattedType: "Test string", + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + poBox: "Test string", + postalCode: "Test string", + region: "Test string", + streetAddress: "Test string", + type: "Test string", + } ], + ageRange: "Test string", + ageRanges: [ + { + ageRange: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + } ], + biographies: [ + { + contentType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + birthdays: [ + { + date: { + day: 42, + month: 42, + year: 42, + }, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + text: "Test string", + } ], + braggingRights: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + coverPhotos: [ + { + default: true, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + url: "Test string", + } ], + emailAddresses: [ + { + displayName: "Test string", + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + etag: "Test string", + events: [ + { + date: { + day: 42, + month: 42, + year: 42, + }, + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + } ], + genders: [ + { + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + imClients: [ + { + formattedProtocol: "Test string", + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + protocol: "Test string", + type: "Test string", + username: "Test string", + } ], + interests: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + locales: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + memberships: [ + { + contactGroupMembership: { + contactGroupId: "Test string", + contactGroupResourceName: "Test string", + }, + domainMembership: { + inViewerDomain: true, + }, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + } ], + metadata: { + deleted: true, + linkedPeopleResourceNames: [ + "Test string" ], + objectType: "Test string", + previousResourceNames: [ + "Test string" ], + sources: [ + { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + } ], + }, + names: [ + { + displayName: "Test string", + displayNameLastFirst: "Test string", + familyName: "Test string", + givenName: "Test string", + honorificPrefix: "Test string", + honorificSuffix: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + middleName: "Test string", + phoneticFamilyName: "Test string", + phoneticFullName: "Test string", + phoneticGivenName: "Test string", + phoneticHonorificPrefix: "Test string", + phoneticHonorificSuffix: "Test string", + phoneticMiddleName: "Test string", + } ], + nicknames: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + occupations: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + organizations: [ + { + current: true, + department: "Test string", + domain: "Test string", + endDate: { + day: 42, + month: 42, + year: 42, + }, + formattedType: "Test string", + jobDescription: "Test string", + location: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + name: "Test string", + phoneticName: "Test string", + startDate: { + day: 42, + month: 42, + year: 42, + }, + symbol: "Test string", + title: "Test string", + type: "Test string", + } ], + phoneNumbers: [ + { + canonicalForm: "Test string", + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + photos: [ + { + default: true, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + url: "Test string", + } ], + relations: [ + { + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + person: "Test string", + type: "Test string", + } ], + relationshipInterests: [ + { + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + relationshipStatuses: [ + { + formattedValue: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + residences: [ + { + current: true, + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + resourceName: "Test string", + sipAddresses: [ + { + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + skills: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + taglines: [ + { + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + urls: [ + { + formattedType: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + type: "Test string", + value: "Test string", + } ], + userDefined: [ + { + key: "Test string", + metadata: { + primary: true, + source: { + etag: "Test string", + id: "Test string", + profileMetadata: { + objectType: "Test string", + userTypes: [ + "Test string" ], + }, + type: "Test string", + updateTime: "Test string", + }, + verified: true, + }, + value: "Test string", + } ], + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", + }); + /** Update a contact's photo. */ + await gapi.client.people.people.updateContactPhoto({ + resourceName: "Test string", + }, { + personFields: "Test string", + photoBytes: "Test string", + }); + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + await gapi.client.people.people.connections.list({ + pageSize: 42, + pageToken: "Test string", + personFields: "Test string", + "requestMask.includeField": "Test string", + requestSyncToken: true, + resourceName: "Test string", + sortOrder: "Test string", + syncToken: "Test string", }); } }); diff --git a/types/gapi.client.people/index.d.ts b/types/gapi.client.people/index.d.ts index 5b6168ac47..8844f5f45d 100644 --- a/types/gapi.client.people/index.d.ts +++ b/types/gapi.client.people/index.d.ts @@ -1,25 +1,22 @@ -// Type definitions for non-npm package Google Google People API v1 1.0 +// Type definitions for non-npm package People API v1 1.0 // Project: https://developers.google.com/people/ -// Definitions by: Bolisov Alexey +// Definitions by: Maxim Mazurok // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // IMPORTANT -// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. -// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator // Generated from: https://people.googleapis.com/$discovery/rest?version=v1 +// Revision: 20200318 /// declare namespace gapi.client { - /** Load Google People API v1 */ + /** Load People API v1 */ function load(name: "people", version: "v1"): PromiseLike; function load(name: "people", version: "v1", callback: () => any): void; - const contactGroups: people.ContactGroupsResource; - - const people: people.PeopleResource; - namespace people { interface Address { /** The city of the address. */ @@ -34,7 +31,7 @@ declare namespace gapi.client { /** The extended address of the address; for example, the apartment number. */ extendedAddress?: string; /** - * The read-only type of the address translated and formatted in the viewer's + * Output only. The type of the address translated and formatted in the viewer's * account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; @@ -54,8 +51,8 @@ declare namespace gapi.client { /** The street address. */ streetAddress?: string; /** - * The type of the address. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the address. The type can be custom or one of these predefined + * values: * * * `home` * * `work` @@ -102,26 +99,26 @@ declare namespace gapi.client { */ etag?: string; /** - * The read-only name translated and formatted in the viewer's account locale + * Output only. The name translated and formatted in the viewer's account locale * or the `Accept-Language` HTTP header locale for system groups names. * Group names set by the owner are the same as name. */ formattedName?: string; - /** The read-only contact group type. */ + /** Output only. The contact group type. */ groupType?: string; /** - * The total number of contacts in the group irrespective of max members in + * Output only. The total number of contacts in the group irrespective of max members in * specified in the request. */ memberCount?: number; /** - * The list of contact person resource names that are members of the contact + * Output only. The list of contact person resource names that are members of the contact * group. The field is not populated for LIST requests and can only be updated * through the * [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/members/modify). */ memberResourceNames?: string[]; - /** Metadata about the contact group. */ + /** Output only. Metadata about the contact group. */ metadata?: ContactGroupMetadata; /** * The contact group name set by the group owner or a system provided name @@ -130,30 +127,31 @@ declare namespace gapi.client { name?: string; /** * The resource name for the contact group, assigned by the server. An ASCII - * string, in the form of `contactGroups/`contact_group_id. + * string, in the form of `contactGroups/{contact_group_id}`. */ resourceName?: string; } interface ContactGroupMembership { - /** - * The contact group ID for the contact group membership. The contact group - * ID can be custom or predefined. Possible values include, but are not - * limited to, the following: - * - * * `myContacts` - * * `starred` - * * A numerical ID for user-created groups. - */ + /** Output only. The contact group ID for the contact group membership. */ contactGroupId?: string; + /** + * The resource name for the contact group, assigned by the server. An ASCII + * string, in the form of `contactGroups/{contact_group_id}`. + * Only contact_group_resource_name can be used for modifying memberships. + * Any contact group membership can be removed, but only user group or + * "myContacts" or "starred" system groups memberships can be added. A + * contact must always have at least one contact group membership. + */ + contactGroupResourceName?: string; } interface ContactGroupMetadata { /** - * True if the contact group resource has been deleted. Populated only for + * Output only. True if the contact group resource has been deleted. Populated only for * [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) requests * that include a sync token. */ deleted?: boolean; - /** The time the group was last updated. */ + /** Output only. The time the group was last updated. */ updateTime?: string; } interface ContactGroupResponse { @@ -176,16 +174,20 @@ declare namespace gapi.client { url?: string; } interface CreateContactGroupRequest { - /** The contact group to create. */ + /** Required. The contact group to create. */ contactGroup?: ContactGroup; } interface Date { /** * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. + * if specifying a year by itself or a year and month where the day is not + * significant. */ day?: number; - /** Month of year. Must be from 1 to 12. */ + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a year without a + * month and day. + */ month?: number; /** * Year of date. Must be from 1 to 9999, or 0 if specifying a date without @@ -193,23 +195,30 @@ declare namespace gapi.client { */ year?: number; } + interface DeleteContactPhotoResponse { + /** + * The updated person, if person_fields is set in the + * DeleteContactPhotoRequest; otherwise this will be unset. + */ + person?: Person; + } interface DomainMembership { - /** True if the person is in the viewer's Google Apps domain. */ + /** True if the person is in the viewer's G Suite domain. */ inViewerDomain?: boolean; } interface EmailAddress { /** The display name of the email. */ displayName?: string; /** - * The read-only type of the email address translated and formatted in the + * Output only. The type of the email address translated and formatted in the * viewer's account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; /** Metadata about the email address. */ metadata?: FieldMetadata; /** - * The type of the email address. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the email address. The type can be custom or one of these + * predefined values: * * * `home` * * `work` @@ -219,19 +228,22 @@ declare namespace gapi.client { /** The email address. */ value?: string; } + // tslint:disable-next-line:no-empty-interface + interface Empty { + } interface Event { /** The date of the event. */ date?: Date; /** - * The read-only type of the event translated and formatted in the + * Output only. The type of the event translated and formatted in the * viewer's account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; /** Metadata about the event. */ metadata?: FieldMetadata; /** - * The type of the event. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the event. The type can be custom or one of these predefined + * values: * * * `anniversary` * * `other` @@ -247,7 +259,7 @@ declare namespace gapi.client { /** The source of the field. */ source?: Source; /** - * True if the field is verified; false if the field is unverified. A + * Output only. True if the field is verified; false if the field is unverified. A * verified field is typically a name, email address, phone number, or * website that has been confirmed to be owned by the person. */ @@ -255,16 +267,15 @@ declare namespace gapi.client { } interface Gender { /** - * The read-only value of the gender translated and formatted in the viewer's + * Output only. The value of the gender translated and formatted in the viewer's * account locale or the `Accept-Language` HTTP header locale. */ formattedValue?: string; /** Metadata about the gender. */ metadata?: FieldMetadata; /** - * The gender for the person. The gender can be custom or predefined. - * Possible values include, but are not limited to, the - * following: + * The gender for the person. The gender can be custom or one of these + * predefined values: * * * `male` * * `female` @@ -279,20 +290,20 @@ declare namespace gapi.client { } interface ImClient { /** - * The read-only protocol of the IM client formatted in the viewer's account + * Output only. The protocol of the IM client formatted in the viewer's account * locale or the `Accept-Language` HTTP header locale. */ formattedProtocol?: string; /** - * The read-only type of the IM client translated and formatted in the + * Output only. The type of the IM client translated and formatted in the * viewer's account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; /** Metadata about the IM client. */ metadata?: FieldMetadata; /** - * The protocol of the IM client. The protocol can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The protocol of the IM client. The protocol can be custom or one of these + * predefined values: * * * `aim` * * `msn` @@ -306,8 +317,8 @@ declare namespace gapi.client { */ protocol?: string; /** - * The type of the IM client. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the IM client. The type can be custom or one of these + * predefined values: * * * `home` * * `work` @@ -326,9 +337,16 @@ declare namespace gapi.client { interface ListConnectionsResponse { /** The list of people that the requestor is connected to. */ connections?: Person[]; - /** The token that can be used to retrieve the next page of results. */ + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + */ nextPageToken?: string; - /** The token that can be used to retrieve changes since the last request. */ + /** + * A token, which can be sent as `sync_token` to retrieve changes since the + * last request. Request must set `request_sync_token` to return the sync + * token. + */ nextSyncToken?: string; /** The total number of items in the list without pagination. */ totalItems?: number; @@ -363,35 +381,40 @@ declare namespace gapi.client { interface Membership { /** The contact group membership. */ contactGroupMembership?: ContactGroupMembership; - /** The domain membership. */ + /** Output only. The domain membership. */ domainMembership?: DomainMembership; /** Metadata about the membership. */ metadata?: FieldMetadata; } interface ModifyContactGroupMembersRequest { /** - * The resource names of the contact people to add in the form of in the form - * `people/`person_id. + * Optional. The resource names of the contact people to add in the form of + * `people/{person_id}`. */ resourceNamesToAdd?: string[]; /** - * The resource names of the contact people to remove in the form of in the - * form of `people/`person_id. + * Optional. The resource names of the contact people to remove in the form of + * `people/{person_id}`. */ resourceNamesToRemove?: string[]; } interface ModifyContactGroupMembersResponse { + /** + * The contact people resource names that cannot be removed from their + * last contact group. + */ + canNotRemoveLastContactGroupResourceNames?: string[]; /** The contact people resource names that were not found. */ notFoundResourceNames?: string[]; } interface Name { /** - * The read-only display name formatted according to the locale specified by + * Output only. The display name formatted according to the locale specified by * the viewer's account or the `Accept-Language` HTTP header. */ displayName?: string; /** - * The read-only display name with the last name first formatted according to + * Output only. The display name with the last name first formatted according to * the locale specified by the viewer's account or the * `Accept-Language` HTTP header. */ @@ -443,12 +466,15 @@ declare namespace gapi.client { current?: boolean; /** The person's department at the organization. */ department?: string; - /** The domain name associated with the organization; for example, `google.com`. */ + /** + * The domain name associated with the organization; for example, + * `google.com`. + */ domain?: string; /** The end date when the person left the organization. */ endDate?: Date; /** - * The read-only type of the organization translated and formatted in the + * Output only. The type of the organization translated and formatted in the * viewer's account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; @@ -472,8 +498,8 @@ declare namespace gapi.client { /** The person's job title at the organization. */ title?: string; /** - * The type of the organization. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the organization. The type can be custom or one of these + * predefined values: * * * `work` * * `school` @@ -484,12 +510,12 @@ declare namespace gapi.client { /** The person's street addresses. */ addresses?: Address[]; /** - * **DEPRECATED** (Please use `person.ageRanges` instead)** + * Output only. **DEPRECATED** (Please use `person.ageRanges` instead) * - * The person's read-only age range. + * The person's age range. */ ageRange?: string; - /** The person's read-only age ranges. */ + /** Output only. The person's age ranges. */ ageRanges?: AgeRangeType[]; /** The person's biographies. */ biographies?: Biography[]; @@ -497,7 +523,7 @@ declare namespace gapi.client { birthdays?: Birthday[]; /** The person's bragging rights. */ braggingRights?: BraggingRights[]; - /** The person's read-only cover photos. */ + /** Output only. The person's cover photos. */ coverPhotos?: CoverPhoto[]; /** The person's email addresses. */ emailAddresses?: EmailAddress[]; @@ -516,9 +542,9 @@ declare namespace gapi.client { interests?: Interest[]; /** The person's locale preferences. */ locales?: Locale[]; - /** The person's read-only group memberships. */ + /** The person's group memberships. */ memberships?: Membership[]; - /** Read-only metadata about the person. */ + /** Output only. Metadata about the person. */ metadata?: PersonMetadata; /** The person's names. */ names?: Name[]; @@ -530,25 +556,27 @@ declare namespace gapi.client { organizations?: Organization[]; /** The person's phone numbers. */ phoneNumbers?: PhoneNumber[]; - /** The person's read-only photos. */ + /** Output only. The person's photos. */ photos?: Photo[]; /** The person's relations. */ relations?: Relation[]; - /** The person's read-only relationship interests. */ + /** Output only. The person's relationship interests. */ relationshipInterests?: RelationshipInterest[]; - /** The person's read-only relationship statuses. */ + /** Output only. The person's relationship statuses. */ relationshipStatuses?: RelationshipStatus[]; /** The person's residences. */ residences?: Residence[]; /** * The resource name for the person, assigned by the server. An ASCII string * with a max length of 27 characters, in the form of - * `people/`person_id. + * `people/{person_id}`. */ resourceName?: string; + /** The person's SIP addresses. */ + sipAddresses?: SipAddress[]; /** The person's skills. */ skills?: Skill[]; - /** The person's read-only taglines. */ + /** Output only. The person's taglines. */ taglines?: Tagline[]; /** The person's associated URLs. */ urls?: Url[]; @@ -557,22 +585,22 @@ declare namespace gapi.client { } interface PersonMetadata { /** - * True if the person resource has been deleted. Populated only for + * Output only. True if the person resource has been deleted. Populated only for * [`connections.list`](/people/api/rest/v1/people.connections/list) requests * that include a sync token. */ deleted?: boolean; - /** Resource names of people linked to this resource. */ + /** Output only. Resource names of people linked to this resource. */ linkedPeopleResourceNames?: string[]; /** - * **DEPRECATED** (Please use + * Output only. **DEPRECATED** (Please use * `person.metadata.sources.profileMetadata.objectType` instead) * * The type of the person object. */ objectType?: string; /** - * Any former resource names this person has had. Populated only for + * Output only. Any former resource names this person has had. Populated only for * [`connections.list`](/people/api/rest/v1/people.connections/list) requests * that include a sync token. * @@ -608,20 +636,21 @@ declare namespace gapi.client { } interface PhoneNumber { /** - * The read-only canonicalized [ITU-T E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) + * Output only. The canonicalized [ITU-T + * E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) * form of the phone number. */ canonicalForm?: string; /** - * The read-only type of the phone number translated and formatted in the + * Output only. The type of the phone number translated and formatted in the * viewer's account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; /** Metadata about the phone number. */ metadata?: FieldMetadata; /** - * The type of the phone number. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the phone number. The type can be custom or one of these + * predefined values: * * * `home` * * `work` @@ -650,21 +679,22 @@ declare namespace gapi.client { metadata?: FieldMetadata; /** * The URL of the photo. You can change the desired size by appending a query - * parameter `sz=`size at the end of the url. Example: - * `https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50` + * parameter `sz={size}` at the end of the url, where {size} is the size in + * pixels. Example: + * https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50 */ url?: string; } interface ProfileMetadata { - /** The profile object type. */ + /** Output only. The profile object type. */ objectType?: string; - /** The user types. */ + /** Output only. The user types. */ userTypes?: string[]; } interface Relation { /** - * The type of the relation translated and formatted in the viewer's account - * locale or the locale specified in the Accept-Language HTTP header. + * Output only. The type of the relation translated and formatted in the viewer's + * account locale or the locale specified in the Accept-Language HTTP header. */ formattedType?: string; /** Metadata about the relation. */ @@ -672,8 +702,8 @@ declare namespace gapi.client { /** The name of the other person this relation refers to. */ person?: string; /** - * The person's relation to the other person. The type can be custom or predefined. - * Possible values include, but are not limited to, the following values: + * The person's relation to the other person. The type can be custom or one of + * these predefined values: * * * `spouse` * * `child` @@ -694,17 +724,16 @@ declare namespace gapi.client { } interface RelationshipInterest { /** - * The value of the relationship interest translated and formatted in the - * viewer's account locale or the locale specified in the Accept-Language - * HTTP header. + * Output only. The value of the relationship interest translated and formatted + * in the viewer's account locale or the locale specified in the + * Accept-Language HTTP header. */ formattedValue?: string; /** Metadata about the relationship interest. */ metadata?: FieldMetadata; /** * The kind of relationship the person is looking for. The value can be custom - * or predefined. Possible values include, but are not limited to, the - * following values: + * or one of these predefined values: * * * `friend` * * `date` @@ -715,15 +744,15 @@ declare namespace gapi.client { } interface RelationshipStatus { /** - * The read-only value of the relationship status translated and formatted in + * Output only. The value of the relationship status translated and formatted in * the viewer's account locale or the `Accept-Language` HTTP header locale. */ formattedValue?: string; /** Metadata about the relationship status. */ metadata?: FieldMetadata; /** - * The relationship status. The value can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The relationship status. The value can be custom or one of these + * predefined values: * * * `single` * * `inARelationship` @@ -748,6 +777,31 @@ declare namespace gapi.client { /** The address of the residence. */ value?: string; } + interface SipAddress { + /** + * Output only. The type of the SIP address translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType?: string; + /** Metadata about the SIP address. */ + metadata?: FieldMetadata; + /** + * The type of the SIP address. The type can be custom or or one of these + * predefined values: + * + * * `home` + * * `work` + * * `mobile` + * * `other` + */ + type?: string; + /** + * The SIP address in the + * [RFC 3261 19.1](https://tools.ietf.org/html/rfc3261#section-19.1) SIP URI + * format. + */ + value?: string; + } interface Skill { /** Metadata about the skill. */ metadata?: FieldMetadata; @@ -765,7 +819,7 @@ declare namespace gapi.client { /** The unique identifier within the source type generated by the server. */ id?: string; /** - * **Only populated in `person.metadata.sources`.** + * Output only. **Only populated in `person.metadata.sources`.** * * Metadata about a source of type PROFILE. */ @@ -773,7 +827,7 @@ declare namespace gapi.client { /** The source type. */ type?: string; /** - * **Only populated in `person.metadata.sources`.** + * Output only. **Only populated in `person.metadata.sources`.** * * Last update timestamp of this source. */ @@ -801,20 +855,67 @@ declare namespace gapi.client { value?: string; } interface UpdateContactGroupRequest { - /** The contact group to update. */ + /** Required. The contact group to update. */ contactGroup?: ContactGroup; } + interface UpdateContactPhotoRequest { + /** + * Optional. A field mask to restrict which fields on the person are returned. Multiple + * fields can be specified by separating them with commas. Defaults to empty + * if not set, which will skip the post mutate get. Valid values are: + * + * * addresses + * * ageRanges + * * biographies + * * birthdays + * * braggingRights + * * coverPhotos + * * emailAddresses + * * events + * * genders + * * imClients + * * interests + * * locales + * * memberships + * * metadata + * * names + * * nicknames + * * occupations + * * organizations + * * phoneNumbers + * * photos + * * relations + * * relationshipInterests + * * relationshipStatuses + * * residences + * * sipAddresses + * * skills + * * taglines + * * urls + * * userDefined + */ + personFields?: string; + /** Required. Raw photo bytes */ + photoBytes?: string; + } + interface UpdateContactPhotoResponse { + /** + * The updated person, if person_fields is set in the + * UpdateContactPhotoRequest; otherwise this will be unset. + */ + person?: Person; + } interface Url { /** - * The read-only type of the URL translated and formatted in the viewer's + * Output only. The type of the URL translated and formatted in the viewer's * account locale or the `Accept-Language` HTTP header locale. */ formattedType?: string; /** Metadata about the URL. */ metadata?: FieldMetadata; /** - * The type of the URL. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: + * The type of the URL. The type can be custom or one of these predefined + * values: * * * `home` * * `work` @@ -839,7 +940,13 @@ declare namespace gapi.client { value?: string; } interface MembersResource { - /** Modify the members of a contact group owned by the authenticated user. */ + /** + * Modify the members of a contact group owned by the authenticated user. + * + * The only system contact groups that can have members added are + * `contactGroups/myContacts` and `contactGroups/starred`. Other system + * contact groups are deprecated and can only have contacts removed. + */ modify(request: { /** V1 error format. */ "$.xgafv"?: string; @@ -847,8 +954,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -857,56 +962,82 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** The resource name of the contact group to modify. */ + /** Required. The resource name of the contact group to modify. */ resourceName: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Request body */ + resource: ModifyContactGroupMembersRequest; }): Request; - } - interface ContactGroupsResource { - /** - * Get a list of contact groups owned by the authenticated user by specifying - * a list of contact group resource names. - */ - batchGet(request: { + modify(request: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ fields?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ key?: string; - /** Specifies the maximum number of members to return for each group. */ - maxMembers?: number; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** The resource names of the contact groups to get. */ - resourceNames?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; + /** Required. The resource name of the contact group to modify. */ + resourceName: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }, + body: ModifyContactGroupMembersRequest): Request; + } + interface ContactGroupsResource { + /** + * Get a list of contact groups owned by the authenticated user by specifying + * a list of contact group resource names. + */ + batchGet(request?: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Optional. Specifies the maximum number of members to return for each group. Defaults + * to 0 if not set, which will return zero members. + */ + maxMembers?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The resource names of the contact groups to get. */ + resourceNames?: string | string[]; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request; /** Create a new contact group owned by the authenticated user. */ create(request: { @@ -916,8 +1047,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -926,33 +1055,56 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Request body */ + resource: CreateContactGroupRequest; }): Request; - /** - * Delete an existing contact group owned by the authenticated user by - * specifying a contact group resource name. - */ - delete(request: { + create(request: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; - /** Set to true to also delete the contacts in the specified group. */ + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }, + body: CreateContactGroupRequest): Request; + /** + * Delete an existing contact group owned by the authenticated user by + * specifying a contact group resource name. + */ + delete(request?: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Optional. Set to true to also delete the contacts in the specified group. */ deleteContacts?: boolean; /** Selector specifying which fields to include in a partial response. */ fields?: string; @@ -960,68 +1112,63 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** The resource name of the contact group to delete. */ + /** Required. The resource name of the contact group to delete. */ resourceName: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request<{}>; /** * Get a specific contact group owned by the authenticated user by specifying * a contact group resource name. */ - get(request: { + get(request?: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ fields?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ key?: string; - /** Specifies the maximum number of members to return. */ + /** + * Optional. Specifies the maximum number of members to return. Defaults to 0 if not + * set, which will return zero members. + */ maxMembers?: number; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** The resource name of the contact group to get. */ + /** Required. The resource name of the contact group to get. */ resourceName: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request; /** * List all contact groups owned by the authenticated user. Members of the * contact groups are not populated. */ - list(request: { + list(request?: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1030,29 +1177,30 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** The maximum number of resources to return. */ + /** + * Optional. The maximum number of resources to return. Valid values are between 1 and + * 1000, inclusive. Defaults to 30 if not set or set to 0. + */ pageSize?: number; /** - * The next_page_token value returned from a previous call to + * Optional. The next_page_token value returned from a previous call to * [ListContactGroups](/people/api/rest/v1/contactgroups/list). * Requests the next page of resources. */ pageToken?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** - * A sync token, returned by a previous call to `contactgroups.list`. + * Optional. A sync token, returned by a previous call to `contactgroups.list`. * Only resources changed since the sync token was created will be returned. */ syncToken?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request; /** * Update the name of an existing contact group owned by the authenticated @@ -1065,8 +1213,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1075,40 +1221,68 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** * The resource name for the contact group, assigned by the server. An ASCII - * string, in the form of `contactGroups/`contact_group_id. + * string, in the form of `contactGroups/{contact_group_id}`. */ resourceName: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Request body */ + resource: UpdateContactGroupRequest; }): Request; - members: MembersResource; - } - interface ConnectionsResource { - /** - * Provides a list of the authenticated user's contacts merged with any - * connected profiles. - *
- * The request throws a 400 error if 'personFields' is not specified. - */ - list(request: { + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The resource name for the contact group, assigned by the server. An ASCII + * string, in the form of `contactGroups/{contact_group_id}`. + */ + resourceName: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }, + body: UpdateContactGroupRequest): Request; + members: MembersResource; + } + interface ConnectionsResource { + /** + * Provides a list of the authenticated user's contacts merged with any + * connected profiles. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + list(request?: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1118,15 +1292,21 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ oauth_token?: string; /** - * The number of connections to include in the response. Valid values are - * between 1 and 2000, inclusive. Defaults to 100. + * Optional. The number of connections to include in the response. Valid values are + * between 1 and 2000, inclusive. Defaults to 100 if not set or set to 0. */ pageSize?: number; - /** The token of the page to be returned. */ + /** + * Optional. A page token, received from a previous `ListConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnections` + * must match the call that provided the page token. + */ pageToken?: string; /** - * **Required.** A field mask to restrict which fields on each person are - * returned. Valid values are: + * Required. A field mask to restrict which fields on each person are returned. Multiple + * fields can be specified by separating them with commas. Valid values are: * * * addresses * * ageRanges @@ -1152,44 +1332,50 @@ declare namespace gapi.client { * * relationshipInterests * * relationshipStatuses * * residences + * * sipAddresses * * skills * * taglines * * urls + * * userDefined */ personFields?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** - * **Required.** Comma-separated list of person fields to be included in the - * response. Each path should start with `person.`: for example, - * `person.names` or `person.photos`. + * Required. Comma-separated list of person fields to be included in the response. Each + * path should start with `person.`: for example, `person.names` or + * `person.photos`. */ "requestMask.includeField"?: string; /** - * Whether the response should include a sync token, which can be used to get - * all changes since the last request. + * Optional. Whether the response should include `next_sync_token`, which can be used to + * get all changes since the last request. For subsequent sync requests use + * the `sync_token` param instead. Initial sync requests that specify + * `request_sync_token` have an additional rate limit. */ requestSyncToken?: boolean; - /** The resource name to return connections for. Only `people/me` is valid. */ + /** Required. The resource name to return connections for. Only `people/me` is valid. */ resourceName: string; /** - * The order in which the connections should be sorted. Defaults to + * Optional. The order in which the connections should be sorted. Defaults to * `LAST_MODIFIED_ASCENDING`. */ sortOrder?: string; /** - * A sync token, returned by a previous call to `people.connections.list`. - * Only resources changed since the sync token was created will be returned. + * Optional. A sync token, received from a previous `ListConnections` call. + * Provide this to retrieve only the resources changed since the last request. + * Sync requests that specify `sync_token` have an additional rate limit. + * + * When syncing, all other parameters provided to `ListConnections` + * must match the call that provided the sync token. */ syncToken?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request; } interface PeopleResource { @@ -1201,8 +1387,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1211,29 +1395,24 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** The resource name of the owning person resource. */ - parent?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Request body */ + resource: Person; }): Request; - /** Delete a contact person. Any non-contact data will not be deleted. */ - deleteContact(request: { + createContact(request: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1242,34 +1421,51 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; - /** The resource name of the contact to delete. */ - resourceName: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; - }): Request<{}>; - /** - * Provides information about a person by specifying a resource name. Use - * `people/me` to indicate the authenticated user. - *
- * The request throws a 400 error if 'personFields' is not specified. - */ - get(request: { + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }, + body: Person): Request; + /** Delete a contact person. Any non-contact data will not be deleted. */ + deleteContact(request?: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The resource name of the contact to delete. */ + resourceName: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }): Request<{}>; + /** Delete a contact's photo. */ + deleteContactPhoto(request?: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1279,8 +1475,9 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ oauth_token?: string; /** - * **Required.** A field mask to restrict which fields on the person are - * returned. Valid values are: + * Optional. A field mask to restrict which fields on the person are returned. Multiple + * fields can be specified by separating them with commas. Defaults to empty + * if not set, which will skip the post mutate get. Valid values are: * * * addresses * * ageRanges @@ -1306,55 +1503,120 @@ declare namespace gapi.client { * * relationshipInterests * * relationshipStatuses * * residences + * * sipAddresses * * skills * * taglines * * urls + * * userDefined + */ + personFields?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The resource name of the contact whose photo will be deleted. */ + resourceName: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }): Request; + /** + * Provides information about a person by specifying a resource name. Use + * `people/me` to indicate the authenticated user. + * + * The request throws a 400 error if 'personFields' is not specified. + */ + get(request?: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. A field mask to restrict which fields on the person are returned. Multiple + * fields can be specified by separating them with commas. Valid values are: + * + * * addresses + * * ageRanges + * * biographies + * * birthdays + * * braggingRights + * * coverPhotos + * * emailAddresses + * * events + * * genders + * * imClients + * * interests + * * locales + * * memberships + * * metadata + * * names + * * nicknames + * * occupations + * * organizations + * * phoneNumbers + * * photos + * * relations + * * relationshipInterests + * * relationshipStatuses + * * residences + * * sipAddresses + * * skills + * * taglines + * * urls + * * userDefined */ personFields?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** - * **Required.** Comma-separated list of person fields to be included in the - * response. Each path should start with `person.`: for example, - * `person.names` or `person.photos`. + * Required. Comma-separated list of person fields to be included in the response. Each + * path should start with `person.`: for example, `person.names` or + * `person.photos`. */ "requestMask.includeField"?: string; /** - * The resource name of the person to provide information about. + * Required. The resource name of the person to provide information about. * * - To get information about the authenticated user, specify `people/me`. * - To get information about a google account, specify - * `people/`account_id. + * `people/{account_id}`. * - To get information about a contact, specify the resource name that * identifies the contact as returned by * [`people.connections.list`](/people/api/rest/v1/people.connections/list). */ resourceName: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request; /** * Provides information about a list of specific people by specifying a list * of requested resource names. Use `people/me` to indicate the authenticated * user. - *
+ * * The request throws a 400 error if 'personFields' is not specified. */ - getBatchGet(request: { + getBatchGet(request?: { /** V1 error format. */ "$.xgafv"?: string; /** OAuth access token. */ access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1364,8 +1626,8 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ oauth_token?: string; /** - * **Required.** A field mask to restrict which fields on each person are - * returned. Valid values are: + * Required. A field mask to restrict which fields on each person are returned. Multiple + * fields can be specified by separating them with commas. Valid values are: * * * addresses * * ageRanges @@ -1391,54 +1653,55 @@ declare namespace gapi.client { * * relationshipInterests * * relationshipStatuses * * residences + * * sipAddresses * * skills * * taglines * * urls + * * userDefined */ personFields?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** - * **Required.** Comma-separated list of person fields to be included in the - * response. Each path should start with `person.`: for example, - * `person.names` or `person.photos`. + * Required. Comma-separated list of person fields to be included in the response. Each + * path should start with `person.`: for example, `person.names` or + * `person.photos`. */ "requestMask.includeField"?: string; /** - * The resource names of the people to provide information about. + * Required. The resource names of the people to provide information about. * * - To get information about the authenticated user, specify `people/me`. * - To get information about a google account, specify - * `people/`account_id. + * `people/{account_id}`. * - To get information about a contact, specify the resource name that * identifies the contact as returned by * [`people.connections.list`](/people/api/rest/v1/people.connections/list). * * You can include up to 50 resource names in one request. */ - resourceNames?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; + resourceNames?: string | string[]; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; }): Request; /** * Update contact data for an existing contact person. Any non-contact data * will not be modified. * * The request throws a 400 error if `updatePersonFields` is not specified. - *
+ * * The request throws a 400 error if `person.metadata.sources` is not * specified for the contact to be updated. - *
- * The request throws a 412 error if `person.metadata.sources.etag` is - * different than the contact's etag, which indicates the contact has changed - * since its data was read. Clients should get the latest person and re-apply - * their updates to the latest person. + * + * The request throws a 400 error with an error with reason + * `"failedPrecondition"` if `person.metadata.sources.etag` is different than + * the contact's etag, which indicates the contact has changed since its data + * was read. Clients should get the latest person and re-apply their updates + * to the latest person. */ updateContact(request: { /** V1 error format. */ @@ -1447,8 +1710,6 @@ declare namespace gapi.client { access_token?: string; /** Data format for response. */ alt?: string; - /** OAuth bearer token. */ - bearer_token?: string; /** JSONP */ callback?: string; /** Selector specifying which fields to include in a partial response. */ @@ -1457,8 +1718,6 @@ declare namespace gapi.client { key?: string; /** OAuth 2.0 token for the current user. */ oauth_token?: string; - /** Pretty-print response. */ - pp?: boolean; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ @@ -1466,23 +1725,24 @@ declare namespace gapi.client { /** * The resource name for the person, assigned by the server. An ASCII string * with a max length of 27 characters, in the form of - * `people/`person_id. + * `people/{person_id}`. */ resourceName: string; /** - * **Required.** A field mask to restrict which fields on the person are - * updated. Valid values are: + * Required. A field mask to restrict which fields on the person are updated. Multiple + * fields can be specified by separating them with commas. + * All updated fields will be replaced. Valid values are: * * * addresses * * biographies * * birthdays - * * braggingRights * * emailAddresses * * events * * genders * * imClients * * interests * * locales + * * memberships * * names * * nicknames * * occupations @@ -1490,16 +1750,137 @@ declare namespace gapi.client { * * phoneNumbers * * relations * * residences - * * skills + * * sipAddresses * * urls + * * userDefined */ updatePersonFields?: string; - /** Legacy upload protocol for media (e.g. "media", "multipart"). */ - uploadType?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Request body */ + resource: Person; }): Request; + updateContact(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The resource name for the person, assigned by the server. An ASCII string + * with a max length of 27 characters, in the form of + * `people/{person_id}`. + */ + resourceName: string; + /** + * Required. A field mask to restrict which fields on the person are updated. Multiple + * fields can be specified by separating them with commas. + * All updated fields will be replaced. Valid values are: + * + * * addresses + * * biographies + * * birthdays + * * emailAddresses + * * events + * * genders + * * imClients + * * interests + * * locales + * * memberships + * * names + * * nicknames + * * occupations + * * organizations + * * phoneNumbers + * * relations + * * residences + * * sipAddresses + * * urls + * * userDefined + */ + updatePersonFields?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }, + body: Person): Request; + /** Update a contact's photo. */ + updateContactPhoto(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. Person resource name */ + resourceName: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Request body */ + resource: UpdateContactPhotoRequest; + }): Request; + updateContactPhoto(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. Person resource name */ + resourceName: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + }, + body: UpdateContactPhotoRequest): Request; connections: ConnectionsResource; } + + const contactGroups: ContactGroupsResource; + + const people: PeopleResource; } } diff --git a/types/gapi.client.people/readme.md b/types/gapi.client.people/readme.md index cca9f7d496..16790c8a33 100644 --- a/types/gapi.client.people/readme.md +++ b/types/gapi.client.people/readme.md @@ -1,10 +1,10 @@ -# TypeScript typings for Google People API v1 +# TypeScript typings for People API v1 Provides access to information about profiles and contacts. For detailed description please check [documentation](https://developers.google.com/people/). ## Installing -Install typings for Google People API: +Install typings for People API: ``` npm install @types/gapi.client.people@v1 --save-dev ``` @@ -33,15 +33,12 @@ Don't forget to authenticate your client before sending any request to resources // declare client_id registered in Google Developers Console var client_id = '', scope = [ - // Manage your contacts + // See, edit, download, and permanently delete your contacts 'https://www.googleapis.com/auth/contacts', - // View your contacts + // See and download your contacts 'https://www.googleapis.com/auth/contacts.readonly', - // Know the list of people in your circles, your age range, and language - 'https://www.googleapis.com/auth/plus.login', - // View your street addresses 'https://www.googleapis.com/auth/user.addresses.read', @@ -51,13 +48,16 @@ var client_id = '', // View your email addresses 'https://www.googleapis.com/auth/user.emails.read', + // See your education, work history and org info + 'https://www.googleapis.com/auth/user.organization.read', + // View your phone numbers 'https://www.googleapis.com/auth/user.phonenumbers.read', // View your email address 'https://www.googleapis.com/auth/userinfo.email', - // View your basic profile info + // See your personal info, including any personal info you've made publicly available 'https://www.googleapis.com/auth/userinfo.profile', ], immediate = true; @@ -65,14 +65,14 @@ var client_id = '', gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { if (authResult && !authResult.error) { - /* handle succesfull authorization */ + /* handle successful authorization */ } else { /* handle authorization error */ } }); ``` -After that you can use Google People API resources: +After that you can use People API resources: ```typescript @@ -121,10 +121,15 @@ Delete a contact person. Any non-contact data will not be deleted. */ await gapi.client.people.deleteContact({ resourceName: "resourceName", }); +/* +Delete a contact's photo. +*/ +await gapi.client.people.deleteContactPhoto({ resourceName: "resourceName", }); + /* Provides information about a person by specifying a resource name. Use `people/me` to indicate the authenticated user. -
+ The request throws a 400 error if 'personFields' is not specified. */ await gapi.client.people.get({ resourceName: "resourceName", }); @@ -133,7 +138,7 @@ await gapi.client.people.get({ resourceName: "resourceName", }); Provides information about a list of specific people by specifying a list of requested resource names. Use `people/me` to indicate the authenticated user. -
+ The request throws a 400 error if 'personFields' is not specified. */ await gapi.client.people.getBatchGet({ }); @@ -143,14 +148,20 @@ Update contact data for an existing contact person. Any non-contact data will not be modified. The request throws a 400 error if `updatePersonFields` is not specified. -
+ The request throws a 400 error if `person.metadata.sources` is not specified for the contact to be updated. -
-The request throws a 412 error if `person.metadata.sources.etag` is -different than the contact's etag, which indicates the contact has changed -since its data was read. Clients should get the latest person and re-apply -their updates to the latest person. + +The request throws a 400 error with an error with reason +`"failedPrecondition"` if `person.metadata.sources.etag` is different than +the contact's etag, which indicates the contact has changed since its data +was read. Clients should get the latest person and re-apply their updates +to the latest person. */ -await gapi.client.people.updateContact({ resourceName: "resourceName", }); -``` \ No newline at end of file +await gapi.client.people.updateContact({ resourceName: "resourceName", }); + +/* +Update a contact's photo. +*/ +await gapi.client.people.updateContactPhoto({ resourceName: "resourceName", }); +``` diff --git a/types/gapi.client.people/tsconfig.json b/types/gapi.client.people/tsconfig.json index 924219ea32..d1efbdd81c 100644 --- a/types/gapi.client.people/tsconfig.json +++ b/types/gapi.client.people/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "gapi.client.people-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/gapi.client.people/tslint.json b/types/gapi.client.people/tslint.json index 67b2259f70..378af0914a 100644 --- a/types/gapi.client.people/tslint.json +++ b/types/gapi.client.people/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "await-promise": false + "await-promise": [true, "Request"] } -} \ No newline at end of file +}