generator.d.ts
1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { Schema } from 'googleapis-common';
export interface GeneratorOptions {
debug?: boolean;
includePrivate?: boolean;
}
export declare class Generator {
private transporter;
private requestQueue;
private env;
/**
* A multi-line string is turned into one line.
* @param str String to process
* @return Single line string processed
*/
private oneLine;
/**
* Clean a string of comment tags.
* @param str String to process
* @return Single line string processed
*/
private cleanComments;
private getPathParams;
private getSafeParamName;
private hasResourceParam;
private options;
private state;
/**
* Generator for generating API endpoints
* @param options Options for generation
*/
constructor(options?: GeneratorOptions);
/**
* Add a requests to the rate limited queue.
* @param opts Options to pass to the default transporter
*/
private request;
/**
* Log output of generator. Works just like console.log.
*/
private log;
/**
* Write to the state log, which is used for debugging.
* @param id DiscoveryRestUrl of the endpoint to log
* @param message
*/
private logResult;
/**
* Generate all APIs and write to files.
*/
generateAllAPIs(discoveryUrl: string): Promise<void>;
generateIndex(metadata: Schema[]): Promise<void>;
/**
* Given a discovery doc, parse it and recursively iterate over the various
* embedded links.
*/
private getFragmentsForSchema;
/**
* Generate API file given discovery URL
* @param apiDiscoveryUri URL or filename of discovery doc for API
*/
generateAPI(apiDiscoveryUrl: string): Promise<void>;
private generate;
}