2 * Copyright 2015 Google Inc. All Rights Reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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 {
22 clientSecret?: string;
23 refreshToken?: string;
25 export declare class UserRefreshClient extends OAuth2Client {
26 _refreshToken?: string | null;
28 * User Refresh Token credentials.
30 * @param clientId The authentication client ID.
31 * @param clientSecret The authentication client secret.
32 * @param refreshToken The authentication refresh token.
34 constructor(clientId?: string, clientSecret?: string, refreshToken?: string);
35 constructor(options: UserRefreshClientOptions);
36 constructor(clientId?: string, clientSecret?: string, refreshToken?: string);
38 * Refreshes the access token.
39 * @param refreshToken An ignored refreshToken..
40 * @param callback Optional callback.
42 protected refreshTokenNoCache(refreshToken?: string | null): Promise<GetTokenResponse>;
44 * Create a UserRefreshClient credentials instance using the given input
46 * @param json The input object.
48 fromJSON(json: JWTInput): void;
50 * Create a UserRefreshClient credentials instance using the given input
52 * @param inputStream The input stream.
53 * @param callback Optional callback.
55 fromStream(inputStream: stream.Readable): Promise<void>;
56 fromStream(inputStream: stream.Readable, callback: (err?: Error) => void): void;
57 private fromStreamAsync;