-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbatch.go
More file actions
811 lines (707 loc) · 20.1 KB
/
Copy pathbatch.go
File metadata and controls
811 lines (707 loc) · 20.1 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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
// Code generated by Fern. DO NOT EDIT.
package zep
import (
json "encoding/json"
fmt "fmt"
internal "github.com/getzep/zep-go/v3/internal"
)
type ApidataAddBatchItemsRequest struct {
Items []*BatchAddItem `json:"items,omitempty" url:"-"`
}
type ApidataCreateBatchRequest struct {
// Optional list of message role types to skip during graph ingestion for
// thread_message items in this batch. The messages are still stored and
// retained as context, but no graph extraction is performed for them.
// Has no effect on graph_episode items.
IgnoreRoles []RoleType `json:"ignore_roles,omitempty" url:"-"`
Metadata map[string]interface{} `json:"metadata,omitempty" url:"-"`
}
type BatchListRequest struct {
// Maximum number of batches to return.
Limit *int `json:"-" url:"limit,omitempty"`
// Pagination cursor from a previous response.
Cursor *int `json:"-" url:"cursor,omitempty"`
// Batch status filter.
Status *string `json:"-" url:"status,omitempty"`
}
type BatchListItemsRequest struct {
// Maximum number of batch items to return.
Limit *int `json:"-" url:"limit,omitempty"`
// Pagination cursor from a previous response.
Cursor *int `json:"-" url:"cursor,omitempty"`
// Batch item status filter.
Status *string `json:"-" url:"status,omitempty"`
}
type ApidataBatchAddItemRole string
const (
ApidataBatchAddItemRoleNorole ApidataBatchAddItemRole = "norole"
ApidataBatchAddItemRoleSystem ApidataBatchAddItemRole = "system"
ApidataBatchAddItemRoleAssistant ApidataBatchAddItemRole = "assistant"
ApidataBatchAddItemRoleUser ApidataBatchAddItemRole = "user"
ApidataBatchAddItemRoleFunction ApidataBatchAddItemRole = "function"
ApidataBatchAddItemRoleTool ApidataBatchAddItemRole = "tool"
)
func NewApidataBatchAddItemRoleFromString(s string) (ApidataBatchAddItemRole, error) {
switch s {
case "norole":
return ApidataBatchAddItemRoleNorole, nil
case "system":
return ApidataBatchAddItemRoleSystem, nil
case "assistant":
return ApidataBatchAddItemRoleAssistant, nil
case "user":
return ApidataBatchAddItemRoleUser, nil
case "function":
return ApidataBatchAddItemRoleFunction, nil
case "tool":
return ApidataBatchAddItemRoleTool, nil
}
var t ApidataBatchAddItemRole
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (a ApidataBatchAddItemRole) Ptr() *ApidataBatchAddItemRole {
return &a
}
type ApidataBatchAddItemType string
const (
ApidataBatchAddItemTypeGraphEpisode ApidataBatchAddItemType = "graph_episode"
ApidataBatchAddItemTypeThreadMessage ApidataBatchAddItemType = "thread_message"
)
func NewApidataBatchAddItemTypeFromString(s string) (ApidataBatchAddItemType, error) {
switch s {
case "graph_episode":
return ApidataBatchAddItemTypeGraphEpisode, nil
case "thread_message":
return ApidataBatchAddItemTypeThreadMessage, nil
}
var t ApidataBatchAddItemType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (a ApidataBatchAddItemType) Ptr() *ApidataBatchAddItemType {
return &a
}
type BatchAddItem struct {
Content *string `json:"content,omitempty" url:"content,omitempty"`
CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
Data *string `json:"data,omitempty" url:"data,omitempty"`
DataType *GraphDataType `json:"data_type,omitempty" url:"data_type,omitempty"`
GraphID *string `json:"graph_id,omitempty" url:"graph_id,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
Name *string `json:"name,omitempty" url:"name,omitempty"`
Role *ApidataBatchAddItemRole `json:"role,omitempty" url:"role,omitempty"`
SourceDescription *string `json:"source_description,omitempty" url:"source_description,omitempty"`
ThreadID *string `json:"thread_id,omitempty" url:"thread_id,omitempty"`
Type ApidataBatchAddItemType `json:"type" url:"type"`
UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BatchAddItem) GetContent() *string {
if b == nil {
return nil
}
return b.Content
}
func (b *BatchAddItem) GetCreatedAt() *string {
if b == nil {
return nil
}
return b.CreatedAt
}
func (b *BatchAddItem) GetData() *string {
if b == nil {
return nil
}
return b.Data
}
func (b *BatchAddItem) GetDataType() *GraphDataType {
if b == nil {
return nil
}
return b.DataType
}
func (b *BatchAddItem) GetGraphID() *string {
if b == nil {
return nil
}
return b.GraphID
}
func (b *BatchAddItem) GetMetadata() map[string]interface{} {
if b == nil {
return nil
}
return b.Metadata
}
func (b *BatchAddItem) GetName() *string {
if b == nil {
return nil
}
return b.Name
}
func (b *BatchAddItem) GetRole() *ApidataBatchAddItemRole {
if b == nil {
return nil
}
return b.Role
}
func (b *BatchAddItem) GetSourceDescription() *string {
if b == nil {
return nil
}
return b.SourceDescription
}
func (b *BatchAddItem) GetThreadID() *string {
if b == nil {
return nil
}
return b.ThreadID
}
func (b *BatchAddItem) GetType() ApidataBatchAddItemType {
if b == nil {
return ""
}
return b.Type
}
func (b *BatchAddItem) GetUserID() *string {
if b == nil {
return nil
}
return b.UserID
}
func (b *BatchAddItem) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BatchAddItem) UnmarshalJSON(data []byte) error {
type unmarshaler BatchAddItem
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BatchAddItem(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BatchAddItem) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BatchItemDetail struct {
CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
// EpisodeUUID is the UUID of the episode that will be (or has been) created
// for this batch item. Populated for every item kind and always equal to
// SourceUUID — the underlying source row's UUID is reused as the episode
// UUID during processing.
EpisodeUUID *string `json:"episode_uuid,omitempty" url:"episode_uuid,omitempty"`
Error map[string]interface{} `json:"error,omitempty" url:"error,omitempty"`
GraphID *string `json:"graph_id,omitempty" url:"graph_id,omitempty"`
GraphUUID *string `json:"graph_uuid,omitempty" url:"graph_uuid,omitempty"`
ItemID *string `json:"item_id,omitempty" url:"item_id,omitempty"`
Kind *BatchItemKind `json:"kind,omitempty" url:"kind,omitempty"`
SequenceIndex *int `json:"sequence_index,omitempty" url:"sequence_index,omitempty"`
SourceUUID *string `json:"source_uuid,omitempty" url:"source_uuid,omitempty"`
Status *BatchItemStatus `json:"status,omitempty" url:"status,omitempty"`
ThreadID *string `json:"thread_id,omitempty" url:"thread_id,omitempty"`
UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,omitempty"`
UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
UserUUID *string `json:"user_uuid,omitempty" url:"user_uuid,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BatchItemDetail) GetCreatedAt() *string {
if b == nil {
return nil
}
return b.CreatedAt
}
func (b *BatchItemDetail) GetEpisodeUUID() *string {
if b == nil {
return nil
}
return b.EpisodeUUID
}
func (b *BatchItemDetail) GetError() map[string]interface{} {
if b == nil {
return nil
}
return b.Error
}
func (b *BatchItemDetail) GetGraphID() *string {
if b == nil {
return nil
}
return b.GraphID
}
func (b *BatchItemDetail) GetGraphUUID() *string {
if b == nil {
return nil
}
return b.GraphUUID
}
func (b *BatchItemDetail) GetItemID() *string {
if b == nil {
return nil
}
return b.ItemID
}
func (b *BatchItemDetail) GetKind() *BatchItemKind {
if b == nil {
return nil
}
return b.Kind
}
func (b *BatchItemDetail) GetSequenceIndex() *int {
if b == nil {
return nil
}
return b.SequenceIndex
}
func (b *BatchItemDetail) GetSourceUUID() *string {
if b == nil {
return nil
}
return b.SourceUUID
}
func (b *BatchItemDetail) GetStatus() *BatchItemStatus {
if b == nil {
return nil
}
return b.Status
}
func (b *BatchItemDetail) GetThreadID() *string {
if b == nil {
return nil
}
return b.ThreadID
}
func (b *BatchItemDetail) GetUpdatedAt() *string {
if b == nil {
return nil
}
return b.UpdatedAt
}
func (b *BatchItemDetail) GetUserID() *string {
if b == nil {
return nil
}
return b.UserID
}
func (b *BatchItemDetail) GetUserUUID() *string {
if b == nil {
return nil
}
return b.UserUUID
}
func (b *BatchItemDetail) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BatchItemDetail) UnmarshalJSON(data []byte) error {
type unmarshaler BatchItemDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BatchItemDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BatchItemDetail) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BatchItemKind string
const (
BatchItemKindGraphEpisode BatchItemKind = "graph_episode"
BatchItemKindThreadMessage BatchItemKind = "thread_message"
)
func NewBatchItemKindFromString(s string) (BatchItemKind, error) {
switch s {
case "graph_episode":
return BatchItemKindGraphEpisode, nil
case "thread_message":
return BatchItemKindThreadMessage, nil
}
var t BatchItemKind
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (b BatchItemKind) Ptr() *BatchItemKind {
return &b
}
type BatchItemListResponse struct {
Items []*BatchItemDetail `json:"items,omitempty" url:"items,omitempty"`
NextCursor *int `json:"next_cursor,omitempty" url:"next_cursor,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BatchItemListResponse) GetItems() []*BatchItemDetail {
if b == nil {
return nil
}
return b.Items
}
func (b *BatchItemListResponse) GetNextCursor() *int {
if b == nil {
return nil
}
return b.NextCursor
}
func (b *BatchItemListResponse) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BatchItemListResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BatchItemListResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BatchItemListResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BatchItemListResponse) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BatchItemStatus string
const (
BatchItemStatusPending BatchItemStatus = "pending"
BatchItemStatusQueued BatchItemStatus = "queued"
BatchItemStatusProcessing BatchItemStatus = "processing"
BatchItemStatusSucceeded BatchItemStatus = "succeeded"
BatchItemStatusFailed BatchItemStatus = "failed"
BatchItemStatusSkipped BatchItemStatus = "skipped"
BatchItemStatusCanceled BatchItemStatus = "canceled"
)
func NewBatchItemStatusFromString(s string) (BatchItemStatus, error) {
switch s {
case "pending":
return BatchItemStatusPending, nil
case "queued":
return BatchItemStatusQueued, nil
case "processing":
return BatchItemStatusProcessing, nil
case "succeeded":
return BatchItemStatusSucceeded, nil
case "failed":
return BatchItemStatusFailed, nil
case "skipped":
return BatchItemStatusSkipped, nil
case "canceled":
return BatchItemStatusCanceled, nil
}
var t BatchItemStatus
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (b BatchItemStatus) Ptr() *BatchItemStatus {
return &b
}
type BatchListResponse struct {
Batches []*BatchSummary `json:"batches,omitempty" url:"batches,omitempty"`
NextCursor *int `json:"next_cursor,omitempty" url:"next_cursor,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BatchListResponse) GetBatches() []*BatchSummary {
if b == nil {
return nil
}
return b.Batches
}
func (b *BatchListResponse) GetNextCursor() *int {
if b == nil {
return nil
}
return b.NextCursor
}
func (b *BatchListResponse) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BatchListResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BatchListResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BatchListResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BatchListResponse) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BatchProgress struct {
CanceledItems *int `json:"canceled_items,omitempty" url:"canceled_items,omitempty"`
FailedItems *int `json:"failed_items,omitempty" url:"failed_items,omitempty"`
PercentComplete *float64 `json:"percent_complete,omitempty" url:"percent_complete,omitempty"`
ProcessingItems *int `json:"processing_items,omitempty" url:"processing_items,omitempty"`
QueuedItems *int `json:"queued_items,omitempty" url:"queued_items,omitempty"`
SkippedItems *int `json:"skipped_items,omitempty" url:"skipped_items,omitempty"`
SucceededItems *int `json:"succeeded_items,omitempty" url:"succeeded_items,omitempty"`
TotalItems *int `json:"total_items,omitempty" url:"total_items,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BatchProgress) GetCanceledItems() *int {
if b == nil {
return nil
}
return b.CanceledItems
}
func (b *BatchProgress) GetFailedItems() *int {
if b == nil {
return nil
}
return b.FailedItems
}
func (b *BatchProgress) GetPercentComplete() *float64 {
if b == nil {
return nil
}
return b.PercentComplete
}
func (b *BatchProgress) GetProcessingItems() *int {
if b == nil {
return nil
}
return b.ProcessingItems
}
func (b *BatchProgress) GetQueuedItems() *int {
if b == nil {
return nil
}
return b.QueuedItems
}
func (b *BatchProgress) GetSkippedItems() *int {
if b == nil {
return nil
}
return b.SkippedItems
}
func (b *BatchProgress) GetSucceededItems() *int {
if b == nil {
return nil
}
return b.SucceededItems
}
func (b *BatchProgress) GetTotalItems() *int {
if b == nil {
return nil
}
return b.TotalItems
}
func (b *BatchProgress) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BatchProgress) UnmarshalJSON(data []byte) error {
type unmarshaler BatchProgress
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BatchProgress(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BatchProgress) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BatchStatus string
const (
BatchStatusDraft BatchStatus = "draft"
BatchStatusInvalid BatchStatus = "invalid"
BatchStatusQueued BatchStatus = "queued"
BatchStatusProcessing BatchStatus = "processing"
BatchStatusSucceeded BatchStatus = "succeeded"
BatchStatusPartial BatchStatus = "partial"
BatchStatusFailed BatchStatus = "failed"
BatchStatusCanceled BatchStatus = "canceled"
)
func NewBatchStatusFromString(s string) (BatchStatus, error) {
switch s {
case "draft":
return BatchStatusDraft, nil
case "invalid":
return BatchStatusInvalid, nil
case "queued":
return BatchStatusQueued, nil
case "processing":
return BatchStatusProcessing, nil
case "succeeded":
return BatchStatusSucceeded, nil
case "partial":
return BatchStatusPartial, nil
case "failed":
return BatchStatusFailed, nil
case "canceled":
return BatchStatusCanceled, nil
}
var t BatchStatus
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (b BatchStatus) Ptr() *BatchStatus {
return &b
}
type BatchSummary struct {
BatchID *string `json:"batch_id,omitempty" url:"batch_id,omitempty"`
CompletedAt *string `json:"completed_at,omitempty" url:"completed_at,omitempty"`
CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
IgnoreRoles []RoleType `json:"ignore_roles,omitempty" url:"ignore_roles,omitempty"`
ItemCount *int `json:"item_count,omitempty" url:"item_count,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
ProcessedAt *string `json:"processed_at,omitempty" url:"processed_at,omitempty"`
Progress *BatchProgress `json:"progress,omitempty" url:"progress,omitempty"`
Status *BatchStatus `json:"status,omitempty" url:"status,omitempty"`
UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (b *BatchSummary) GetBatchID() *string {
if b == nil {
return nil
}
return b.BatchID
}
func (b *BatchSummary) GetCompletedAt() *string {
if b == nil {
return nil
}
return b.CompletedAt
}
func (b *BatchSummary) GetCreatedAt() *string {
if b == nil {
return nil
}
return b.CreatedAt
}
func (b *BatchSummary) GetIgnoreRoles() []RoleType {
if b == nil {
return nil
}
return b.IgnoreRoles
}
func (b *BatchSummary) GetItemCount() *int {
if b == nil {
return nil
}
return b.ItemCount
}
func (b *BatchSummary) GetMetadata() map[string]interface{} {
if b == nil {
return nil
}
return b.Metadata
}
func (b *BatchSummary) GetProcessedAt() *string {
if b == nil {
return nil
}
return b.ProcessedAt
}
func (b *BatchSummary) GetProgress() *BatchProgress {
if b == nil {
return nil
}
return b.Progress
}
func (b *BatchSummary) GetStatus() *BatchStatus {
if b == nil {
return nil
}
return b.Status
}
func (b *BatchSummary) GetUpdatedAt() *string {
if b == nil {
return nil
}
return b.UpdatedAt
}
func (b *BatchSummary) GetExtraProperties() map[string]interface{} {
return b.extraProperties
}
func (b *BatchSummary) UnmarshalJSON(data []byte) error {
type unmarshaler BatchSummary
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BatchSummary(value)
extraProperties, err := internal.ExtractExtraProperties(data, *b)
if err != nil {
return err
}
b.extraProperties = extraProperties
b.rawJSON = json.RawMessage(data)
return nil
}
func (b *BatchSummary) String() string {
if len(b.rawJSON) > 0 {
if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}