-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrequest-forwarding.ts
More file actions
122 lines (105 loc) · 3.77 KB
/
request-forwarding.ts
File metadata and controls
122 lines (105 loc) · 3.77 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class RequestForwarding extends APIResource {
/**
* The Forward API allows you to make direct requests to an employment system. If
* Finch's unified API doesn't have a data model that cleanly fits your needs, then
* Forward allows you to push or pull data models directly against an integration's
* API.
*/
forward(
body: RequestForwardingForwardParams,
options?: RequestOptions,
): APIPromise<RequestForwardingForwardResponse> {
return this._client.post('/forward', { body, ...options, __security: { bearerAuth: true } });
}
}
export interface RequestForwardingForwardResponse {
/**
* An object containing details of your original forwarded request, for your ease
* of reference.
*/
request: RequestForwardingForwardResponse.Request;
/**
* The HTTP status code of the forwarded request's response, exactly received from
* the underlying integration's API. This value will be returned as an integer.
*/
statusCode: number;
/**
* A string representation of the HTTP response body of the forwarded request's
* response received from the underlying integration's API. This field may be null
* in the case where the upstream system's response is empty.
*/
data?: string | null;
/**
* The HTTP headers of the forwarded request's response, exactly as received from
* the underlying integration's API.
*/
headers?: { [key: string]: unknown } | null;
}
export namespace RequestForwardingForwardResponse {
/**
* An object containing details of your original forwarded request, for your ease
* of reference.
*/
export interface Request {
/**
* The HTTP method that was specified for the forwarded request. Valid values
* include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`.
*/
method: string;
/**
* The URL route path that was specified for the forwarded request.
*/
route: string;
/**
* The body that was specified for the forwarded request.
*/
data?: string | { [key: string]: unknown } | null;
/**
* The HTTP headers that were specified for the forwarded request.
*/
headers?: { [key: string]: string } | null;
/**
* The query parameters that were specified for the forwarded request.
*/
params?: { [key: string]: unknown } | null;
}
}
export interface RequestForwardingForwardParams {
/**
* The HTTP method for the forwarded request. Valid values include: `GET` , `POST`
* , `PUT` , `DELETE` , and `PATCH`.
*/
method: string;
/**
* The URL route path for the forwarded request. This value must begin with a
* forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and
* underscores.
*/
route: string;
/**
* The body for the forwarded request. This value must be specified as either a
* string or a valid JSON object.
*/
data?: string | null;
/**
* The query parameters for the forwarded request. This value must be specified as
* a valid JSON object rather than a query string.
*/
params?: { [key: string]: unknown } | null;
/**
* The HTTP headers to include on the forwarded request. This value must be
* specified as an object of key-value pairs. Example:
* `{"Content-Type": "application/xml", "X-API-Version": "v1" }`
*/
request_headers?: { [key: string]: unknown } | null;
}
export declare namespace RequestForwarding {
export {
type RequestForwardingForwardResponse as RequestForwardingForwardResponse,
type RequestForwardingForwardParams as RequestForwardingForwardParams,
};
}