UNPKG

2.86 kBTypeScriptView Raw
1/**
2 * These are a collection of interfaces that represent the GoogleApis
3 * Discovery json formats.
4 */
5export interface Schemas {
6 discoveryVersion: string;
7 kind: string;
8 items: Schema[];
9}
10export interface Schema {
11 auth: {
12 oauth2: {
13 scopes: {
14 [index: string]: {
15 description: string;
16 };
17 };
18 };
19 };
20 basePath: string;
21 baseUrl: string;
22 batchPath: string;
23 description: string;
24 discoveryVersion: string;
25 discoveryRestUrl: string;
26 documentationLink: string;
27 etag: string;
28 icons: {
29 x16: string;
30 x32: string;
31 };
32 id: string;
33 kind: string;
34 methods: SchemaMethods;
35 name: string;
36 ownerDomain: string;
37 ownerName: string;
38 parameters: SchemaParameters;
39 protocol: string;
40 resources: SchemaResources;
41 revision: string;
42 rootUrl: string;
43 schemas: SchemaItems;
44 servicePath: string;
45 title: string;
46 version: string;
47}
48export interface SchemaResources {
49 [index: string]: SchemaResource;
50}
51export interface SchemaResource {
52 methods?: SchemaMethods;
53 resources?: SchemaResources;
54}
55export interface SchemaItems {
56 [index: string]: SchemaItem;
57}
58export interface SchemaItem {
59 description?: string;
60 default?: string;
61 id?: string;
62 properties?: {
63 [index: string]: SchemaItem;
64 };
65 additionalProperties?: {
66 [index: string]: SchemaItem;
67 };
68 items?: {
69 [index: string]: SchemaItem;
70 };
71 type?: SchemaType;
72 format?: ParameterFormat;
73 $ref?: string;
74}
75export interface SchemaParameters {
76 [index: string]: SchemaParameter;
77}
78export interface SchemaParameter {
79 default: string;
80 description: string;
81 location: string;
82 enum: string[];
83 enumDescription: string[];
84 type: SchemaType;
85 format: ParameterFormat;
86 required: boolean;
87}
88export interface SchemaMethods {
89 [index: string]: SchemaMethod;
90}
91export interface SchemaMethod {
92 description: string;
93 httpMethod: HttpMethod;
94 id: string;
95 parameterOrder?: string[];
96 parameters?: {
97 [index: string]: SchemaParameter;
98 };
99 path: string;
100 request: {
101 $ref: string;
102 };
103 response: {
104 $ref: string;
105 };
106 sampleUrl: string;
107 scopes: string[];
108 fragment: string;
109 mediaUpload: {
110 protocols: {
111 simple: {
112 path: string;
113 };
114 };
115 };
116 supportsMediaDownload?: boolean;
117}
118export interface FragmentResponse {
119 codeFragment: {
120 [index: string]: {
121 fragment: string;
122 };
123 };
124}
125export declare type ParameterFormat = 'int32';
126export declare type HttpMethod = 'GET' | 'PATCH' | 'PUT';
127export declare type SchemaType = 'object' | 'integer' | 'string' | 'array' | 'boolean';