forked from cohere-ai/cohere-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataset.go
111 lines (96 loc) · 2.54 KB
/
dataset.go
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
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/cohere-ai/cohere-go/core"
time "time"
)
type DatasetGetRequest struct {
// optional filter by dataset type
DatasetType *string `json:"-"`
// optional filter before a date
Before *time.Time `json:"-"`
// optional filter after a date
After *time.Time `json:"-"`
// optional limit to number of results
Limit *string `json:"-"`
// optional offset to start of results
Offset *string `json:"-"`
}
type DatasetGetResponse struct {
Datasets []*Dataset `json:"datasets,omitempty"`
_rawJSON json.RawMessage
}
func (d *DatasetGetResponse) UnmarshalJSON(data []byte) error {
type unmarshaler DatasetGetResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DatasetGetResponse(value)
d._rawJSON = json.RawMessage(data)
return nil
}
func (d *DatasetGetResponse) String() string {
if len(d._rawJSON) > 0 {
if value, err := core.StringifyJSON(d._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
type DatasetIdGetResponse struct {
Dataset *Dataset `json:"dataset,omitempty"`
_rawJSON json.RawMessage
}
func (d *DatasetIdGetResponse) UnmarshalJSON(data []byte) error {
type unmarshaler DatasetIdGetResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DatasetIdGetResponse(value)
d._rawJSON = json.RawMessage(data)
return nil
}
func (d *DatasetIdGetResponse) String() string {
if len(d._rawJSON) > 0 {
if value, err := core.StringifyJSON(d._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
type DatasetUsageGetResponse struct {
// The total number of bytes used by the organization.
OrganizationUsage *string `json:"organizationUsage,omitempty"`
_rawJSON json.RawMessage
}
func (d *DatasetUsageGetResponse) UnmarshalJSON(data []byte) error {
type unmarshaler DatasetUsageGetResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DatasetUsageGetResponse(value)
d._rawJSON = json.RawMessage(data)
return nil
}
func (d *DatasetUsageGetResponse) String() string {
if len(d._rawJSON) > 0 {
if value, err := core.StringifyJSON(d._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}