-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdebugdatasourcestatusresponse.go
More file actions
154 lines (133 loc) · 4.27 KB
/
debugdatasourcestatusresponse.go
File metadata and controls
154 lines (133 loc) · 4.27 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
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
package components
import (
"encoding/json"
"fmt"
)
type DebugDatasourceStatusResponseCounts struct {
// A list of object types and corresponding upload counts. Note: This data may be cached and could be up to 3 hours stale.
//
Uploaded []DatasourceObjectTypeDocumentCountEntry `json:"uploaded,omitempty"`
// The number of documents indexed, grouped by objectType
Indexed []DatasourceObjectTypeDocumentCountEntry `json:"indexed,omitempty"`
}
func (o *DebugDatasourceStatusResponseCounts) GetUploaded() []DatasourceObjectTypeDocumentCountEntry {
if o == nil {
return nil
}
return o.Uploaded
}
func (o *DebugDatasourceStatusResponseCounts) GetIndexed() []DatasourceObjectTypeDocumentCountEntry {
if o == nil {
return nil
}
return o.Indexed
}
type Documents struct {
// Information about active and recent successful uploads for the datasource
BulkUploadHistory []BulkUploadHistoryEvent `json:"bulkUploadHistory,omitempty"`
Counts *DebugDatasourceStatusResponseCounts `json:"counts,omitempty"`
// Information about processing history for the datasource
ProcessingHistory []ProcessingHistoryEvent `json:"processingHistory,omitempty"`
}
func (o *Documents) GetBulkUploadHistory() []BulkUploadHistoryEvent {
if o == nil {
return nil
}
return o.BulkUploadHistory
}
func (o *Documents) GetCounts() *DebugDatasourceStatusResponseCounts {
if o == nil {
return nil
}
return o.Counts
}
func (o *Documents) GetProcessingHistory() []ProcessingHistoryEvent {
if o == nil {
return nil
}
return o.ProcessingHistory
}
type Identity struct {
// Information about processing history for the datasource
ProcessingHistory []ProcessingHistoryEvent `json:"processingHistory,omitempty"`
Users *DebugDatasourceStatusIdentityResponseComponent `json:"users,omitempty"`
Groups *DebugDatasourceStatusIdentityResponseComponent `json:"groups,omitempty"`
Memberships *DebugDatasourceStatusIdentityResponseComponent `json:"memberships,omitempty"`
}
func (o *Identity) GetProcessingHistory() []ProcessingHistoryEvent {
if o == nil {
return nil
}
return o.ProcessingHistory
}
func (o *Identity) GetUsers() *DebugDatasourceStatusIdentityResponseComponent {
if o == nil {
return nil
}
return o.Users
}
func (o *Identity) GetGroups() *DebugDatasourceStatusIdentityResponseComponent {
if o == nil {
return nil
}
return o.Groups
}
func (o *Identity) GetMemberships() *DebugDatasourceStatusIdentityResponseComponent {
if o == nil {
return nil
}
return o.Memberships
}
// DatasourceVisibility - The visibility of the datasource, an enum of VISIBLE_TO_ALL, VISIBLE_TO_TEST_GROUP, NOT_VISIBLE
type DatasourceVisibility string
const (
DatasourceVisibilityEnabledForAll DatasourceVisibility = "ENABLED_FOR_ALL"
DatasourceVisibilityEnabledForTestGroup DatasourceVisibility = "ENABLED_FOR_TEST_GROUP"
DatasourceVisibilityNotEnabled DatasourceVisibility = "NOT_ENABLED"
)
func (e DatasourceVisibility) ToPointer() *DatasourceVisibility {
return &e
}
func (e *DatasourceVisibility) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "ENABLED_FOR_ALL":
fallthrough
case "ENABLED_FOR_TEST_GROUP":
fallthrough
case "NOT_ENABLED":
*e = DatasourceVisibility(v)
return nil
default:
return fmt.Errorf("invalid value for DatasourceVisibility: %v", v)
}
}
// DebugDatasourceStatusResponse - Describes the response body of the /debug/{datasource}/status API call
type DebugDatasourceStatusResponse struct {
Documents *Documents `json:"documents,omitempty"`
Identity *Identity `json:"identity,omitempty"`
// The visibility of the datasource, an enum of VISIBLE_TO_ALL, VISIBLE_TO_TEST_GROUP, NOT_VISIBLE
DatasourceVisibility *DatasourceVisibility `json:"datasourceVisibility,omitempty"`
}
func (o *DebugDatasourceStatusResponse) GetDocuments() *Documents {
if o == nil {
return nil
}
return o.Documents
}
func (o *DebugDatasourceStatusResponse) GetIdentity() *Identity {
if o == nil {
return nil
}
return o.Identity
}
func (o *DebugDatasourceStatusResponse) GetDatasourceVisibility() *DatasourceVisibility {
if o == nil {
return nil
}
return o.DatasourceVisibility
}