UNPKG

3.96 kBTypeScriptView Raw
1import { HttpOperationResponse, OperationArguments, OperationSpec, RequestOptionsBase, RequestPrepareOptions, ServiceClient, ServiceClientCredentials, ServiceClientOptions, WebResource } from "@azure/ms-rest-js";
2import { TokenCredential } from "@azure/core-auth";
3import { LROPoller } from "./lroPoller";
4import { LROPollState } from "./lroPollStrategy";
5/**
6 * Options to be provided while creating the client.
7 */
8export interface AzureServiceClientOptions extends ServiceClientOptions {
9 /**
10 * @property {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. Default value is: "en-US".
11 */
12 acceptLanguage?: string;
13 /**
14 * @property {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for
15 * Long Running Operations. Default value is 30.
16 */
17 longRunningOperationRetryTimeout?: number;
18}
19/**
20 * @class
21 * Initializes a new instance of the AzureServiceClient class.
22 * @constructor
23 *
24 * @param {msRest.ServiceClientCredentilas} credentials - ApplicationTokenCredentials or
25 * UserTokenCredentials object used for authentication.
26 * @param {AzureServiceClientOptions} options - The parameter options used by AzureServiceClient
27 */
28export declare class AzureServiceClient extends ServiceClient {
29 acceptLanguage: string;
30 /**
31 * The retry timeout in seconds for Long Running Operations. Default value is 30.
32 */
33 longRunningOperationRetryTimeout?: number;
34 constructor(credentials: ServiceClientCredentials | TokenCredential, options?: AzureServiceClientOptions);
35 /**
36 * Send the initial request of a LRO (long running operation) and get back an
37 * LROPoller that provides methods for polling the LRO and checking if the LRO is finished.
38 * @param operationArguments The arguments to the operation.
39 * @param operationSpec The specification for the operation.
40 * @param options Additional options to be sent while making the request.
41 * @returns The LROPoller object that provides methods for interacting with the LRO.
42 */
43 sendLRORequest(operationArguments: OperationArguments, operationSpec: OperationSpec, options?: RequestOptionsBase): Promise<LROPoller>;
44 /**
45 * Provides a mechanism to make a request that will poll and provide the final result.
46 * @param {msRest.RequestPrepareOptions|msRest.WebResource} request - The request object
47 * @param {AzureRequestOptionsBase} [options] Additional options to be sent while making the request
48 * @returns {Promise<msRest.HttpOperationResponse>} The HttpOperationResponse containing the final polling request, response and the responseBody.
49 */
50 sendLongRunningRequest(request: RequestPrepareOptions | WebResource, options?: RequestOptionsBase): Promise<HttpOperationResponse>;
51 /**
52 * Send the initial request of a LRO (long running operation) and get back an
53 * HttpLongRunningOperationResponse that provides methods for polling the LRO and checking if the
54 * LRO is finished.
55 * @param {msRest.RequestPrepareOptions|msRest.WebResource} request - The request object
56 * @param {AzureRequestOptionsBase} [options] Additional options to be sent while making the request
57 * @returns {Promise<LROPoller>} The HttpLongRunningOperationResponse
58 * that provides methods for interacting with the LRO.
59 */
60 beginLongRunningRequest(request: RequestPrepareOptions | WebResource, options?: RequestOptionsBase): Promise<LROPoller>;
61 /**
62 * Restore an LROPoller from the provided LROPollState. This method can be used to recreate an
63 * LROPoller on a different process or machine.
64 */
65 restoreLROPoller(lroPollState: LROPollState): LROPoller;
66}
67export declare function getDefaultUserAgentValue(): string;
68export declare function updateOptionsWithDefaultValues(options?: AzureServiceClientOptions): AzureServiceClientOptions;
69//# sourceMappingURL=azureServiceClient.d.ts.map
\No newline at end of file