-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodels.go
172 lines (151 loc) · 5.54 KB
/
models.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
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
package goperset
import (
"context"
"net/http"
)
type LoginPayload struct {
Password string `json:"password"`
Provider string `json:"provider"`
Refresh bool `json:"refresh"`
Username string `json:"username"`
}
type ClientToken struct {
AccessToken string
CsrfToken string
}
type Goperset struct {
BasePath string
Client *http.Client
Context context.Context
}
type DashboardPayload struct {
CertificationDetails *string `json:"certification_details"`
CertifiedBy *string `json:"certified_by"`
Css *string `json:"css"`
DashboardTitle *string `json:"dashboard_title"`
ExternalUrl *string `json:"external_url"`
IsManagedExternally *bool `json:"is_managed_externally"`
JsonMetadata *string `json:"json_metadata"`
Owners []*int `json:"owners"`
PositionJson *string `json:"position_json"`
Published *bool `json:"published"`
Roles []*int `json:"roles"`
Slug *string `json:"slug"`
}
type GetDashboardParams struct {
Columns []*string `json:"columns"`
Filters []Filter `json:"filters"`
Keys []*string `json:"keys"`
OrderColumn *string `json:"order_column"`
OrderDirection *string `json:"order_direction"`
Page *int `json:"page"`
PageSize *int `json:"page_size"`
}
type Filter struct {
Col *string `json:"col"`
Opr *string `json:"opr"`
Value *int `json:"value"`
}
type PageInfo struct {
Page *int `json:"page"`
PageSize *int `json:"page_size"`
}
type DashboardInfoParams struct {
AddColumns map[string]PageInfo `json:"add_columns"`
EditColumns map[string]PageInfo `json:"edit_columns"`
Keys []*string `json:"keys"`
}
type DatabasePayload struct {
Engine *string `json:"engine"`
ConfigurationMethod *string `json:"configuration_method"`
DatabaseName *string `json:"database_name"`
SQLAlchemyURI *string `json:"sqlalchemy_uri"`
AllowCTAS *bool `json:"allow_ctas"`
AllowCVAS *bool `json:"allow_cvas"`
AllowDML *bool `json:"allow_dml"`
AllowFileUpload *bool `json:"allow_file_upload"`
AllowRunAsync *bool `json:"allow_run_async"`
CacheTimeout *int `json:"cache_timeout"`
Driver *string `json:"driver"`
ExposeInSqlLab *bool `json:"expose_in_sqllab"`
ExternalURL *string `json:"external_url"`
Extra *string `json:"extra"`
ForceCTASSchema *string `json:"force_ctas_schema"`
ImpersonateUser *bool `json:"impersonate_user"`
IsManagedExternally *bool `json:"is_managed_externally"`
MaskedEncryptedExtra *string `json:"masked_encrypted_extra"`
Parameters *map[string]string `json:"parameters"`
ServerCert *string `json:"server_cert"`
SSHTunnel *SSHTunnelDetails `json:"ssh_tunnel"`
UUID *string `json:"uuid"`
}
type SSHTunnelDetails struct {
ID *int `json:"id"`
Password *string `json:"password"`
PrivateKey *string `json:"private_key"`
PrivateKeyPassword *string `json:"private_key_password"`
ServerAddress *string `json:"server_address"`
ServerPort *int `json:"server_port"`
Username *string `json:"username"`
}
type DatasetPayload struct {
Database *int `json:"database"`
ExternalURL *string `json:"external_url"`
IsManagedExternally *bool `json:"is_managed_externally"`
Owners *[]int `json:"owners"`
Schema *string `json:"schema"`
SQL *string `json:"sql"`
TableName *string `json:"table_name"`
}
type ChartPayload struct {
CacheTimeout *int `json:"cache_timeout"`
CertificationDetails *string `json:"certification_details"`
CertifiedBy *string `json:"certified_by"`
Dashboards *[]int `json:"dashboards"`
DatasourceID *int `json:"datasource_id"`
DatasourceName *string `json:"datasource_name"`
DatasourceType *string `json:"datasource_type"`
Description *string `json:"description"`
ExternalURL *string `json:"external_url"`
IsManagedExternally *bool `json:"is_managed_externally"`
Owners *[]int `json:"owners"`
Params *string `json:"params"`
QueryContext *string `json:"query_context"`
QueryContextGeneration *bool `json:"query_context_generation"`
SliceName *string `json:"slice_name"`
VizType *[]string `json:"viz_type"`
}
type EmbedPayload struct {
AllowedDomains *[]string `json:"allowed_domains"`
}
type DashboardRolesPayload struct {
Published bool `json:"published"`
DashboardRoles []int `json:"roles"`
}
type RolePayload struct {
RoleName string `json:"name"`
}
type LoginResponse struct {
AccessToken string `json:"access_token"`
}
type CsrfResponse struct {
AccessToken string `json:"result"`
}
type RolesResponse struct {
Result []struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"result"`
}
type RoleResponse struct {
ID int `json:"id"`
Result struct {
Name string `json:"name"`
} `json:"result"`
}
type EmbedResponse struct {
Result struct {
UUID string `json:"uuid"`
DashboardID string `json:"dashboard_id"`
} `json:"result"`
}