DefinitelyTyped/types/gapi.client.oauth2/index.d.ts
Alexey Bolisov 4f8a3d571b Add Google APIs typings (#19083)
* Add Google APIs typings

* [gapi.cliebt.* ] Add version as part of typings name and fix gapi.client tslint errors

* versions should not get their own folders
fixing a few typos
using /** syntax so comments show up in editors
export only actual (last) version for now

* export only actual (last) version for now

* merge namespaces and remove unnecessary namespace qualifiers

* remove namespace qualifier for gapi.client.Request from nested namespaces and change Request base interface to Promise

* disable await-promise rule

* fix collision between gapi.client.Request and Request from nested namespace
disable no-irregular-whitespace rule

* sort properties and namespace resources

* remove empty comments
sort resources amd methods in tests and readme.md

* update 'this is autogenerated file' banner to remove this text from gapi.client namespace hint
use multiline comments when comment has several lines

* implement no-trailing-whitespace, no-padding, max-line-length, await-promise, no-irregular-whitespace rules

* add strictFunctionTypes to tsconfig

* fix "Whitespace within parentheses is not allowed" rule

* fix ts-lint rules

* fixes

* remove deprecated replicapool and replicapoolupdater api

* fix no-irregular-whitespace

* fix no-irregular-whitespace
2017-10-09 14:55:04 -07:00

124 lines
5.7 KiB
TypeScript

// Type definitions for Google Google OAuth2 API v2 2.0
// Project: https://developers.google.com/accounts/docs/OAuth2
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// 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
// Generated from: https://www.googleapis.com/discovery/v1/apis/oauth2/v2/rest
/// <reference types="gapi.client" />
declare namespace gapi.client {
/** Load Google OAuth2 API v2 */
function load(name: "oauth2", version: "v2"): PromiseLike<void>;
function load(name: "oauth2", version: "v2", callback: () => any): void;
const userinfo: oauth2.UserinfoResource;
namespace oauth2 {
interface Jwk {
keys?: Array<{
alg?: string;
e?: string;
kid?: string;
kty?: string;
n?: string;
use?: string;
}>;
}
interface Tokeninfo {
/** The access type granted with this token. It can be offline or online. */
access_type?: string;
/** Who is the intended audience for this token. In general the same as issued_to. */
audience?: string;
/** The email address of the user. Present only if the email scope is present in the request. */
email?: string;
/** The expiry time of the token, as number of seconds left until expiry. */
expires_in?: number;
/** To whom was the token issued to. In general the same as audience. */
issued_to?: string;
/** The space separated list of scopes granted to this token. */
scope?: string;
/** The token handle associated with this token. */
token_handle?: string;
/** The obfuscated user id. */
user_id?: string;
/** Boolean flag which is true if the email address is verified. Present only if the email scope is present in the request. */
verified_email?: boolean;
}
interface Userinfoplus {
/** The user's email address. */
email?: string;
/** The user's last name. */
family_name?: string;
/** The user's gender. */
gender?: string;
/** The user's first name. */
given_name?: string;
/** The hosted domain e.g. example.com if the user is Google apps user. */
hd?: string;
/** The obfuscated ID of the user. */
id?: string;
/** URL of the profile page. */
link?: string;
/** The user's preferred locale. */
locale?: string;
/** The user's full name. */
name?: string;
/** URL of the user's picture image. */
picture?: string;
/** Boolean flag which is true if the email address is verified. Always verified because we only return the user's primary email address. */
verified_email?: boolean;
}
interface MeResource {
get(request: {
/** Data format for the response. */
alt?: 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.
* Overrides userIp if both are provided.
*/
quotaUser?: string;
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
userIp?: string;
}): Request<Userinfoplus>;
}
interface V2Resource {
me: MeResource;
}
interface UserinfoResource {
get(request: {
/** Data format for the response. */
alt?: 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.
* Overrides userIp if both are provided.
*/
quotaUser?: string;
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
userIp?: string;
}): Request<Userinfoplus>;
v2: V2Resource;
}
}
}