@tryfinch/finch-api 6.27.0 → 6.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/resources/access-tokens.d.ts +8 -0
  5. package/resources/access-tokens.d.ts.map +1 -1
  6. package/resources/access-tokens.js +8 -0
  7. package/resources/access-tokens.js.map +1 -1
  8. package/resources/access-tokens.mjs +8 -0
  9. package/resources/access-tokens.mjs.map +1 -1
  10. package/resources/hris/benefits/benefits.d.ts +73 -0
  11. package/resources/hris/benefits/benefits.d.ts.map +1 -1
  12. package/resources/hris/benefits/benefits.js +23 -0
  13. package/resources/hris/benefits/benefits.js.map +1 -1
  14. package/resources/hris/benefits/benefits.mjs +23 -0
  15. package/resources/hris/benefits/benefits.mjs.map +1 -1
  16. package/resources/hris/benefits/individuals.d.ts +35 -0
  17. package/resources/hris/benefits/individuals.d.ts.map +1 -1
  18. package/resources/hris/benefits/individuals.js +8 -0
  19. package/resources/hris/benefits/individuals.js.map +1 -1
  20. package/resources/hris/benefits/individuals.mjs +8 -0
  21. package/resources/hris/benefits/individuals.mjs.map +1 -1
  22. package/resources/hris/company/company.d.ts +15 -10
  23. package/resources/hris/company/company.d.ts.map +1 -1
  24. package/resources/hris/company/company.js +5 -0
  25. package/resources/hris/company/company.js.map +1 -1
  26. package/resources/hris/company/company.mjs +5 -0
  27. package/resources/hris/company/company.mjs.map +1 -1
  28. package/resources/hris/company/pay-statement-item/pay-statement-item.d.ts +8 -0
  29. package/resources/hris/company/pay-statement-item/pay-statement-item.d.ts.map +1 -1
  30. package/resources/hris/company/pay-statement-item/pay-statement-item.js.map +1 -1
  31. package/resources/hris/company/pay-statement-item/pay-statement-item.mjs.map +1 -1
  32. package/resources/hris/company/pay-statement-item/rules.d.ts +30 -0
  33. package/resources/hris/company/pay-statement-item/rules.d.ts.map +1 -1
  34. package/resources/hris/company/pay-statement-item/rules.js +16 -0
  35. package/resources/hris/company/pay-statement-item/rules.js.map +1 -1
  36. package/resources/hris/company/pay-statement-item/rules.mjs +16 -0
  37. package/resources/hris/company/pay-statement-item/rules.mjs.map +1 -1
  38. package/resources/hris/directory.d.ts +16 -8
  39. package/resources/hris/directory.d.ts.map +1 -1
  40. package/resources/hris/directory.js.map +1 -1
  41. package/resources/hris/directory.mjs.map +1 -1
  42. package/resources/hris/documents.d.ts +12 -0
  43. package/resources/hris/documents.d.ts.map +1 -1
  44. package/resources/hris/documents.js +7 -0
  45. package/resources/hris/documents.js.map +1 -1
  46. package/resources/hris/documents.mjs +7 -0
  47. package/resources/hris/documents.mjs.map +1 -1
  48. package/resources/hris/employments.d.ts +122 -103
  49. package/resources/hris/employments.d.ts.map +1 -1
  50. package/resources/hris/employments.js +10 -0
  51. package/resources/hris/employments.js.map +1 -1
  52. package/resources/hris/employments.mjs +10 -0
  53. package/resources/hris/employments.mjs.map +1 -1
  54. package/resources/hris/hris.d.ts +12 -12
  55. package/resources/hris/hris.d.ts.map +1 -1
  56. package/resources/hris/individuals.d.ts +73 -56
  57. package/resources/hris/individuals.d.ts.map +1 -1
  58. package/resources/hris/individuals.js.map +1 -1
  59. package/resources/hris/individuals.mjs.map +1 -1
  60. package/resources/hris/pay-statements.d.ts +16 -0
  61. package/resources/hris/pay-statements.d.ts.map +1 -1
  62. package/resources/hris/pay-statements.js +16 -0
  63. package/resources/hris/pay-statements.js.map +1 -1
  64. package/resources/hris/pay-statements.mjs +16 -0
  65. package/resources/hris/pay-statements.mjs.map +1 -1
  66. package/resources/hris/payments.d.ts +11 -0
  67. package/resources/hris/payments.d.ts.map +1 -1
  68. package/resources/hris/payments.js +11 -0
  69. package/resources/hris/payments.js.map +1 -1
  70. package/resources/hris/payments.mjs +11 -0
  71. package/resources/hris/payments.mjs.map +1 -1
  72. package/resources/request-forwarding.d.ts +10 -0
  73. package/resources/request-forwarding.d.ts.map +1 -1
  74. package/resources/request-forwarding.js +10 -0
  75. package/resources/request-forwarding.js.map +1 -1
  76. package/resources/request-forwarding.mjs +10 -0
  77. package/resources/request-forwarding.mjs.map +1 -1
  78. package/resources/sandbox/company.d.ts +23 -0
  79. package/resources/sandbox/company.d.ts.map +1 -1
  80. package/resources/sandbox/company.js +23 -0
  81. package/resources/sandbox/company.js.map +1 -1
  82. package/resources/sandbox/company.mjs +23 -0
  83. package/resources/sandbox/company.mjs.map +1 -1
  84. package/resources/sandbox/connections/accounts.d.ts +17 -0
  85. package/resources/sandbox/connections/accounts.d.ts.map +1 -1
  86. package/resources/sandbox/connections/accounts.js +9 -0
  87. package/resources/sandbox/connections/accounts.js.map +1 -1
  88. package/resources/sandbox/connections/accounts.mjs +9 -0
  89. package/resources/sandbox/connections/accounts.mjs.map +1 -1
  90. package/resources/sandbox/connections/connections.d.ts +7 -0
  91. package/resources/sandbox/connections/connections.d.ts.map +1 -1
  92. package/resources/sandbox/connections/connections.js +7 -0
  93. package/resources/sandbox/connections/connections.js.map +1 -1
  94. package/resources/sandbox/connections/connections.mjs +7 -0
  95. package/resources/sandbox/connections/connections.mjs.map +1 -1
  96. package/resources/sandbox/directory.d.ts +7 -0
  97. package/resources/sandbox/directory.d.ts.map +1 -1
  98. package/resources/sandbox/directory.js.map +1 -1
  99. package/resources/sandbox/directory.mjs.map +1 -1
  100. package/resources/sandbox/employment.d.ts +7 -0
  101. package/resources/sandbox/employment.d.ts.map +1 -1
  102. package/resources/sandbox/employment.js.map +1 -1
  103. package/resources/sandbox/employment.mjs.map +1 -1
  104. package/resources/sandbox/individual.d.ts +7 -0
  105. package/resources/sandbox/individual.d.ts.map +1 -1
  106. package/resources/sandbox/individual.js.map +1 -1
  107. package/resources/sandbox/individual.mjs.map +1 -1
  108. package/resources/sandbox/jobs/configuration.d.ts +15 -0
  109. package/resources/sandbox/jobs/configuration.d.ts.map +1 -1
  110. package/resources/sandbox/jobs/configuration.js +15 -0
  111. package/resources/sandbox/jobs/configuration.js.map +1 -1
  112. package/resources/sandbox/jobs/configuration.mjs +15 -0
  113. package/resources/sandbox/jobs/configuration.mjs.map +1 -1
  114. package/resources/sandbox/jobs/jobs.d.ts +7 -0
  115. package/resources/sandbox/jobs/jobs.d.ts.map +1 -1
  116. package/resources/sandbox/jobs/jobs.js +7 -0
  117. package/resources/sandbox/jobs/jobs.js.map +1 -1
  118. package/resources/sandbox/jobs/jobs.mjs +7 -0
  119. package/resources/sandbox/jobs/jobs.mjs.map +1 -1
  120. package/resources/sandbox/payment.d.ts +19 -0
  121. package/resources/sandbox/payment.d.ts.map +1 -1
  122. package/resources/sandbox/payment.js.map +1 -1
  123. package/resources/sandbox/payment.mjs.map +1 -1
  124. package/resources/shared.d.ts +4 -4
  125. package/resources/shared.d.ts.map +1 -1
  126. package/src/resources/access-tokens.ts +8 -0
  127. package/src/resources/hris/benefits/benefits.ts +83 -0
  128. package/src/resources/hris/benefits/individuals.ts +35 -0
  129. package/src/resources/hris/company/company.ts +15 -10
  130. package/src/resources/hris/company/pay-statement-item/pay-statement-item.ts +8 -0
  131. package/src/resources/hris/company/pay-statement-item/rules.ts +30 -0
  132. package/src/resources/hris/directory.ts +16 -8
  133. package/src/resources/hris/documents.ts +12 -0
  134. package/src/resources/hris/employments.ts +139 -115
  135. package/src/resources/hris/hris.ts +14 -14
  136. package/src/resources/hris/individuals.ts +96 -74
  137. package/src/resources/hris/pay-statements.ts +16 -0
  138. package/src/resources/hris/payments.ts +11 -0
  139. package/src/resources/request-forwarding.ts +10 -0
  140. package/src/resources/sandbox/company.ts +23 -0
  141. package/src/resources/sandbox/connections/accounts.ts +17 -0
  142. package/src/resources/sandbox/connections/connections.ts +7 -0
  143. package/src/resources/sandbox/directory.ts +7 -0
  144. package/src/resources/sandbox/employment.ts +7 -0
  145. package/src/resources/sandbox/individual.ts +7 -0
  146. package/src/resources/sandbox/jobs/configuration.ts +15 -0
  147. package/src/resources/sandbox/jobs/jobs.ts +7 -0
  148. package/src/resources/sandbox/payment.ts +19 -0
  149. package/src/resources/shared.ts +4 -4
  150. package/src/version.ts +1 -1
  151. package/version.d.ts +1 -1
  152. package/version.js +1 -1
  153. package/version.mjs +1 -1
