-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathaction-import-request-builder.ts
38 lines (37 loc) · 1.19 KB
/
action-import-request-builder.ts
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
import {
ActionImportParameters,
ODataActionImportRequestConfig
} from '../request';
import { ActionFunctionImportRequestBuilderBase } from '../../odata-common';
/**
* Create an OData request to execute an action import.
* @typeparam ParametersT - Type of the action import parameters
* @typeparam ReturnT - Type of the action import return value
*/
export class ActionImportRequestBuilder<
ParametersT,
ReturnT
> extends ActionFunctionImportRequestBuilderBase<ParametersT, ReturnT> {
/**
* Creates an instance of ActionImportRequestBuilder.
* @param defaultServicePath - Default path for the service the action belongs to
* @param actionImportName - The name of the action import.
* @param responseTransformer - Transformation function for the response
* @param parameters - Parameters to be set in the action
*/
constructor(
defaultServicePath: string,
actionImportName: string,
readonly responseTransformer: (data: any) => ReturnT,
parameters: ActionImportParameters<ParametersT>
) {
super(
responseTransformer,
new ODataActionImportRequestConfig(
defaultServicePath,
actionImportName,
parameters
)
);
}
}