1 | import { GaxiosOptions, GaxiosResponse } from 'gaxios';
|
2 | import { OAuth2Client, GoogleAuth, BaseExternalAccountClient } from 'google-auth-library';
|
3 | import { Endpoint } from './endpoint';
|
4 | export interface APIRequestParams<T = any> {
|
5 | options: MethodOptions;
|
6 | params: T;
|
7 | requiredParams: string[];
|
8 | pathParams: string[];
|
9 | context: APIRequestContext;
|
10 | mediaUrl?: string | null;
|
11 | }
|
12 | export interface GoogleConfigurable {
|
13 | _options: GlobalOptions;
|
14 | }
|
15 | export interface APIRequestContext {
|
16 | google?: GoogleConfigurable;
|
17 | _options: GlobalOptions;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export interface GlobalOptions extends MethodOptions {
|
24 | auth?: GoogleAuth | OAuth2Client | BaseExternalAccountClient | string;
|
25 | universeDomain?: string;
|
26 | universe_domain?: string;
|
27 | }
|
28 | export interface MethodOptions extends GaxiosOptions {
|
29 | apiVersion?: string;
|
30 | rootUrl?: string;
|
31 | http2?: boolean;
|
32 | userAgentDirectives?: UserAgentDirective[];
|
33 | }
|
34 | export interface StreamMethodOptions extends MethodOptions {
|
35 | responseType: 'stream';
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export interface UserAgentDirective {
|
46 | product: string;
|
47 | version: string;
|
48 | comment?: string;
|
49 | }
|
50 | export interface ServiceOptions extends GlobalOptions {
|
51 | version?: string;
|
52 | }
|
53 | export type BodyResponseCallback<T> = (err: Error | null, res?: GaxiosResponse<T> | null) => void;
|
54 | export type APIEndpoint = Readonly<Endpoint & any>;
|