/
model_v1_custom_build_strategy.go
338 lines (283 loc) · 9.78 KB
/
model_v1_custom_build_strategy.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
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
/*
Arvancloud PaaS REST API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: v1.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package paas
import (
"encoding/json"
)
// checks if the V1CustomBuildStrategy type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &V1CustomBuildStrategy{}
// V1CustomBuildStrategy CustomBuildStrategy defines input parameters specific to Custom build.
type V1CustomBuildStrategy struct {
// buildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder
BuildAPIVersion *string `json:"buildAPIVersion,omitempty"`
// env contains additional environment variables you want to pass into a builder container.
Env []V1EnvVar `json:"env,omitempty"`
// exposeDockerSocket will allow running Docker commands (and build Docker images) from inside the Docker container.
ExposeDockerSocket *bool `json:"exposeDockerSocket,omitempty"`
// forcePull describes if the controller should configure the build pod to always pull the images for the builder or only pull if it is not present locally
ForcePull *bool `json:"forcePull,omitempty"`
From V1ObjectReference `json:"from"`
PullSecret *V1LocalObjectReference `json:"pullSecret,omitempty"`
// secrets is a list of additional secrets that will be included in the build pod
Secrets []V1SecretSpec `json:"secrets,omitempty"`
}
// NewV1CustomBuildStrategy instantiates a new V1CustomBuildStrategy object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewV1CustomBuildStrategy(from V1ObjectReference) *V1CustomBuildStrategy {
this := V1CustomBuildStrategy{}
this.From = from
return &this
}
// NewV1CustomBuildStrategyWithDefaults instantiates a new V1CustomBuildStrategy object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewV1CustomBuildStrategyWithDefaults() *V1CustomBuildStrategy {
this := V1CustomBuildStrategy{}
return &this
}
// GetBuildAPIVersion returns the BuildAPIVersion field value if set, zero value otherwise.
func (o *V1CustomBuildStrategy) GetBuildAPIVersion() string {
if o == nil || IsNil(o.BuildAPIVersion) {
var ret string
return ret
}
return *o.BuildAPIVersion
}
// GetBuildAPIVersionOk returns a tuple with the BuildAPIVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetBuildAPIVersionOk() (*string, bool) {
if o == nil || IsNil(o.BuildAPIVersion) {
return nil, false
}
return o.BuildAPIVersion, true
}
// HasBuildAPIVersion returns a boolean if a field has been set.
func (o *V1CustomBuildStrategy) HasBuildAPIVersion() bool {
if o != nil && !IsNil(o.BuildAPIVersion) {
return true
}
return false
}
// SetBuildAPIVersion gets a reference to the given string and assigns it to the BuildAPIVersion field.
func (o *V1CustomBuildStrategy) SetBuildAPIVersion(v string) {
o.BuildAPIVersion = &v
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *V1CustomBuildStrategy) GetEnv() []V1EnvVar {
if o == nil || IsNil(o.Env) {
var ret []V1EnvVar
return ret
}
return o.Env
}
// GetEnvOk returns a tuple with the Env field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetEnvOk() ([]V1EnvVar, bool) {
if o == nil || IsNil(o.Env) {
return nil, false
}
return o.Env, true
}
// HasEnv returns a boolean if a field has been set.
func (o *V1CustomBuildStrategy) HasEnv() bool {
if o != nil && !IsNil(o.Env) {
return true
}
return false
}
// SetEnv gets a reference to the given []V1EnvVar and assigns it to the Env field.
func (o *V1CustomBuildStrategy) SetEnv(v []V1EnvVar) {
o.Env = v
}
// GetExposeDockerSocket returns the ExposeDockerSocket field value if set, zero value otherwise.
func (o *V1CustomBuildStrategy) GetExposeDockerSocket() bool {
if o == nil || IsNil(o.ExposeDockerSocket) {
var ret bool
return ret
}
return *o.ExposeDockerSocket
}
// GetExposeDockerSocketOk returns a tuple with the ExposeDockerSocket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetExposeDockerSocketOk() (*bool, bool) {
if o == nil || IsNil(o.ExposeDockerSocket) {
return nil, false
}
return o.ExposeDockerSocket, true
}
// HasExposeDockerSocket returns a boolean if a field has been set.
func (o *V1CustomBuildStrategy) HasExposeDockerSocket() bool {
if o != nil && !IsNil(o.ExposeDockerSocket) {
return true
}
return false
}
// SetExposeDockerSocket gets a reference to the given bool and assigns it to the ExposeDockerSocket field.
func (o *V1CustomBuildStrategy) SetExposeDockerSocket(v bool) {
o.ExposeDockerSocket = &v
}
// GetForcePull returns the ForcePull field value if set, zero value otherwise.
func (o *V1CustomBuildStrategy) GetForcePull() bool {
if o == nil || IsNil(o.ForcePull) {
var ret bool
return ret
}
return *o.ForcePull
}
// GetForcePullOk returns a tuple with the ForcePull field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetForcePullOk() (*bool, bool) {
if o == nil || IsNil(o.ForcePull) {
return nil, false
}
return o.ForcePull, true
}
// HasForcePull returns a boolean if a field has been set.
func (o *V1CustomBuildStrategy) HasForcePull() bool {
if o != nil && !IsNil(o.ForcePull) {
return true
}
return false
}
// SetForcePull gets a reference to the given bool and assigns it to the ForcePull field.
func (o *V1CustomBuildStrategy) SetForcePull(v bool) {
o.ForcePull = &v
}
// GetFrom returns the From field value
func (o *V1CustomBuildStrategy) GetFrom() V1ObjectReference {
if o == nil {
var ret V1ObjectReference
return ret
}
return o.From
}
// GetFromOk returns a tuple with the From field value
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetFromOk() (*V1ObjectReference, bool) {
if o == nil {
return nil, false
}
return &o.From, true
}
// SetFrom sets field value
func (o *V1CustomBuildStrategy) SetFrom(v V1ObjectReference) {
o.From = v
}
// GetPullSecret returns the PullSecret field value if set, zero value otherwise.
func (o *V1CustomBuildStrategy) GetPullSecret() V1LocalObjectReference {
if o == nil || IsNil(o.PullSecret) {
var ret V1LocalObjectReference
return ret
}
return *o.PullSecret
}
// GetPullSecretOk returns a tuple with the PullSecret field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetPullSecretOk() (*V1LocalObjectReference, bool) {
if o == nil || IsNil(o.PullSecret) {
return nil, false
}
return o.PullSecret, true
}
// HasPullSecret returns a boolean if a field has been set.
func (o *V1CustomBuildStrategy) HasPullSecret() bool {
if o != nil && !IsNil(o.PullSecret) {
return true
}
return false
}
// SetPullSecret gets a reference to the given V1LocalObjectReference and assigns it to the PullSecret field.
func (o *V1CustomBuildStrategy) SetPullSecret(v V1LocalObjectReference) {
o.PullSecret = &v
}
// GetSecrets returns the Secrets field value if set, zero value otherwise.
func (o *V1CustomBuildStrategy) GetSecrets() []V1SecretSpec {
if o == nil || IsNil(o.Secrets) {
var ret []V1SecretSpec
return ret
}
return o.Secrets
}
// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1CustomBuildStrategy) GetSecretsOk() ([]V1SecretSpec, bool) {
if o == nil || IsNil(o.Secrets) {
return nil, false
}
return o.Secrets, true
}
// HasSecrets returns a boolean if a field has been set.
func (o *V1CustomBuildStrategy) HasSecrets() bool {
if o != nil && !IsNil(o.Secrets) {
return true
}
return false
}
// SetSecrets gets a reference to the given []V1SecretSpec and assigns it to the Secrets field.
func (o *V1CustomBuildStrategy) SetSecrets(v []V1SecretSpec) {
o.Secrets = v
}
func (o V1CustomBuildStrategy) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o V1CustomBuildStrategy) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BuildAPIVersion) {
toSerialize["buildAPIVersion"] = o.BuildAPIVersion
}
if !IsNil(o.Env) {
toSerialize["env"] = o.Env
}
if !IsNil(o.ExposeDockerSocket) {
toSerialize["exposeDockerSocket"] = o.ExposeDockerSocket
}
if !IsNil(o.ForcePull) {
toSerialize["forcePull"] = o.ForcePull
}
toSerialize["from"] = o.From
if !IsNil(o.PullSecret) {
toSerialize["pullSecret"] = o.PullSecret
}
if !IsNil(o.Secrets) {
toSerialize["secrets"] = o.Secrets
}
return toSerialize, nil
}
type NullableV1CustomBuildStrategy struct {
value *V1CustomBuildStrategy
isSet bool
}
func (v NullableV1CustomBuildStrategy) Get() *V1CustomBuildStrategy {
return v.value
}
func (v *NullableV1CustomBuildStrategy) Set(val *V1CustomBuildStrategy) {
v.value = val
v.isSet = true
}
func (v NullableV1CustomBuildStrategy) IsSet() bool {
return v.isSet
}
func (v *NullableV1CustomBuildStrategy) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV1CustomBuildStrategy(val *V1CustomBuildStrategy) *NullableV1CustomBuildStrategy {
return &NullableV1CustomBuildStrategy{value: val, isSet: true}
}
func (v NullableV1CustomBuildStrategy) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV1CustomBuildStrategy) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}