Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-auth-library / build / src / auth / refreshclient.d.ts
1 /**
2  * Copyright 2015 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 /// <reference types="node" />
17 import * as stream from 'stream';
18 import { JWTInput } from './credentials';
19 import { GetTokenResponse, OAuth2Client, RefreshOptions } from './oauth2client';
20 export interface UserRefreshClientOptions extends RefreshOptions {
21     clientId?: string;
22     clientSecret?: string;
23     refreshToken?: string;
24 }
25 export declare class UserRefreshClient extends OAuth2Client {
26     _refreshToken?: string | null;
27     /**
28      * User Refresh Token credentials.
29      *
30      * @param clientId The authentication client ID.
31      * @param clientSecret The authentication client secret.
32      * @param refreshToken The authentication refresh token.
33      */
34     constructor(clientId?: string, clientSecret?: string, refreshToken?: string);
35     constructor(options: UserRefreshClientOptions);
36     constructor(clientId?: string, clientSecret?: string, refreshToken?: string);
37     /**
38      * Refreshes the access token.
39      * @param refreshToken An ignored refreshToken..
40      * @param callback Optional callback.
41      */
42     protected refreshTokenNoCache(refreshToken?: string | null): Promise<GetTokenResponse>;
43     /**
44      * Create a UserRefreshClient credentials instance using the given input
45      * options.
46      * @param json The input object.
47      */
48     fromJSON(json: JWTInput): void;
49     /**
50      * Create a UserRefreshClient credentials instance using the given input
51      * stream.
52      * @param inputStream The input stream.
53      * @param callback Optional callback.
54      */
55     fromStream(inputStream: stream.Readable): Promise<void>;
56     fromStream(inputStream: stream.Readable, callback: (err?: Error) => void): void;
57     private fromStreamAsync;
58 }