@@ -16,6 +16,17 @@ const (
16
16
ScorecardDetailsWeightageStrategyEQUALWEIGHTS string = "EQUAL_WEIGHTS"
17
17
)
18
18
19
+ const (
20
+ ChecksSortOrderAsc string = "ASC"
21
+ ChecksSortOrderDesc string = "DESC"
22
+ )
23
+
24
+ const (
25
+ ChecksSortTypeName string = "name"
26
+ ChecksSortTypeDescription string = "description"
27
+ ChecksSortTypeDataSource string = "data_source"
28
+ )
29
+
19
30
type GetEntityParams struct {
20
31
BranchName string `form:"branch_name,omitempty" json:"branch_name,omitempty"`
21
32
ConnectorRef string `form:"connector_ref,omitempty" json:"connector_ref,omitempty"`
@@ -218,6 +229,109 @@ type ScorecardScore struct {
218
229
ScorecardName string `json:"scorecard_name"`
219
230
}
220
231
232
+ // ScorecardStats ScorecardStats
233
+ type ScorecardStats struct {
234
+ Kind string `json:"kind"`
235
+ Name string `json:"name"`
236
+ Namespace string `json:"namespace"`
237
+ Owner string `json:"owner"`
238
+ Score int `json:"score"`
239
+ System string `json:"system"`
240
+ Type string `json:"type"`
241
+ }
242
+
243
+ // ScorecardStatsResponse ScorecardStatsResponse
244
+ type ScorecardStatsResponse struct {
245
+ Name string `json:"name"`
246
+ Stats []ScorecardStats `json:"stats"`
247
+ Timestamp * int64 `json:"timestamp,omitempty"`
248
+ }
249
+
250
+ type ScorecardStatsResponseWithHumanReadableTime struct {
251
+ Name string `json:"name"`
252
+ Stats []ScorecardStats `json:"stats"`
253
+ Time string `json:"time,omitempty"`
254
+ }
255
+
256
+ type GetChecksParams struct {
257
+ Page int32
258
+ Limit int32
259
+ Sort string
260
+ SearchTerm string
261
+ }
262
+
263
+ type CheckResponseList = []CheckResponse
264
+
265
+ type CheckListItem struct {
266
+ Custom bool `json:"custom"`
267
+ DataSource []string `json:"data_source"`
268
+ Description * string `json:"description,omitempty"`
269
+ Expression * string `json:"expression,omitempty"`
270
+ Identifier string `json:"identifier"`
271
+ Name string `json:"name"`
272
+ Percentage * float64 `json:"percentage,omitempty"`
273
+ Tags * []string `json:"tags,omitempty"`
274
+ }
275
+
276
+ type CheckResponse struct {
277
+ Check * CheckListItem `json:"check,omitempty"`
278
+ }
279
+
280
+ type CheckDetails struct {
281
+ Custom bool `json:"custom"`
282
+ DefaultBehaviour string `json:"default_behaviour"`
283
+ Description * string `json:"description,omitempty"`
284
+ Expression * string `json:"expression,omitempty"`
285
+ FailMessage * string `json:"fail_message,omitempty"`
286
+ HarnessManaged * bool `json:"harness_managed,omitempty"`
287
+ Identifier string `json:"identifier"`
288
+ Name string `json:"name"`
289
+ Percentage * float64 `json:"percentage,omitempty"`
290
+ RuleStrategy string `json:"rule_strategy"`
291
+ Rules []Rule `json:"rules"`
292
+ Tags * []string `json:"tags,omitempty"`
293
+ }
294
+
295
+ type Rule struct {
296
+ DataPointIdentifier string `json:"data_point_identifier"`
297
+ DataSourceIdentifier string `json:"data_source_identifier"`
298
+ Identifier * string `json:"identifier,omitempty"`
299
+ InputValues * []InputValue `json:"input_values,omitempty"`
300
+ Operator string `json:"operator"`
301
+ Value * string `json:"value,omitempty"`
302
+ }
303
+
304
+ type InputValue struct {
305
+ Key string `json:"key"`
306
+ Value string `json:"value"`
307
+ }
308
+
309
+ type CheckDetailsResponse struct {
310
+ CheckDetails CheckDetails `json:"check_details"`
311
+ }
312
+
313
+ type CheckStats struct {
314
+ Kind string `json:"kind"`
315
+ Name string `json:"name"`
316
+ Namespace string `json:"namespace"`
317
+ Owner string `json:"owner"`
318
+ Status string `json:"status"`
319
+ System string `json:"system"`
320
+ Type string `json:"type"`
321
+ }
322
+
323
+ type CheckStatsResponse struct {
324
+ Name string `json:"name"`
325
+ Stats []CheckStats `json:"stats"`
326
+ Timestamp * int64 `json:"timestamp,omitempty"`
327
+ }
328
+
329
+ type CheckStatsResponseWithHumanReadableTime struct {
330
+ Name string `json:"name"`
331
+ Stats []CheckStats `json:"stats"`
332
+ Time string `json:"time,omitempty"`
333
+ }
334
+
221
335
type ExecuteWorkflowRequest struct {
222
336
Identifier string `json:"identifier"`
223
337
Values interface {} `json:"values,omitempty"`
0 commit comments