-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathobservability_scorecard.go
More file actions
591 lines (512 loc) · 21.3 KB
/
observability_scorecard.go
File metadata and controls
591 lines (512 loc) · 21.3 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
// Code generated by Fern. DO NOT EDIT.
package api
import (
json "encoding/json"
fmt "fmt"
internal "github.com/VapiAI/server-sdk-go/v505/internal"
big "math/big"
time "time"
)
var (
scorecardControllerGetRequestFieldId = big.NewInt(1 << 0)
)
type ScorecardControllerGetRequest struct {
Id string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (s *ScorecardControllerGetRequest) require(field *big.Int) {
if s.explicitFields == nil {
s.explicitFields = big.NewInt(0)
}
s.explicitFields.Or(s.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetRequest) SetId(id string) {
s.Id = id
s.require(scorecardControllerGetRequestFieldId)
}
var (
scorecardControllerGetPaginatedRequestFieldId = big.NewInt(1 << 0)
scorecardControllerGetPaginatedRequestFieldPage = big.NewInt(1 << 1)
scorecardControllerGetPaginatedRequestFieldSortOrder = big.NewInt(1 << 2)
scorecardControllerGetPaginatedRequestFieldLimit = big.NewInt(1 << 3)
scorecardControllerGetPaginatedRequestFieldCreatedAtGt = big.NewInt(1 << 4)
scorecardControllerGetPaginatedRequestFieldCreatedAtLt = big.NewInt(1 << 5)
scorecardControllerGetPaginatedRequestFieldCreatedAtGe = big.NewInt(1 << 6)
scorecardControllerGetPaginatedRequestFieldCreatedAtLe = big.NewInt(1 << 7)
scorecardControllerGetPaginatedRequestFieldUpdatedAtGt = big.NewInt(1 << 8)
scorecardControllerGetPaginatedRequestFieldUpdatedAtLt = big.NewInt(1 << 9)
scorecardControllerGetPaginatedRequestFieldUpdatedAtGe = big.NewInt(1 << 10)
scorecardControllerGetPaginatedRequestFieldUpdatedAtLe = big.NewInt(1 << 11)
)
type ScorecardControllerGetPaginatedRequest struct {
Id *string `json:"-" url:"id,omitempty"`
// This is the page number to return. Defaults to 1.
Page *float64 `json:"-" url:"page,omitempty"`
// This is the sort order for pagination. Defaults to 'DESC'.
SortOrder *ScorecardControllerGetPaginatedRequestSortOrder `json:"-" url:"sortOrder,omitempty"`
// This is the maximum number of items to return. Defaults to 100.
Limit *float64 `json:"-" url:"limit,omitempty"`
// This will return items where the createdAt is greater than the specified value.
CreatedAtGt *time.Time `json:"-" url:"createdAtGt,omitempty"`
// This will return items where the createdAt is less than the specified value.
CreatedAtLt *time.Time `json:"-" url:"createdAtLt,omitempty"`
// This will return items where the createdAt is greater than or equal to the specified value.
CreatedAtGe *time.Time `json:"-" url:"createdAtGe,omitempty"`
// This will return items where the createdAt is less than or equal to the specified value.
CreatedAtLe *time.Time `json:"-" url:"createdAtLe,omitempty"`
// This will return items where the updatedAt is greater than the specified value.
UpdatedAtGt *time.Time `json:"-" url:"updatedAtGt,omitempty"`
// This will return items where the updatedAt is less than the specified value.
UpdatedAtLt *time.Time `json:"-" url:"updatedAtLt,omitempty"`
// This will return items where the updatedAt is greater than or equal to the specified value.
UpdatedAtGe *time.Time `json:"-" url:"updatedAtGe,omitempty"`
// This will return items where the updatedAt is less than or equal to the specified value.
UpdatedAtLe *time.Time `json:"-" url:"updatedAtLe,omitempty"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (s *ScorecardControllerGetPaginatedRequest) require(field *big.Int) {
if s.explicitFields == nil {
s.explicitFields = big.NewInt(0)
}
s.explicitFields.Or(s.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetId(id *string) {
s.Id = id
s.require(scorecardControllerGetPaginatedRequestFieldId)
}
// SetPage sets the Page field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetPage(page *float64) {
s.Page = page
s.require(scorecardControllerGetPaginatedRequestFieldPage)
}
// SetSortOrder sets the SortOrder field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetSortOrder(sortOrder *ScorecardControllerGetPaginatedRequestSortOrder) {
s.SortOrder = sortOrder
s.require(scorecardControllerGetPaginatedRequestFieldSortOrder)
}
// SetLimit sets the Limit field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetLimit(limit *float64) {
s.Limit = limit
s.require(scorecardControllerGetPaginatedRequestFieldLimit)
}
// SetCreatedAtGt sets the CreatedAtGt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetCreatedAtGt(createdAtGt *time.Time) {
s.CreatedAtGt = createdAtGt
s.require(scorecardControllerGetPaginatedRequestFieldCreatedAtGt)
}
// SetCreatedAtLt sets the CreatedAtLt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetCreatedAtLt(createdAtLt *time.Time) {
s.CreatedAtLt = createdAtLt
s.require(scorecardControllerGetPaginatedRequestFieldCreatedAtLt)
}
// SetCreatedAtGe sets the CreatedAtGe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetCreatedAtGe(createdAtGe *time.Time) {
s.CreatedAtGe = createdAtGe
s.require(scorecardControllerGetPaginatedRequestFieldCreatedAtGe)
}
// SetCreatedAtLe sets the CreatedAtLe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetCreatedAtLe(createdAtLe *time.Time) {
s.CreatedAtLe = createdAtLe
s.require(scorecardControllerGetPaginatedRequestFieldCreatedAtLe)
}
// SetUpdatedAtGt sets the UpdatedAtGt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetUpdatedAtGt(updatedAtGt *time.Time) {
s.UpdatedAtGt = updatedAtGt
s.require(scorecardControllerGetPaginatedRequestFieldUpdatedAtGt)
}
// SetUpdatedAtLt sets the UpdatedAtLt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetUpdatedAtLt(updatedAtLt *time.Time) {
s.UpdatedAtLt = updatedAtLt
s.require(scorecardControllerGetPaginatedRequestFieldUpdatedAtLt)
}
// SetUpdatedAtGe sets the UpdatedAtGe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetUpdatedAtGe(updatedAtGe *time.Time) {
s.UpdatedAtGe = updatedAtGe
s.require(scorecardControllerGetPaginatedRequestFieldUpdatedAtGe)
}
// SetUpdatedAtLe sets the UpdatedAtLe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerGetPaginatedRequest) SetUpdatedAtLe(updatedAtLe *time.Time) {
s.UpdatedAtLe = updatedAtLe
s.require(scorecardControllerGetPaginatedRequestFieldUpdatedAtLe)
}
var (
scorecardControllerRemoveRequestFieldId = big.NewInt(1 << 0)
)
type ScorecardControllerRemoveRequest struct {
Id string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (s *ScorecardControllerRemoveRequest) require(field *big.Int) {
if s.explicitFields == nil {
s.explicitFields = big.NewInt(0)
}
s.explicitFields.Or(s.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardControllerRemoveRequest) SetId(id string) {
s.Id = id
s.require(scorecardControllerRemoveRequestFieldId)
}
var (
updateScorecardDtoFieldId = big.NewInt(1 << 0)
updateScorecardDtoFieldName = big.NewInt(1 << 1)
updateScorecardDtoFieldDescription = big.NewInt(1 << 2)
updateScorecardDtoFieldMetrics = big.NewInt(1 << 3)
updateScorecardDtoFieldAssistantIds = big.NewInt(1 << 4)
)
type UpdateScorecardDto struct {
Id string `json:"-" url:"-"`
// This is the name of the scorecard. It is only for user reference and will not be used for any evaluation.
Name *string `json:"name,omitempty" url:"-"`
// This is the description of the scorecard. It is only for user reference and will not be used for any evaluation.
Description *string `json:"description,omitempty" url:"-"`
// These are the metrics that will be used to evaluate the scorecard.
// Each metric will have a set of conditions and points that will be used to generate the score.
Metrics []*ScorecardMetric `json:"metrics,omitempty" url:"-"`
// These are the assistant IDs that this scorecard is linked to.
// When linked to assistants, this scorecard will be available for evaluation during those assistants' calls.
AssistantIds []string `json:"assistantIds,omitempty" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (u *UpdateScorecardDto) require(field *big.Int) {
if u.explicitFields == nil {
u.explicitFields = big.NewInt(0)
}
u.explicitFields.Or(u.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScorecardDto) SetId(id string) {
u.Id = id
u.require(updateScorecardDtoFieldId)
}
// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScorecardDto) SetName(name *string) {
u.Name = name
u.require(updateScorecardDtoFieldName)
}
// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScorecardDto) SetDescription(description *string) {
u.Description = description
u.require(updateScorecardDtoFieldDescription)
}
// SetMetrics sets the Metrics field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScorecardDto) SetMetrics(metrics []*ScorecardMetric) {
u.Metrics = metrics
u.require(updateScorecardDtoFieldMetrics)
}
// SetAssistantIds sets the AssistantIds field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateScorecardDto) SetAssistantIds(assistantIds []string) {
u.AssistantIds = assistantIds
u.require(updateScorecardDtoFieldAssistantIds)
}
var (
scorecardFieldId = big.NewInt(1 << 0)
scorecardFieldOrgId = big.NewInt(1 << 1)
scorecardFieldCreatedAt = big.NewInt(1 << 2)
scorecardFieldUpdatedAt = big.NewInt(1 << 3)
scorecardFieldName = big.NewInt(1 << 4)
scorecardFieldDescription = big.NewInt(1 << 5)
scorecardFieldMetrics = big.NewInt(1 << 6)
scorecardFieldAssistantIds = big.NewInt(1 << 7)
)
type Scorecard struct {
// This is the unique identifier for the scorecard.
Id string `json:"id" url:"id"`
// This is the unique identifier for the org that this scorecard belongs to.
OrgId string `json:"orgId" url:"orgId"`
// This is the ISO 8601 date-time string of when the scorecard was created.
CreatedAt time.Time `json:"createdAt" url:"createdAt"`
// This is the ISO 8601 date-time string of when the scorecard was last updated.
UpdatedAt time.Time `json:"updatedAt" url:"updatedAt"`
// This is the name of the scorecard. It is only for user reference and will not be used for any evaluation.
Name *string `json:"name,omitempty" url:"name,omitempty"`
// This is the description of the scorecard. It is only for user reference and will not be used for any evaluation.
Description *string `json:"description,omitempty" url:"description,omitempty"`
// These are the metrics that will be used to evaluate the scorecard.
// Each metric will have a set of conditions and points that will be used to generate the score.
Metrics []*ScorecardMetric `json:"metrics" url:"metrics"`
// These are the assistant IDs that this scorecard is linked to.
// When linked to assistants, this scorecard will be available for evaluation during those assistants' calls.
AssistantIds []string `json:"assistantIds,omitempty" url:"assistantIds,omitempty"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (s *Scorecard) GetId() string {
if s == nil {
return ""
}
return s.Id
}
func (s *Scorecard) GetOrgId() string {
if s == nil {
return ""
}
return s.OrgId
}
func (s *Scorecard) GetCreatedAt() time.Time {
if s == nil {
return time.Time{}
}
return s.CreatedAt
}
func (s *Scorecard) GetUpdatedAt() time.Time {
if s == nil {
return time.Time{}
}
return s.UpdatedAt
}
func (s *Scorecard) GetName() *string {
if s == nil {
return nil
}
return s.Name
}
func (s *Scorecard) GetDescription() *string {
if s == nil {
return nil
}
return s.Description
}
func (s *Scorecard) GetMetrics() []*ScorecardMetric {
if s == nil {
return nil
}
return s.Metrics
}
func (s *Scorecard) GetAssistantIds() []string {
if s == nil {
return nil
}
return s.AssistantIds
}
func (s *Scorecard) GetExtraProperties() map[string]interface{} {
return s.extraProperties
}
func (s *Scorecard) require(field *big.Int) {
if s.explicitFields == nil {
s.explicitFields = big.NewInt(0)
}
s.explicitFields.Or(s.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetId(id string) {
s.Id = id
s.require(scorecardFieldId)
}
// SetOrgId sets the OrgId field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetOrgId(orgId string) {
s.OrgId = orgId
s.require(scorecardFieldOrgId)
}
// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetCreatedAt(createdAt time.Time) {
s.CreatedAt = createdAt
s.require(scorecardFieldCreatedAt)
}
// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetUpdatedAt(updatedAt time.Time) {
s.UpdatedAt = updatedAt
s.require(scorecardFieldUpdatedAt)
}
// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetName(name *string) {
s.Name = name
s.require(scorecardFieldName)
}
// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetDescription(description *string) {
s.Description = description
s.require(scorecardFieldDescription)
}
// SetMetrics sets the Metrics field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetMetrics(metrics []*ScorecardMetric) {
s.Metrics = metrics
s.require(scorecardFieldMetrics)
}
// SetAssistantIds sets the AssistantIds field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Scorecard) SetAssistantIds(assistantIds []string) {
s.AssistantIds = assistantIds
s.require(scorecardFieldAssistantIds)
}
func (s *Scorecard) UnmarshalJSON(data []byte) error {
type embed Scorecard
var unmarshaler = struct {
embed
CreatedAt *internal.DateTime `json:"createdAt"`
UpdatedAt *internal.DateTime `json:"updatedAt"`
}{
embed: embed(*s),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*s = Scorecard(unmarshaler.embed)
s.CreatedAt = unmarshaler.CreatedAt.Time()
s.UpdatedAt = unmarshaler.UpdatedAt.Time()
extraProperties, err := internal.ExtractExtraProperties(data, *s)
if err != nil {
return err
}
s.extraProperties = extraProperties
s.rawJSON = json.RawMessage(data)
return nil
}
func (s *Scorecard) MarshalJSON() ([]byte, error) {
type embed Scorecard
var marshaler = struct {
embed
CreatedAt *internal.DateTime `json:"createdAt"`
UpdatedAt *internal.DateTime `json:"updatedAt"`
}{
embed: embed(*s),
CreatedAt: internal.NewDateTime(s.CreatedAt),
UpdatedAt: internal.NewDateTime(s.UpdatedAt),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
return json.Marshal(explicitMarshaler)
}
func (s *Scorecard) String() string {
if len(s.rawJSON) > 0 {
if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}
var (
scorecardPaginatedResponseFieldResults = big.NewInt(1 << 0)
scorecardPaginatedResponseFieldMetadata = big.NewInt(1 << 1)
)
type ScorecardPaginatedResponse struct {
Results []*Scorecard `json:"results" url:"results"`
Metadata *PaginationMeta `json:"metadata" url:"metadata"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (s *ScorecardPaginatedResponse) GetResults() []*Scorecard {
if s == nil {
return nil
}
return s.Results
}
func (s *ScorecardPaginatedResponse) GetMetadata() *PaginationMeta {
if s == nil {
return nil
}
return s.Metadata
}
func (s *ScorecardPaginatedResponse) GetExtraProperties() map[string]interface{} {
return s.extraProperties
}
func (s *ScorecardPaginatedResponse) require(field *big.Int) {
if s.explicitFields == nil {
s.explicitFields = big.NewInt(0)
}
s.explicitFields.Or(s.explicitFields, field)
}
// SetResults sets the Results field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardPaginatedResponse) SetResults(results []*Scorecard) {
s.Results = results
s.require(scorecardPaginatedResponseFieldResults)
}
// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ScorecardPaginatedResponse) SetMetadata(metadata *PaginationMeta) {
s.Metadata = metadata
s.require(scorecardPaginatedResponseFieldMetadata)
}
func (s *ScorecardPaginatedResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ScorecardPaginatedResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*s = ScorecardPaginatedResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *s)
if err != nil {
return err
}
s.extraProperties = extraProperties
s.rawJSON = json.RawMessage(data)
return nil
}
func (s *ScorecardPaginatedResponse) MarshalJSON() ([]byte, error) {
type embed ScorecardPaginatedResponse
var marshaler = struct {
embed
}{
embed: embed(*s),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
return json.Marshal(explicitMarshaler)
}
func (s *ScorecardPaginatedResponse) String() string {
if len(s.rawJSON) > 0 {
if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}
type ScorecardControllerGetPaginatedRequestSortOrder string
const (
ScorecardControllerGetPaginatedRequestSortOrderAsc ScorecardControllerGetPaginatedRequestSortOrder = "ASC"
ScorecardControllerGetPaginatedRequestSortOrderDesc ScorecardControllerGetPaginatedRequestSortOrder = "DESC"
)
func NewScorecardControllerGetPaginatedRequestSortOrderFromString(s string) (ScorecardControllerGetPaginatedRequestSortOrder, error) {
switch s {
case "ASC":
return ScorecardControllerGetPaginatedRequestSortOrderAsc, nil
case "DESC":
return ScorecardControllerGetPaginatedRequestSortOrderDesc, nil
}
var t ScorecardControllerGetPaginatedRequestSortOrder
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (s ScorecardControllerGetPaginatedRequestSortOrder) Ptr() *ScorecardControllerGetPaginatedRequestSortOrder {
return &s
}