-
Notifications
You must be signed in to change notification settings - Fork 69
/
oas_schemas_gen.go
75 lines (62 loc) · 1.39 KB
/
oas_schemas_gen.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
// Code generated by ogen, DO NOT EDIT.
package api
// NewOptPerson returns new OptPerson with value set to v.
func NewOptPerson(v Person) OptPerson {
return OptPerson{
Value: v,
Set: true,
}
}
// OptPerson is optional Person.
type OptPerson struct {
Value Person
Set bool
}
// IsSet returns true if OptPerson was set.
func (o OptPerson) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptPerson) Reset() {
var v Person
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptPerson) SetTo(v Person) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptPerson) Get() (v Person, ok bool) {
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptPerson) Or(d Person) Person {
if v, ok := o.Get(); ok {
return v
}
return d
}
// Ref: #/components/schemas/User
type Person struct {
Field string `json:"RenameField"`
Parent *Person `json:"RefField"`
}
// GetField returns the value of Field.
func (s *Person) GetField() string {
return s.Field
}
// GetParent returns the value of Parent.
func (s *Person) GetParent() *Person {
return s.Parent
}
// SetField sets the value of Field.
func (s *Person) SetField(val string) {
s.Field = val
}
// SetParent sets the value of Parent.
func (s *Person) SetParent(val *Person) {
s.Parent = val
}