service.d.ts
3.19 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import {Request} from './request';
import {AWSError} from './error';
import {ConfigurationOptions, ConfigBase} from './config-base';
import {Endpoint} from './endpoint';
export interface WaiterConfiguration {
/**
* The number of seconds to wait between requests
*/
delay?: number;
/**
* The maximum number of requests to send while waiting
*/
maxAttempts?: number;
}
export class Service {
/**
* Creates a new service object with a configuration object.
*/
constructor(config?: ServiceConfigurationOptions);
/**
* Defines a new Service class using a service identifier and list of versions including an optional set of features (functions) to apply to the class prototype.
*
* @param {string} serviceIdentifier - the identifier for the service.
* @param {string[]} versions - a list of versions that work with this service.
* @param {Object} features - an object to attach to the prototype.
*/
defineService(serviceIdentifier: string, versions: string[], features?: any): typeof Service;
/**
* Calls an operation on a service with the given input parameters.
*
* @param {string} operation - the name of the operation to call on the service.
* @param {map} params - a map of input options for the operation.
*/
makeRequest(operation: string, params?: {[key: string]: any}, callback?: (err: AWSError, data: any) => void): Request<any, AWSError>;
/**
* Calls an operation on a service with the given input parameters, without any authentication data.
*
* @param {string} operation - the name of the operation to call on the service.
* @param {map} params - a map of input options for the operation.
*/
makeUnauthenticatedRequest(operation: string, params?: {[key: string]: any}, callback?: (err: AWSError, data: any) => void): Request<any, AWSError>;
/**
* Override this method to setup any custom request listeners for each new request to the service.
*/
setupRequestListeners(request: Request<any, AWSError>): void;
/**
* Waits for a given state.
*/
waitFor(state: string, params?: {[key: string]: any, $waiter?: WaiterConfiguration}, callback?: (err: AWSError, data: any) => void): Request<any, AWSError>;
waitFor(state: string, callback?: (err: AWSError, data: any) => void): Request<any, AWSError>;
/**
* The list of API versions supported by this service.
*/
apiVersions: string[];
config: ConfigBase & ServiceConfigurationOptions;
/**
* An Endpoint object representing the endpoint URL for service requests.
*/
endpoint: Endpoint;
}
export interface ServiceConfigurationOptions extends ConfigurationOptions {
/**
* The endpoint URI to send requests to. The default endpoint is built from the configured region.
* The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.
*/
endpoint?: string;
/**
* An optional map of parameters to bind to every request sent by this service object.
* For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
*/
params?: {
[key: string]: any;
}
}