UNPKG

1.71 kBTypeScriptView Raw
1import { APIRequestContext, GlobalOptions } from './api';
2import { Schema, SchemaResource } from './schema';
3export interface Target {
4 [index: string]: {};
5}
6export declare class Endpoint implements Target, APIRequestContext {
7 _options: GlobalOptions;
8 google: any;
9 [index: string]: {};
10 constructor(options: {});
11 /**
12 * Given a schema, add methods and resources to a target.
13 *
14 * @param {object} target The target to which to apply the schema.
15 * @param {object} rootSchema The top-level schema, so we don't lose track of it
16 * during recursion.
17 * @param {object} schema The current schema from which to extract methods and
18 * resources.
19 * @param {object} context The context to add to each method.
20 */
21 applySchema(target: Target, rootSchema: Schema, schema: SchemaResource, context: APIRequestContext): void;
22 /**
23 * Given a schema, add methods to a target.
24 *
25 * @param {object} target The target to which to apply the methods.
26 * @param {object} rootSchema The top-level schema, so we don't lose track of it
27 * during recursion.
28 * @param {object} schema The current schema from which to extract methods.
29 * @param {object} context The context to add to each method.
30 */
31 private applyMethodsFromSchema;
32 /**
33 * Given a method schema, add a method to a target.
34 *
35 * @param target The target to which to add the method.
36 * @param schema The top-level schema that contains the rootUrl, etc.
37 * @param method The method schema from which to generate the method.
38 * @param context The context to add to the method.
39 */
40 private makeMethod;
41 private getPathParams;
42}