-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconnections.ts
More file actions
103 lines (84 loc) · 2.67 KB
/
connections.ts
File metadata and controls
103 lines (84 loc) · 2.67 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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../../core/resource';
import * as AccountsAPI from './accounts';
import {
AccountCreateParams,
AccountCreateResponse,
AccountUpdateParams,
AccountUpdateResponse,
Accounts,
} from './accounts';
import { APIPromise } from '../../../core/api-promise';
import { RequestOptions } from '../../../internal/request-options';
export class Connections extends APIResource {
accounts: AccountsAPI.Accounts = new AccountsAPI.Accounts(this._client);
/**
* Create a new connection (new company/provider pair) with a new account
*
* @example
* ```ts
* const connection = await client.sandbox.connections.create({
* provider_id: 'provider_id',
* });
* ```
*/
create(body: ConnectionCreateParams, options?: RequestOptions): APIPromise<ConnectionCreateResponse> {
return this._client.post('/sandbox/connections', { body, ...options, __security: { basicAuth: true } });
}
}
export interface ConnectionCreateResponse {
access_token: string;
/**
* @deprecated [DEPRECATED] Use `connection_id` to associate a connection with an
* access token
*/
account_id: string;
authentication_type: 'credential' | 'api_token' | 'oauth' | 'assisted';
/**
* @deprecated [DEPRECATED] Use `connection_id` to associate a connection with an
* access token
*/
company_id: string;
/**
* The ID of the new connection
*/
connection_id: string;
/**
* The ID of the entity for this connection
*/
entity_id: string;
products: Array<string>;
/**
* The ID of the provider associated with the `access_token`.
*/
provider_id: string;
token_type?: string;
}
export interface ConnectionCreateParams {
/**
* The provider associated with the connection
*/
provider_id: string;
authentication_type?: 'credential' | 'api_token' | 'oauth' | 'assisted';
/**
* Optional: the size of the employer to be created with this connection. Defaults
* to 20. Note that if this is higher than 100, historical payroll data will not be
* generated, and instead only one pay period will be created.
*/
employee_size?: number;
products?: Array<string>;
}
Connections.Accounts = Accounts;
export declare namespace Connections {
export {
type ConnectionCreateResponse as ConnectionCreateResponse,
type ConnectionCreateParams as ConnectionCreateParams,
};
export {
Accounts as Accounts,
type AccountCreateResponse as AccountCreateResponse,
type AccountUpdateResponse as AccountUpdateResponse,
type AccountCreateParams as AccountCreateParams,
type AccountUpdateParams as AccountUpdateParams,
};
}