-
Notifications
You must be signed in to change notification settings - Fork 13
/
template.go
137 lines (117 loc) · 2.9 KB
/
template.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
// SPDX-License-Identifier: Apache-2.0
//nolint:dupl // ignore false positive with build_queue.go
package library
import (
"fmt"
)
// Template is the library representation of a template for a pipeline.
//
// swagger:model Template
type Template struct {
Link *string `json:"link,omitempty"`
Name *string `json:"name,omitempty"`
Source *string `json:"source,omitempty"`
Type *string `json:"type,omitempty"`
}
// GetLink returns the Link field.
//
// When the provided Template type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (t *Template) GetLink() string {
// return zero value if Template type or Link field is nil
if t == nil || t.Link == nil {
return ""
}
return *t.Link
}
// GetName returns the Name field.
//
// When the provided Template type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (t *Template) GetName() string {
// return zero value if Template type or Name field is nil
if t == nil || t.Name == nil {
return ""
}
return *t.Name
}
// GetSource returns the Source field.
//
// When the provided Template type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (t *Template) GetSource() string {
// return zero value if Template type or Source field is nil
if t == nil || t.Source == nil {
return ""
}
return *t.Source
}
// GetType returns the Type field.
//
// When the provided Template type is nil, or the field within
// the type is nil, it returns the zero value for the field.
func (t *Template) GetType() string {
// return zero value if Template type or Type field is nil
if t == nil || t.Type == nil {
return ""
}
return *t.Type
}
// SetLink sets the Link field.
//
// When the provided Template type is nil, it
// will set nothing and immediately return.
func (t *Template) SetLink(v string) {
// return if Template type is nil
if t == nil {
return
}
t.Link = &v
}
// SetName sets the Name field.
//
// When the provided Template type is nil, it
// will set nothing and immediately return.
func (t *Template) SetName(v string) {
// return if Template type is nil
if t == nil {
return
}
t.Name = &v
}
// SetSource sets the Source field.
//
// When the provided Template type is nil, it
// will set nothing and immediately return.
func (t *Template) SetSource(v string) {
// return if Template type is nil
if t == nil {
return
}
t.Source = &v
}
// SetType sets the Type field.
//
// When the provided Template type is nil, it
// will set nothing and immediately return.
func (t *Template) SetType(v string) {
// return if Template type is nil
if t == nil {
return
}
t.Type = &v
}
// String implements the Stringer interface for the Template type.
func (t *Template) String() string {
return fmt.Sprintf(`{
Link: %s,
Name: %s,
Source: %s,
Type: %s,
}`,
t.GetLink(),
t.GetName(),
t.GetSource(),
t.GetType(),
)
}