-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhriscompanypaystatementitemrule.go
More file actions
692 lines (596 loc) · 27.6 KB
/
hriscompanypaystatementitemrule.go
File metadata and controls
692 lines (596 loc) · 27.6 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package finchgo
import (
"context"
"errors"
"fmt"
"net/http"
"slices"
"time"
"github.com/Finch-API/finch-api-go/internal/apijson"
"github.com/Finch-API/finch-api-go/internal/param"
"github.com/Finch-API/finch-api-go/internal/requestconfig"
"github.com/Finch-API/finch-api-go/option"
"github.com/Finch-API/finch-api-go/packages/pagination"
)
// HRISCompanyPayStatementItemRuleService contains methods and other services that
// help with interacting with the Finch API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewHRISCompanyPayStatementItemRuleService] method instead.
type HRISCompanyPayStatementItemRuleService struct {
Options []option.RequestOption
}
// NewHRISCompanyPayStatementItemRuleService generates a new service that applies
// the given options to each request. These options are applied after the parent
// client's options (if there is one), and before any request-specific options.
func NewHRISCompanyPayStatementItemRuleService(opts ...option.RequestOption) (r *HRISCompanyPayStatementItemRuleService) {
r = &HRISCompanyPayStatementItemRuleService{}
r.Options = opts
return
}
// **Beta:** this endpoint currently serves employers onboarded after March 4th and
// historical support will be added soon Custom rules can be created to associate
// specific attributes to pay statement items depending on the use case. For
// example, pay statement items that meet certain conditions can be labeled as a
// pre-tax 401k. This metadata can be retrieved where pay statement item
// information is available.
func (r *HRISCompanyPayStatementItemRuleService) New(ctx context.Context, body HRISCompanyPayStatementItemRuleNewParams, opts ...option.RequestOption) (res *HRISCompanyPayStatementItemRuleNewResponse, err error) {
opts = slices.Concat(r.Options, opts)
path := "employer/pay-statement-item/rule"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// **Beta:** this endpoint currently serves employers onboarded after March 4th and
// historical support will be added soon Update a rule for a pay statement item.
func (r *HRISCompanyPayStatementItemRuleService) Update(ctx context.Context, ruleID string, body HRISCompanyPayStatementItemRuleUpdateParams, opts ...option.RequestOption) (res *HRISCompanyPayStatementItemRuleUpdateResponse, err error) {
opts = slices.Concat(r.Options, opts)
if ruleID == "" {
err = errors.New("missing required rule_id parameter")
return
}
path := fmt.Sprintf("employer/pay-statement-item/rule/%s", ruleID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...)
return
}
// **Beta:** this endpoint currently serves employers onboarded after March 4th and
// historical support will be added soon List all rules of a connection account.
func (r *HRISCompanyPayStatementItemRuleService) List(ctx context.Context, opts ...option.RequestOption) (res *pagination.ResponsesPage[HRISCompanyPayStatementItemRuleListResponse], err error) {
var raw *http.Response
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "employer/pay-statement-item/rule"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// **Beta:** this endpoint currently serves employers onboarded after March 4th and
// historical support will be added soon List all rules of a connection account.
func (r *HRISCompanyPayStatementItemRuleService) ListAutoPaging(ctx context.Context, opts ...option.RequestOption) *pagination.ResponsesPageAutoPager[HRISCompanyPayStatementItemRuleListResponse] {
return pagination.NewResponsesPageAutoPager(r.List(ctx, opts...))
}
// **Beta:** this endpoint currently serves employers onboarded after March 4th and
// historical support will be added soon Delete a rule for a pay statement item.
func (r *HRISCompanyPayStatementItemRuleService) Delete(ctx context.Context, ruleID string, opts ...option.RequestOption) (res *HRISCompanyPayStatementItemRuleDeleteResponse, err error) {
opts = slices.Concat(r.Options, opts)
if ruleID == "" {
err = errors.New("missing required rule_id parameter")
return
}
path := fmt.Sprintf("employer/pay-statement-item/rule/%s", ruleID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return
}
type HRISCompanyPayStatementItemRuleNewResponse struct {
// Finch id (uuidv4) for the rule.
ID string `json:"id"`
// Specifies the fields to be applied when the condition is met.
Attributes HRISCompanyPayStatementItemRuleNewResponseAttributes `json:"attributes"`
Conditions []HRISCompanyPayStatementItemRuleNewResponseCondition `json:"conditions"`
// The datetime when the rule was created.
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Specifies when the rules should stop applying rules based on the date.
EffectiveEndDate string `json:"effective_end_date,nullable"`
// Specifies when the rule should begin applying based on the date.
EffectiveStartDate string `json:"effective_start_date,nullable"`
// The entity type to which the rule is applied.
EntityType HRISCompanyPayStatementItemRuleNewResponseEntityType `json:"entity_type"`
// The priority of the rule.
Priority int64 `json:"priority"`
// The datetime when the rule was last updated.
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON hrisCompanyPayStatementItemRuleNewResponseJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleNewResponseJSON contains the JSON metadata for
// the struct [HRISCompanyPayStatementItemRuleNewResponse]
type hrisCompanyPayStatementItemRuleNewResponseJSON struct {
ID apijson.Field
Attributes apijson.Field
Conditions apijson.Field
CreatedAt apijson.Field
EffectiveEndDate apijson.Field
EffectiveStartDate apijson.Field
EntityType apijson.Field
Priority apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleNewResponseJSON) RawJSON() string {
return r.raw
}
// Specifies the fields to be applied when the condition is met.
type HRISCompanyPayStatementItemRuleNewResponseAttributes struct {
// The metadata to be attached in the entity. It is a key-value pairs where the
// values can be of any type (string, number, boolean, object, array, etc.).
Metadata map[string]interface{} `json:"metadata"`
JSON hrisCompanyPayStatementItemRuleNewResponseAttributesJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleNewResponseAttributesJSON contains the JSON
// metadata for the struct [HRISCompanyPayStatementItemRuleNewResponseAttributes]
type hrisCompanyPayStatementItemRuleNewResponseAttributesJSON struct {
Metadata apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleNewResponseAttributes) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleNewResponseAttributesJSON) RawJSON() string {
return r.raw
}
type HRISCompanyPayStatementItemRuleNewResponseCondition struct {
// The field to be checked in the rule.
Field string `json:"field"`
// The operator to be used in the rule.
Operator HRISCompanyPayStatementItemRuleNewResponseConditionsOperator `json:"operator"`
// The value of the field to be checked in the rule.
Value string `json:"value"`
JSON hrisCompanyPayStatementItemRuleNewResponseConditionJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleNewResponseConditionJSON contains the JSON
// metadata for the struct [HRISCompanyPayStatementItemRuleNewResponseCondition]
type hrisCompanyPayStatementItemRuleNewResponseConditionJSON struct {
Field apijson.Field
Operator apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleNewResponseCondition) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleNewResponseConditionJSON) RawJSON() string {
return r.raw
}
// The operator to be used in the rule.
type HRISCompanyPayStatementItemRuleNewResponseConditionsOperator string
const (
HRISCompanyPayStatementItemRuleNewResponseConditionsOperatorEquals HRISCompanyPayStatementItemRuleNewResponseConditionsOperator = "equals"
)
func (r HRISCompanyPayStatementItemRuleNewResponseConditionsOperator) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleNewResponseConditionsOperatorEquals:
return true
}
return false
}
// The entity type to which the rule is applied.
type HRISCompanyPayStatementItemRuleNewResponseEntityType string
const (
HRISCompanyPayStatementItemRuleNewResponseEntityTypePayStatementItem HRISCompanyPayStatementItemRuleNewResponseEntityType = "pay_statement_item"
)
func (r HRISCompanyPayStatementItemRuleNewResponseEntityType) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleNewResponseEntityTypePayStatementItem:
return true
}
return false
}
type HRISCompanyPayStatementItemRuleUpdateResponse struct {
// Finch id (uuidv4) for the rule.
ID string `json:"id" format:"uuid"`
// Specifies the fields to be applied when the condition is met.
Attributes HRISCompanyPayStatementItemRuleUpdateResponseAttributes `json:"attributes"`
Conditions []HRISCompanyPayStatementItemRuleUpdateResponseCondition `json:"conditions"`
// The datetime when the rule was created.
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Specifies when the rules should stop applying rules based on the date.
EffectiveEndDate string `json:"effective_end_date,nullable"`
// Specifies when the rule should begin applying based on the date.
EffectiveStartDate string `json:"effective_start_date,nullable"`
// The entity type to which the rule is applied.
EntityType HRISCompanyPayStatementItemRuleUpdateResponseEntityType `json:"entity_type"`
// The priority of the rule.
Priority int64 `json:"priority"`
// The datetime when the rule was last updated.
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON hrisCompanyPayStatementItemRuleUpdateResponseJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleUpdateResponseJSON contains the JSON metadata for
// the struct [HRISCompanyPayStatementItemRuleUpdateResponse]
type hrisCompanyPayStatementItemRuleUpdateResponseJSON struct {
ID apijson.Field
Attributes apijson.Field
Conditions apijson.Field
CreatedAt apijson.Field
EffectiveEndDate apijson.Field
EffectiveStartDate apijson.Field
EntityType apijson.Field
Priority apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleUpdateResponseJSON) RawJSON() string {
return r.raw
}
// Specifies the fields to be applied when the condition is met.
type HRISCompanyPayStatementItemRuleUpdateResponseAttributes struct {
// The metadata to be attached in the entity. It is a key-value pairs where the
// values can be of any type (string, number, boolean, object, array, etc.).
Metadata map[string]interface{} `json:"metadata"`
JSON hrisCompanyPayStatementItemRuleUpdateResponseAttributesJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleUpdateResponseAttributesJSON contains the JSON
// metadata for the struct
// [HRISCompanyPayStatementItemRuleUpdateResponseAttributes]
type hrisCompanyPayStatementItemRuleUpdateResponseAttributesJSON struct {
Metadata apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleUpdateResponseAttributes) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleUpdateResponseAttributesJSON) RawJSON() string {
return r.raw
}
type HRISCompanyPayStatementItemRuleUpdateResponseCondition struct {
// The field to be checked in the rule.
Field string `json:"field"`
// The operator to be used in the rule.
Operator HRISCompanyPayStatementItemRuleUpdateResponseConditionsOperator `json:"operator"`
// The value of the field to be checked in the rule.
Value string `json:"value"`
JSON hrisCompanyPayStatementItemRuleUpdateResponseConditionJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleUpdateResponseConditionJSON contains the JSON
// metadata for the struct [HRISCompanyPayStatementItemRuleUpdateResponseCondition]
type hrisCompanyPayStatementItemRuleUpdateResponseConditionJSON struct {
Field apijson.Field
Operator apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleUpdateResponseCondition) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleUpdateResponseConditionJSON) RawJSON() string {
return r.raw
}
// The operator to be used in the rule.
type HRISCompanyPayStatementItemRuleUpdateResponseConditionsOperator string
const (
HRISCompanyPayStatementItemRuleUpdateResponseConditionsOperatorEquals HRISCompanyPayStatementItemRuleUpdateResponseConditionsOperator = "equals"
)
func (r HRISCompanyPayStatementItemRuleUpdateResponseConditionsOperator) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleUpdateResponseConditionsOperatorEquals:
return true
}
return false
}
// The entity type to which the rule is applied.
type HRISCompanyPayStatementItemRuleUpdateResponseEntityType string
const (
HRISCompanyPayStatementItemRuleUpdateResponseEntityTypePayStatementItem HRISCompanyPayStatementItemRuleUpdateResponseEntityType = "pay_statement_item"
)
func (r HRISCompanyPayStatementItemRuleUpdateResponseEntityType) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleUpdateResponseEntityTypePayStatementItem:
return true
}
return false
}
type HRISCompanyPayStatementItemRuleListResponse struct {
// Finch id (uuidv4) for the rule.
ID string `json:"id"`
// Specifies the fields to be applied when the condition is met.
Attributes HRISCompanyPayStatementItemRuleListResponseAttributes `json:"attributes"`
Conditions []HRISCompanyPayStatementItemRuleListResponseCondition `json:"conditions"`
// The datetime when the rule was created.
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Specifies when the rules should stop applying rules based on the date.
EffectiveEndDate string `json:"effective_end_date,nullable"`
// Specifies when the rule should begin applying based on the date.
EffectiveStartDate string `json:"effective_start_date,nullable"`
// The entity type to which the rule is applied.
EntityType HRISCompanyPayStatementItemRuleListResponseEntityType `json:"entity_type"`
// The priority of the rule.
Priority int64 `json:"priority"`
// The datetime when the rule was last updated.
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON hrisCompanyPayStatementItemRuleListResponseJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleListResponseJSON contains the JSON metadata for
// the struct [HRISCompanyPayStatementItemRuleListResponse]
type hrisCompanyPayStatementItemRuleListResponseJSON struct {
ID apijson.Field
Attributes apijson.Field
Conditions apijson.Field
CreatedAt apijson.Field
EffectiveEndDate apijson.Field
EffectiveStartDate apijson.Field
EntityType apijson.Field
Priority apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleListResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleListResponseJSON) RawJSON() string {
return r.raw
}
// Specifies the fields to be applied when the condition is met.
type HRISCompanyPayStatementItemRuleListResponseAttributes struct {
// The metadata to be attached in the entity. It is a key-value pairs where the
// values can be of any type (string, number, boolean, object, array, etc.).
Metadata map[string]interface{} `json:"metadata"`
JSON hrisCompanyPayStatementItemRuleListResponseAttributesJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleListResponseAttributesJSON contains the JSON
// metadata for the struct [HRISCompanyPayStatementItemRuleListResponseAttributes]
type hrisCompanyPayStatementItemRuleListResponseAttributesJSON struct {
Metadata apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleListResponseAttributes) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleListResponseAttributesJSON) RawJSON() string {
return r.raw
}
type HRISCompanyPayStatementItemRuleListResponseCondition struct {
// The field to be checked in the rule.
Field string `json:"field"`
// The operator to be used in the rule.
Operator HRISCompanyPayStatementItemRuleListResponseConditionsOperator `json:"operator"`
// The value of the field to be checked in the rule.
Value string `json:"value"`
JSON hrisCompanyPayStatementItemRuleListResponseConditionJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleListResponseConditionJSON contains the JSON
// metadata for the struct [HRISCompanyPayStatementItemRuleListResponseCondition]
type hrisCompanyPayStatementItemRuleListResponseConditionJSON struct {
Field apijson.Field
Operator apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleListResponseCondition) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleListResponseConditionJSON) RawJSON() string {
return r.raw
}
// The operator to be used in the rule.
type HRISCompanyPayStatementItemRuleListResponseConditionsOperator string
const (
HRISCompanyPayStatementItemRuleListResponseConditionsOperatorEquals HRISCompanyPayStatementItemRuleListResponseConditionsOperator = "equals"
)
func (r HRISCompanyPayStatementItemRuleListResponseConditionsOperator) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleListResponseConditionsOperatorEquals:
return true
}
return false
}
// The entity type to which the rule is applied.
type HRISCompanyPayStatementItemRuleListResponseEntityType string
const (
HRISCompanyPayStatementItemRuleListResponseEntityTypePayStatementItem HRISCompanyPayStatementItemRuleListResponseEntityType = "pay_statement_item"
)
func (r HRISCompanyPayStatementItemRuleListResponseEntityType) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleListResponseEntityTypePayStatementItem:
return true
}
return false
}
type HRISCompanyPayStatementItemRuleDeleteResponse struct {
// Finch id (uuidv4) for the rule.
ID string `json:"id" format:"uuid"`
// Specifies the fields to be applied when the condition is met.
Attributes HRISCompanyPayStatementItemRuleDeleteResponseAttributes `json:"attributes"`
Conditions []HRISCompanyPayStatementItemRuleDeleteResponseCondition `json:"conditions"`
// The datetime when the rule was created.
CreatedAt time.Time `json:"created_at" format:"date-time"`
// The datetime when the rule was deleted.
DeletedAt time.Time `json:"deleted_at" format:"date-time"`
// Specifies when the rules should stop applying rules based on the date.
EffectiveEndDate string `json:"effective_end_date,nullable"`
// Specifies when the rule should begin applying based on the date.
EffectiveStartDate string `json:"effective_start_date,nullable"`
// The entity type to which the rule is applied.
EntityType HRISCompanyPayStatementItemRuleDeleteResponseEntityType `json:"entity_type"`
// The priority of the rule.
Priority int64 `json:"priority"`
// The datetime when the rule was last updated.
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON hrisCompanyPayStatementItemRuleDeleteResponseJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleDeleteResponseJSON contains the JSON metadata for
// the struct [HRISCompanyPayStatementItemRuleDeleteResponse]
type hrisCompanyPayStatementItemRuleDeleteResponseJSON struct {
ID apijson.Field
Attributes apijson.Field
Conditions apijson.Field
CreatedAt apijson.Field
DeletedAt apijson.Field
EffectiveEndDate apijson.Field
EffectiveStartDate apijson.Field
EntityType apijson.Field
Priority apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleDeleteResponseJSON) RawJSON() string {
return r.raw
}
// Specifies the fields to be applied when the condition is met.
type HRISCompanyPayStatementItemRuleDeleteResponseAttributes struct {
// The metadata to be attached in the entity. It is a key-value pairs where the
// values can be of any type (string, number, boolean, object, array, etc.).
Metadata map[string]interface{} `json:"metadata"`
JSON hrisCompanyPayStatementItemRuleDeleteResponseAttributesJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleDeleteResponseAttributesJSON contains the JSON
// metadata for the struct
// [HRISCompanyPayStatementItemRuleDeleteResponseAttributes]
type hrisCompanyPayStatementItemRuleDeleteResponseAttributesJSON struct {
Metadata apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleDeleteResponseAttributes) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleDeleteResponseAttributesJSON) RawJSON() string {
return r.raw
}
type HRISCompanyPayStatementItemRuleDeleteResponseCondition struct {
// The field to be checked in the rule.
Field string `json:"field"`
// The operator to be used in the rule.
Operator HRISCompanyPayStatementItemRuleDeleteResponseConditionsOperator `json:"operator"`
// The value of the field to be checked in the rule.
Value string `json:"value"`
JSON hrisCompanyPayStatementItemRuleDeleteResponseConditionJSON `json:"-"`
}
// hrisCompanyPayStatementItemRuleDeleteResponseConditionJSON contains the JSON
// metadata for the struct [HRISCompanyPayStatementItemRuleDeleteResponseCondition]
type hrisCompanyPayStatementItemRuleDeleteResponseConditionJSON struct {
Field apijson.Field
Operator apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *HRISCompanyPayStatementItemRuleDeleteResponseCondition) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r hrisCompanyPayStatementItemRuleDeleteResponseConditionJSON) RawJSON() string {
return r.raw
}
// The operator to be used in the rule.
type HRISCompanyPayStatementItemRuleDeleteResponseConditionsOperator string
const (
HRISCompanyPayStatementItemRuleDeleteResponseConditionsOperatorEquals HRISCompanyPayStatementItemRuleDeleteResponseConditionsOperator = "equals"
)
func (r HRISCompanyPayStatementItemRuleDeleteResponseConditionsOperator) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleDeleteResponseConditionsOperatorEquals:
return true
}
return false
}
// The entity type to which the rule is applied.
type HRISCompanyPayStatementItemRuleDeleteResponseEntityType string
const (
HRISCompanyPayStatementItemRuleDeleteResponseEntityTypePayStatementItem HRISCompanyPayStatementItemRuleDeleteResponseEntityType = "pay_statement_item"
)
func (r HRISCompanyPayStatementItemRuleDeleteResponseEntityType) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleDeleteResponseEntityTypePayStatementItem:
return true
}
return false
}
type HRISCompanyPayStatementItemRuleNewParams struct {
// Specifies the fields to be applied when the condition is met.
Attributes param.Field[HRISCompanyPayStatementItemRuleNewParamsAttributes] `json:"attributes"`
Conditions param.Field[[]HRISCompanyPayStatementItemRuleNewParamsCondition] `json:"conditions"`
// Specifies when the rules should stop applying rules based on the date.
EffectiveEndDate param.Field[string] `json:"effective_end_date"`
// Specifies when the rule should begin applying based on the date.
EffectiveStartDate param.Field[string] `json:"effective_start_date"`
// The entity type to which the rule is applied.
EntityType param.Field[HRISCompanyPayStatementItemRuleNewParamsEntityType] `json:"entity_type"`
}
func (r HRISCompanyPayStatementItemRuleNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Specifies the fields to be applied when the condition is met.
type HRISCompanyPayStatementItemRuleNewParamsAttributes struct {
// The metadata to be attached in the entity. It is a key-value pairs where the
// values can be of any type (string, number, boolean, object, array, etc.).
Metadata param.Field[map[string]interface{}] `json:"metadata"`
}
func (r HRISCompanyPayStatementItemRuleNewParamsAttributes) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type HRISCompanyPayStatementItemRuleNewParamsCondition struct {
// The field to be checked in the rule.
Field param.Field[string] `json:"field"`
// The operator to be used in the rule.
Operator param.Field[HRISCompanyPayStatementItemRuleNewParamsConditionsOperator] `json:"operator"`
// The value of the field to be checked in the rule.
Value param.Field[string] `json:"value"`
}
func (r HRISCompanyPayStatementItemRuleNewParamsCondition) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The operator to be used in the rule.
type HRISCompanyPayStatementItemRuleNewParamsConditionsOperator string
const (
HRISCompanyPayStatementItemRuleNewParamsConditionsOperatorEquals HRISCompanyPayStatementItemRuleNewParamsConditionsOperator = "equals"
)
func (r HRISCompanyPayStatementItemRuleNewParamsConditionsOperator) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleNewParamsConditionsOperatorEquals:
return true
}
return false
}
// The entity type to which the rule is applied.
type HRISCompanyPayStatementItemRuleNewParamsEntityType string
const (
HRISCompanyPayStatementItemRuleNewParamsEntityTypePayStatementItem HRISCompanyPayStatementItemRuleNewParamsEntityType = "pay_statement_item"
)
func (r HRISCompanyPayStatementItemRuleNewParamsEntityType) IsKnown() bool {
switch r {
case HRISCompanyPayStatementItemRuleNewParamsEntityTypePayStatementItem:
return true
}
return false
}
type HRISCompanyPayStatementItemRuleUpdateParams struct {
OptionalProperty param.Field[interface{}] `json:"optionalProperty"`
}
func (r HRISCompanyPayStatementItemRuleUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}