This repository was archived by the owner on Jul 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_repository_patch_dto.go
More file actions
455 lines (377 loc) · 12.4 KB
/
model_repository_patch_dto.go
File metadata and controls
455 lines (377 loc) · 12.4 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
/*
Metadata
Obtain and manage metadata for owners, services, repositories. Please see [README](https://github.com/Interhyp/metadata-service/blob/main/README.md) for details. **CLIENTS MUST READ!**
API version: v1
Contact: somebody@some-organisation.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"fmt"
)
// checks if the RepositoryPatchDto type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RepositoryPatchDto{}
// RepositoryPatchDto struct for RepositoryPatchDto
type RepositoryPatchDto struct {
// The alias of the repository owner
Owner *string `json:"owner,omitempty"`
Url *string `json:"url,omitempty"`
Mainline *string `json:"mainline,omitempty"`
// the generator used for the initial contents of this repository
Generator *string `json:"generator,omitempty"`
Configuration *RepositoryConfigurationPatchDto `json:"configuration,omitempty"`
// ISO-8601 UTC date time at which this information was originally committed. When sending an update, include the original timestamp you got so we can detect concurrent updates.
TimeStamp string `json:"timeStamp" yaml:"-"`
// The git commit hash this information was originally committed under. When sending an update, include the original commitHash you got so we can detect concurrent updates.
CommitHash string `json:"commitHash" yaml:"-"`
// The jira issue to use for committing a change, or the last jira issue used.
JiraIssue string `json:"jiraIssue" yaml:"-"`
// A map of arbitrary string labels attached to this repository.
Labels map[string]string `json:"labels,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RepositoryPatchDto RepositoryPatchDto
// NewRepositoryPatchDto instantiates a new RepositoryPatchDto 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 NewRepositoryPatchDto(timeStamp string, commitHash string, jiraIssue string) *RepositoryPatchDto {
this := RepositoryPatchDto{}
this.TimeStamp = timeStamp
this.CommitHash = commitHash
this.JiraIssue = jiraIssue
return &this
}
// NewRepositoryPatchDtoWithDefaults instantiates a new RepositoryPatchDto 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 NewRepositoryPatchDtoWithDefaults() *RepositoryPatchDto {
this := RepositoryPatchDto{}
return &this
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *RepositoryPatchDto) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *RepositoryPatchDto) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *RepositoryPatchDto) SetOwner(v string) {
o.Owner = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *RepositoryPatchDto) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *RepositoryPatchDto) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *RepositoryPatchDto) SetUrl(v string) {
o.Url = &v
}
// GetMainline returns the Mainline field value if set, zero value otherwise.
func (o *RepositoryPatchDto) GetMainline() string {
if o == nil || IsNil(o.Mainline) {
var ret string
return ret
}
return *o.Mainline
}
// GetMainlineOk returns a tuple with the Mainline field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetMainlineOk() (*string, bool) {
if o == nil || IsNil(o.Mainline) {
return nil, false
}
return o.Mainline, true
}
// HasMainline returns a boolean if a field has been set.
func (o *RepositoryPatchDto) HasMainline() bool {
if o != nil && !IsNil(o.Mainline) {
return true
}
return false
}
// SetMainline gets a reference to the given string and assigns it to the Mainline field.
func (o *RepositoryPatchDto) SetMainline(v string) {
o.Mainline = &v
}
// GetGenerator returns the Generator field value if set, zero value otherwise.
func (o *RepositoryPatchDto) GetGenerator() string {
if o == nil || IsNil(o.Generator) {
var ret string
return ret
}
return *o.Generator
}
// GetGeneratorOk returns a tuple with the Generator field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetGeneratorOk() (*string, bool) {
if o == nil || IsNil(o.Generator) {
return nil, false
}
return o.Generator, true
}
// HasGenerator returns a boolean if a field has been set.
func (o *RepositoryPatchDto) HasGenerator() bool {
if o != nil && !IsNil(o.Generator) {
return true
}
return false
}
// SetGenerator gets a reference to the given string and assigns it to the Generator field.
func (o *RepositoryPatchDto) SetGenerator(v string) {
o.Generator = &v
}
// GetConfiguration returns the Configuration field value if set, zero value otherwise.
func (o *RepositoryPatchDto) GetConfiguration() RepositoryConfigurationPatchDto {
if o == nil || IsNil(o.Configuration) {
var ret RepositoryConfigurationPatchDto
return ret
}
return *o.Configuration
}
// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetConfigurationOk() (*RepositoryConfigurationPatchDto, bool) {
if o == nil || IsNil(o.Configuration) {
return nil, false
}
return o.Configuration, true
}
// HasConfiguration returns a boolean if a field has been set.
func (o *RepositoryPatchDto) HasConfiguration() bool {
if o != nil && !IsNil(o.Configuration) {
return true
}
return false
}
// SetConfiguration gets a reference to the given RepositoryConfigurationPatchDto and assigns it to the Configuration field.
func (o *RepositoryPatchDto) SetConfiguration(v RepositoryConfigurationPatchDto) {
o.Configuration = &v
}
// GetTimeStamp returns the TimeStamp field value
func (o *RepositoryPatchDto) GetTimeStamp() string {
if o == nil {
var ret string
return ret
}
return o.TimeStamp
}
// GetTimeStampOk returns a tuple with the TimeStamp field value
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetTimeStampOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TimeStamp, true
}
// SetTimeStamp sets field value
func (o *RepositoryPatchDto) SetTimeStamp(v string) {
o.TimeStamp = v
}
// GetCommitHash returns the CommitHash field value
func (o *RepositoryPatchDto) GetCommitHash() string {
if o == nil {
var ret string
return ret
}
return o.CommitHash
}
// GetCommitHashOk returns a tuple with the CommitHash field value
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetCommitHashOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CommitHash, true
}
// SetCommitHash sets field value
func (o *RepositoryPatchDto) SetCommitHash(v string) {
o.CommitHash = v
}
// GetJiraIssue returns the JiraIssue field value
func (o *RepositoryPatchDto) GetJiraIssue() string {
if o == nil {
var ret string
return ret
}
return o.JiraIssue
}
// GetJiraIssueOk returns a tuple with the JiraIssue field value
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetJiraIssueOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.JiraIssue, true
}
// SetJiraIssue sets field value
func (o *RepositoryPatchDto) SetJiraIssue(v string) {
o.JiraIssue = v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *RepositoryPatchDto) GetLabels() map[string]string {
if o == nil || IsNil(o.Labels) {
var ret map[string]string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RepositoryPatchDto) GetLabelsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Labels) {
return map[string]string{}, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *RepositoryPatchDto) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *RepositoryPatchDto) SetLabels(v map[string]string) {
o.Labels = v
}
func (o RepositoryPatchDto) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RepositoryPatchDto) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
if !IsNil(o.Mainline) {
toSerialize["mainline"] = o.Mainline
}
if !IsNil(o.Generator) {
toSerialize["generator"] = o.Generator
}
if !IsNil(o.Configuration) {
toSerialize["configuration"] = o.Configuration
}
toSerialize["timeStamp"] = o.TimeStamp
toSerialize["commitHash"] = o.CommitHash
toSerialize["jiraIssue"] = o.JiraIssue
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RepositoryPatchDto) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"timeStamp",
"commitHash",
"jiraIssue",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRepositoryPatchDto := _RepositoryPatchDto{}
err = json.Unmarshal(data, &varRepositoryPatchDto)
if err != nil {
return err
}
*o = RepositoryPatchDto(varRepositoryPatchDto)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "owner")
delete(additionalProperties, "url")
delete(additionalProperties, "mainline")
delete(additionalProperties, "generator")
delete(additionalProperties, "configuration")
delete(additionalProperties, "timeStamp")
delete(additionalProperties, "commitHash")
delete(additionalProperties, "jiraIssue")
delete(additionalProperties, "labels")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRepositoryPatchDto struct {
value *RepositoryPatchDto
isSet bool
}
func (v NullableRepositoryPatchDto) Get() *RepositoryPatchDto {
return v.value
}
func (v *NullableRepositoryPatchDto) Set(val *RepositoryPatchDto) {
v.value = val
v.isSet = true
}
func (v NullableRepositoryPatchDto) IsSet() bool {
return v.isSet
}
func (v *NullableRepositoryPatchDto) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRepositoryPatchDto(val *RepositoryPatchDto) *NullableRepositoryPatchDto {
return &NullableRepositoryPatchDto{value: val, isSet: true}
}
func (v NullableRepositoryPatchDto) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRepositoryPatchDto) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}