@@ -8,6 +8,16 @@ import { ResponsesPage } from '../../pagination';
8
8
  export class Employments extends APIResource {
9
9
  /**
10
10
  * Read individual employment and income data
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // Automatically fetches more pages as needed.
15
+ * for await (const employmentDataResponse of client.hris.employments.retrieveMany(
16
+ * { requests: [{ individual_id: 'individual_id' }] },
17
+ * )) {
18
+ * // ...
19
+ * }
20
+ * ```
11
21
  */
12
22
  retrieveMany(
13
23
  body: EmploymentRetrieveManyParams,
@@ -23,161 +33,175 @@ export class Employments extends APIResource {
23
33
 
24
34
  export class EmploymentDataResponsesPage extends ResponsesPage<EmploymentDataResponse> {}
25
35
 
26
- export interface EmploymentData {
27
- /**
28
- * A stable Finch `id` (UUID v4) for an individual in the company.
29
- */
30
- id?: string;
31
-
32
- /**
33
- * Worker's compensation classification code for this employee
34
- */
35
- class_code?: string | null;
36
+ export type EmploymentData = EmploymentData.UnionMember0 | EmploymentData.BatchError;
36
37
 
37
- /**
38
- * Custom fields for the individual. These are fields which are defined by the
39
- * employer in the system.
40
- */
41
- custom_fields?: Array<EmploymentData.CustomField> | null;
42
-
43
- /**
44
- * The department object.
45
- */
46
- department?: EmploymentData.Department | null;
38
+ export namespace EmploymentData {
39
+ export interface UnionMember0 {
40
+ /**
41
+ * A stable Finch `id` (UUID v4) for an individual in the company.
42
+ */
43
+ id: string;
47
44
 
48
- /**
49
- * The employment object.
50
- */
51
- employment?: EmploymentData.Employment | null;
45
+ /**
46
+ * Worker's compensation classification code for this employee
47
+ */
48
+ class_code: string | null;
52
49
 
53
- /**
54
- * The detailed employment status of the individual. Available options: `active`,
55
- * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`.
56
- */
57
- employment_status?:
58
- | 'active'
59
- | 'deceased'
60
- | 'leave'
61
- | 'onboarding'
62
- | 'prehire'
63
- | 'retired'
64
- | 'terminated'
65
- | null;
66
-
67
- end_date?: string | null;
50
+ /**
51
+ * Custom fields for the individual. These are fields which are defined by the
52
+ * employer in the system.
53
+ */
54
+ custom_fields: Array<UnionMember0.CustomField> | null;
68
55
 
69
- /**
70
- * The legal first name of the individual.
71
- */
72
- first_name?: string | null;
56
+ /**
57
+ * The department object.
58
+ */
59
+ department: UnionMember0.Department | null;
73
60
 
74
- /**
75
- * The employee's income as reported by the provider. This may not always be
76
- * annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc,
77
- * depending on what information the provider returns.
78
- */
79
- income?: HRISAPI.Income | null;
61
+ /**
62
+ * The employment object.
63
+ */
64
+ employment: UnionMember0.Employment | null;
80
65
 
81
- /**
82
- * The array of income history.
83
- */
84
- income_history?: Array<HRISAPI.Income | null> | null;
66
+ /**
67
+ * The detailed employment status of the individual. Available options: `active`,
68
+ * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`.
69
+ */
70
+ employment_status:
71
+ | 'active'
72
+ | 'deceased'
73
+ | 'leave'
74
+ | 'onboarding'
75
+ | 'prehire'
76
+ | 'retired'
77
+ | 'terminated'
78
+ | null;
79
+
80
+ end_date: string | null;
85
81
 
86
- /**
87
- * `true` if the individual an an active employee or contractor at the company.
88
- */
89
- is_active?: boolean | null;
82
+ /**
83
+ * The legal first name of the individual.
84
+ */
85
+ first_name: string | null;
90
86
 
91
- /**
92
- * The legal last name of the individual.
93
- */
94
- last_name?: string | null;
87
+ /**
88
+ * `true` if the individual an an active employee or contractor at the company.
89
+ */
90
+ is_active: boolean | null;
95
91
 
96
- latest_rehire_date?: string | null;
92
+ /**
93
+ * The legal last name of the individual.
94
+ */
95
+ last_name: string | null;
97
96
 
98
- location?: HRISAPI.Location | null;
97
+ latest_rehire_date: string | null;
99
98
 
100
- /**
101
- * The manager object representing the manager of the individual within the org.
102
- */
103
- manager?: EmploymentData.Manager | null;
99
+ location: HRISAPI.Location | null;
104
100
 
105
- /**
106
- * The legal middle name of the individual.
107
- */
108
- middle_name?: string | null;
101
+ /**
102
+ * The manager object representing the manager of the individual within the org.
103
+ */
104
+ manager: UnionMember0.Manager | null;
109
105
 
110
- /**
111
- * The source system's unique employment identifier for this individual
112
- */
113
- source_id?: string | null;
106
+ /**
107
+ * The legal middle name of the individual.
108
+ */
109
+ middle_name: string | null;
114
110
 
115
- start_date?: string | null;
111
+ /**
112
+ * The source system's unique employment identifier for this individual
113
+ */
114
+ source_id: string | null;
116
115
 
117
- /**
118
- * The current title of the individual.
119
- */
120
- title?: string | null;
116
+ start_date: string | null;
121
117
 
122
- /**
123
- * @deprecated This field is deprecated in favour of `source_id`
124
- */
125
- work_id?: string | null;
126
- }
118
+ /**
119
+ * The current title of the individual.
120
+ */
121
+ title: string | null;
127
122
 
128
- export namespace EmploymentData {
129
- export interface CustomField {
130
- name?: string;
123
+ /**
124
+ * @deprecated This field is deprecated in favour of `source_id`
125
+ */
126
+ work_id: string | null;
131
127
 
132
- value?: unknown;
133
- }
128
+ /**
129
+ * The employee's income as reported by the provider. This may not always be
130
+ * annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc,
131
+ * depending on what information the provider returns.
132
+ */
133
+ income?: HRISAPI.Income | null;
134
134
 
135
- /**
136
- * The department object.
137
- */
138
- export interface Department {
139
135
  /**
140
- * The name of the department associated with the individual.
136
+ * The array of income history.
141
137
  */
142
- name?: string | null;
138
+ income_history?: Array<HRISAPI.Income | null> | null;
143
139
  }
144
140
 
145
- /**
146
- * The employment object.
147
- */
148
- export interface Employment {
141
+ export namespace UnionMember0 {
142
+ export interface CustomField {
143
+ name?: string;
144
+
145
+ value?: string | Array<unknown> | unknown | number | boolean | null;
146
+ }
147
+
149
148
  /**
150
- * The secondary employment type of the individual. Options: `full_time`,
151
- * `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
149
+ * The department object.
152
150
  */
153
- subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor' | null;
151
+ export interface Department {
152
+ /**
153
+ * The name of the department associated with the individual.
154
+ */
155
+ name: string | null;
156
+ }
154
157
 
155
158
  /**
156
- * The main employment type of the individual.
159
+ * The employment object.
157
160
  */
158
- type?: 'employee' | 'contractor' | null;
159
- }
161
+ export interface Employment {
162
+ /**
163
+ * The secondary employment type of the individual. Options: `full_time`,
164
+ * `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
165
+ */
166
+ subtype: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor' | null;
167
+
168
+ /**
169
+ * The main employment type of the individual.
170
+ */
171
+ type: 'employee' | 'contractor' | null;
172
+ }
160
173
 
161
- /**
162
- * The manager object representing the manager of the individual within the org.
163
- */
164
- export interface Manager {
165
174
  /**
166
- * A stable Finch `id` (UUID v4) for an individual in the company.
175
+ * The manager object representing the manager of the individual within the org.
167
176
  */
168
- id?: string;
177
+ export interface Manager {
178
+ /**
179
+ * A stable Finch `id` (UUID v4) for an individual in the company.
180
+ */
181
+ id: string;
182
+ }
183
+ }
184
+
185
+ export interface BatchError {
186
+ code: number;
187
+
188
+ message: string;
189
+
190
+ name: string;
191
+
192
+ finch_code?: string;
169
193
  }
170
194
  }
171
195
 
172
196
  export interface EmploymentDataResponse {
173
- body?: EmploymentData;
197
+ body: EmploymentData;
174
198
 
175
- code?: number;
199
+ code: number;
176
200
 
177
201
  /**
178
202
  * A stable Finch `id` (UUID v4) for an individual in the company.
179
203
  */
180
- individual_id?: string;
204
+ individual_id: string;
181
205
  }
182
206
 
183
207
  export interface EmploymentRetrieveManyParams {
@@ -88,23 +88,23 @@ export interface Income {
88
88
  /**
89
89
  * The income amount in cents.
90
90
  */
91
- amount?: number | null;
91
+ amount: number | null;
92
92
 
93
93
  /**
94
94
  * The currency code.
95
95
  */
96
- currency?: string | null;
96
+ currency: string | null;
97
97
 
98
98
  /**
99
99
  * The date the income amount went into effect.
100
100
  */
101
- effective_date?: string | null;
101
+ effective_date: string | null;
102
102
 
103
103
  /**
104
104
  * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`,
105
105
  * `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`.
106
106
  */
107
- unit?:
107
+ unit:
108
108
  | 'yearly'
109
109
  | 'quarterly'
110
110
  | 'monthly'
@@ -121,36 +121,36 @@ export interface Location {
121
121
  /**
122
122
  * City, district, suburb, town, or village.
123
123
  */
124
- city?: string | null;
124
+ city: string | null;
125
125
 
126
126
  /**
127
127
  * The 2-letter ISO 3166 country code.
128
128
  */
129
- country?: string | null;
129
+ country: string | null;
130
130
 
131
131
  /**
132
132
  * Street address or PO box.
133
133
  */
134
- line1?: string | null;
134
+ line1: string | null;
135
135
 
136
136
  /**
137
137
  * Apartment, suite, unit, or building.
138
138
  */
139
- line2?: string | null;
140
-
141
- name?: string | null;
139
+ line2: string | null;
142
140
 
143
141
  /**
144
142
  * The postal code or zip code.
145
143
  */
146
- postal_code?: string | null;
147
-
148
- source_id?: string | null;
144
+ postal_code: string | null;
149
145
 
150
146
  /**
151
147
  * The state code.
152
148
  */
153
- state?: string | null;
149
+ state: string | null;
150
+
151
+ name?: string | null;
152
+
153
+ source_id?: string | null;
154
154
  }
155
155
 
156
156
  export interface Money {
@@ -9,6 +9,14 @@ import { ResponsesPage } from '../../pagination';
9
9
  export class Individuals extends APIResource {
10
10
  /**
11
11
  * Read individual data, excluding income and employment data
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * // Automatically fetches more pages as needed.
16
+ * for await (const individualResponse of client.hris.individuals.retrieveMany()) {
17
+ * // ...
18
+ * }
19
+ * ```
12
20
  */
13
21
  retrieveMany(
14
22
  body?: IndividualRetrieveManyParams,
@@ -32,95 +40,109 @@ export class Individuals extends APIResource {
32
40
 
33
41
  export class IndividualResponsesPage extends ResponsesPage<IndividualResponse> {}
34
42
 
35
- export interface Individual {
36
- /**
37
- * A stable Finch `id` (UUID v4) for an individual in the company.
38
- */
39
- id?: string;
40
-
41
- dob?: string | null;
43
+ export type Individual = Individual.UnionMember0 | Individual.BatchError;
42
44
 
43
- emails?: Array<Individual.Email> | null;
44
-
45
- /**
46
- * Social Security Number of the individual in **encrypted** format. This field is
47
- * only available with the `ssn` scope enabled and the
48
- * `options: { include: ['ssn'] }` param set in the body.
49
- */
50
- encrypted_ssn?: string | null;
51
-
52
- /**
53
- * The EEOC-defined ethnicity of the individual.
54
- */
55
- ethnicity?:
56
- | 'asian'
57
- | 'white'
58
- | 'black_or_african_american'
59
- | 'native_hawaiian_or_pacific_islander'
60
- | 'american_indian_or_alaska_native'
61
- | 'hispanic_or_latino'
62
- | 'two_or_more_races'
63
- | 'decline_to_specify'
64
- | null;
65
-
66
- /**
67
- * The legal first name of the individual.
68
- */
69
- first_name?: string | null;
70
-
71
- /**
72
- * The gender of the individual.
73
- */
74
- gender?: 'female' | 'male' | 'other' | 'decline_to_specify' | null;
75
-
76
- /**
77
- * The legal last name of the individual.
78
- */
79
- last_name?: string | null;
80
-
81
- /**
82
- * The legal middle name of the individual.
83
- */
84
- middle_name?: string | null;
45
+ export namespace Individual {
46
+ export interface UnionMember0 {
47
+ /**
48
+ * A stable Finch `id` (UUID v4) for an individual in the company.
49
+ */
50
+ id: string;
51
+
52
+ dob: string | null;
53
+
54
+ /**
55
+ * The EEOC-defined ethnicity of the individual.
56
+ */
57
+ ethnicity:
58
+ | 'asian'
59
+ | 'white'
60
+ | 'black_or_african_american'
61
+ | 'native_hawaiian_or_pacific_islander'
62
+ | 'american_indian_or_alaska_native'
63
+ | 'hispanic_or_latino'
64
+ | 'two_or_more_races'
65
+ | 'decline_to_specify'
66
+ | null;
67
+
68
+ /**
69
+ * The legal first name of the individual.
70
+ */
71
+ first_name: string | null;
72
+
73
+ /**
74
+ * The gender of the individual.
75
+ */
76
+ gender: 'female' | 'male' | 'other' | 'decline_to_specify' | null;
77
+
78
+ /**
79
+ * The legal last name of the individual.
80
+ */
81
+ last_name: string | null;
82
+
83
+ /**
84
+ * The legal middle name of the individual.
85
+ */
86
+ middle_name: string | null;
87
+
88
+ phone_numbers: Array<UnionMember0.PhoneNumber | null> | null;
89
+
90
+ /**
91
+ * The preferred name of the individual.
92
+ */
93
+ preferred_name: string | null;
94
+
95
+ residence: HRISAPI.Location | null;
96
+
97
+ emails?: Array<UnionMember0.Email> | null;
98
+
99
+ /**
100
+ * Social Security Number of the individual in **encrypted** format. This field is
101
+ * only available with the `ssn` scope enabled and the
102
+ * `options: { include: ['ssn'] }` param set in the body.
103
+ */
104
+ encrypted_ssn?: string | null;
105
+
106
+ /**
107
+ * Social Security Number of the individual. This field is only available with the
108
+ * `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the
109
+ * body.
110
+ * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field).
111
+ */
112
+ ssn?: string | null;
113
+ }
85
114
 
86
- phone_numbers?: Array<Individual.PhoneNumber | null> | null;
115
+ export namespace UnionMember0 {
116
+ export interface PhoneNumber {
117
+ data: string | null;
87
118
 
88
- /**
89
- * The preferred name of the individual.
90
- */
91
- preferred_name?: string | null;
119
+ type: 'work' | 'personal' | null;
120
+ }
92
121
 
93
- residence?: HRISAPI.Location | null;
122
+ export interface Email {
123
+ data: string;
94
124
 
95
- /**
96
- * Social Security Number of the individual. This field is only available with the
97
- * `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the
98
- * body.
99
- * [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field).
100
- */
101
- ssn?: string | null;
102
- }
125
+ type: 'work' | 'personal' | null;
126
+ }
127
+ }
103
128
 
104
- export namespace Individual {
105
- export interface Email {
106
- data?: string;
129
+ export interface BatchError {
130
+ code: number;
107
131
 
108
- type?: 'work' | 'personal' | null;
109
- }
132
+ message: string;
110
133
 
111
- export interface PhoneNumber {
112
- data?: string | null;
134
+ name: string;
113
135
 
114
- type?: 'work' | 'personal' | null;
136
+ finch_code?: string;
115
137
  }
116
138
  }
117
139
 
118
140
  export interface IndividualResponse {
119
- body?: Individual;
141
+ body: Individual;
120
142
 
121
- code?: number;
143
+ code: number;
122
144
 
123
- individual_id?: string;
145
+ individual_id: string;
124
146
  }
125
147
 
126
148
  export interface IndividualRetrieveManyParams {
@@ -13,6 +13,22 @@ export class PayStatements extends APIResource {
13
13
  *
14
14
  * Deduction and contribution types are supported by the payroll systems that
15
15
  * supports Benefits.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // Automatically fetches more pages as needed.
20
+ * for await (const payStatementResponse of client.hris.payStatements.retrieveMany(
21
+ * {
22
+ * requests: [
23
+ * {
24
+ * payment_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
25
+ * },
26
+ * ],
27
+ * },
28
+ * )) {
29
+ * // ...
30
+ * }
31
+ * ```
16
32
  */
17
33
  retrieveMany(
18
34
  body: PayStatementRetrieveManyParams,
@@ -8,6 +8,17 @@ import { SinglePage } from '../../pagination';
8
8
  export class Payments extends APIResource {
9
9
  /**
10
10
  * Read payroll and contractor related payments by the company.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // Automatically fetches more pages as needed.
15
+ * for await (const payment of client.hris.payments.list({
16
+ * end_date: '2021-01-01',
17
+ * start_date: '2021-01-01',
18
+ * })) {
19
+ * // ...
20
+ * }
21
+ * ```
11
22
  */
12
23
  list(
13
24
  query: PaymentListParams,
@@ -9,6 +9,16 @@ export class RequestForwarding extends APIResource {
9
9
  * Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
10
10
  * Forward allows you to push or pull data models directly against an integration’s
11
11
  * API.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response = await client.requestForwarding.forward({
16
+ * method: 'POST',
17
+ * route: '/people/search',
18
+ * headers: { 'content-type': 'application/json' },
19
+ * params: { showInactive: true, humanReadable: true },
20
+ * });
21
+ * ```
12
22
  */
13
23
  forward(
14
24
  body: RequestForwardingForwardParams,
@@ -7,6 +7,29 @@ import * as HRISAPI from '../hris/hris';
7
7
  export class Company extends APIResource {
8
8
  /**
9
9
  * Update a sandbox company's data
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const company = await client.sandbox.company.update({
14
+ * accounts: [{}],
15
+ * departments: [{}],
16
+ * ein: 'ein',
17
+ * entity: {},
18
+ * legal_name: 'legal_name',
19
+ * locations: [
20
+ * {
21
+ * city: 'city',
22
+ * country: 'country',
23
+ * line1: 'line1',
24
+ * line2: 'line2',
25
+ * postal_code: 'postal_code',
26
+ * state: 'state',
27
+ * },
28
+ * ],
29
+ * primary_email: 'dev@stainless.com',
30
+ * primary_phone_number: 'primary_phone_number',
31
+ * });
32
+ * ```
10
33
  */
11
34
  update(body: CompanyUpdateParams, options?: Core.RequestOptions): Core.APIPromise<CompanyUpdateResponse> {
12
35
  return this._client.put('/sandbox/company', { body, ...options });