-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest_type_enum.go
89 lines (70 loc) · 1.63 KB
/
rest_type_enum.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
// Copyright (c) Topicus Security B.V.
// SPDX-License-Identifier: APSL-2.0
package model
import "log"
type restEnumType struct {
reachable bool
suffix string
name string
values []any
}
func NewRestEnumType(name string, values []any) RestType {
return &restEnumType{
suffix: "RS",
name: name,
values: values,
}
}
func (t *restEnumType) Reachable() bool {
return t.reachable
}
func (t *restEnumType) MarkReachable() {
t.reachable = true
}
func (t *restEnumType) Extends(typeName string) bool {
return false
}
func (t *restEnumType) IsObject() bool {
return false
}
func (t *restEnumType) ObjectAttrTypesName() string {
log.Fatalf("Enum type %s has no attributes", t.name)
return ""
}
func (t *restEnumType) DataStructName() string {
log.Fatalf("Enum type %s has no attributes", t.name)
return ""
}
func (t *restEnumType) APITypeName() string {
return t.name
}
func (t *restEnumType) APIDiscriminator() string {
return ""
}
func (t *restEnumType) GoTypeName() string {
log.Fatalf("Enum type %s has no attributes", t.name)
return ""
}
func (t *restEnumType) SDKTypeName() string {
return "keyhubmodel." + FirstCharToUpper(t.name)
}
func (t *restEnumType) SDKTypeConstructor() string {
return "keyhubmodel.Parse" + FirstCharToUpper(t.name)
}
func (t *restEnumType) AllProperties() []*RestProperty {
log.Fatalf("Enum type %s has no attributes", t.name)
return nil
}
func (t *restEnumType) HasDirectUUIDProperty() bool {
return false
}
func (t *restEnumType) Suffix() string {
return t.suffix
}
func (t *restEnumType) DS() RestType {
return &restEnumType{
suffix: "DS",
name: t.name,
values: t.values,
}
}