Merge pull request #31286 from joshuaobrien/master

fix(gapi.people): replace deprecated RequestMask with PersonFields
This commit is contained in:
Jesse Trinity
2018-12-12 14:30:44 -08:00
committed by GitHub
4 changed files with 9 additions and 9 deletions
+2 -1
View File
@@ -144,7 +144,8 @@ function handleSignoutClick(event: MouseEvent) {
// Load the API and make an API call. Display the results on the screen.
function makeApiCall() {
gapi.client.people.people.get({
resourceName: 'people/me'
resourceName: 'people/me',
personFields: 'names'
}).then((resp) => {
const p = document.createElement('p');
const name = resp.result.names[0].givenName;
+1
View File
@@ -64,6 +64,7 @@
var request = gapi.client.people.people.connections.list({
'resourceName': 'people/me',
'pageSize': 10,
'personFields': 'names'
});
request.execute(function(resp) {
+4 -7
View File
@@ -1,6 +1,7 @@
// Type definitions for Google People API 1.0
// Project: https://developers.google.com/people/
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Joshua O'Brien <https://github.com/joshuaobrien>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -13,7 +14,7 @@ declare namespace gapi.client.people {
resourceName: string;
// Query parameters
requestMask?: RequestMask;
personFields: string;
}
function get(parameters: GetParameters): HttpRequest<Person>;
@@ -21,7 +22,7 @@ declare namespace gapi.client.people {
interface GetBatchGetParameters {
// Query parameters
resourcesName?: string;
requestMask?: RequestMask;
personFields: string;
}
function getBatchGet(parameters: GetBatchGetParameters): HttpRequest<BatchGetResponse>;
@@ -49,7 +50,7 @@ declare namespace gapi.client.people {
pageSize?: number;
sortOrder?: SortOrder;
syncToken?: string;
requestMask?: RequestMask;
personFields: string;
}
interface Response {
@@ -60,10 +61,6 @@ declare namespace gapi.client.people {
}
}
interface RequestMask {
includeField: string;
}
type SourceType = 'SOURCE_TYPE_UNSPECIFIED' | 'ACCOUNT' | 'PROFILE' | 'DOMAIN_PROFILE' | 'CONTACT';
interface Source {
+2 -1
View File
@@ -20,7 +20,8 @@ https://developers.google.com/api-client-library/javascript/reference/referenced
}).then(function() {
// 3. Initialize and make the API request.
return gapi.client.people.people.get({
resourceName: 'people/me'
resourceName: 'people/me',
personFields: 'name'
});
}).then(function(response) {
console.log(response.result);