github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/resources/v1/ts_condition/ts_condition.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/alerting/proto/v1/ts_condition.proto 3 // DO NOT EDIT!!! 4 5 package ts_condition 6 7 import ( 8 "fmt" 9 "sort" 10 11 "google.golang.org/protobuf/proto" 12 googlefieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 13 14 gotenobject "github.com/cloudwan/goten-sdk/runtime/object" 15 ) 16 17 // proto imports 18 import ( 19 rcommon "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/common" 20 document "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/document" 21 log_condition_template "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/log_condition_template" 22 policy "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/policy" 23 meta "github.com/cloudwan/goten-sdk/types/meta" 24 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 25 ) 26 27 // ensure the imports are used 28 var ( 29 _ = new(fmt.Stringer) 30 _ = new(sort.Interface) 31 32 _ = new(proto.Message) 33 _ = googlefieldmaskpb.FieldMask{} 34 35 _ = new(gotenobject.FieldPath) 36 ) 37 38 // make sure we're using proto imports 39 var ( 40 _ = &document.Document{} 41 _ = &log_condition_template.LogConditionTemplate{} 42 _ = &policy.Policy{} 43 _ = &rcommon.LogCndSpec{} 44 _ = &fieldmaskpb.FieldMask{} 45 _ = &meta.Meta{} 46 ) 47 48 func (o *TsCondition) GotenObjectExt() {} 49 50 func (o *TsCondition) MakeFullFieldMask() *TsCondition_FieldMask { 51 return FullTsCondition_FieldMask() 52 } 53 54 func (o *TsCondition) MakeRawFullFieldMask() gotenobject.FieldMask { 55 return FullTsCondition_FieldMask() 56 } 57 58 func (o *TsCondition) MakeDiffFieldMask(other *TsCondition) *TsCondition_FieldMask { 59 if o == nil && other == nil { 60 return &TsCondition_FieldMask{} 61 } 62 if o == nil || other == nil { 63 return FullTsCondition_FieldMask() 64 } 65 66 res := &TsCondition_FieldMask{} 67 if o.GetName().String() != other.GetName().String() { 68 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorName}) 69 } 70 { 71 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 72 if subMask.IsFull() { 73 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorMetadata}) 74 } else { 75 for _, subpath := range subMask.Paths { 76 res.Paths = append(res.Paths, &TsCondition_FieldSubPath{selector: TsCondition_FieldPathSelectorMetadata, subPath: subpath}) 77 } 78 } 79 } 80 if o.GetDisplayName() != other.GetDisplayName() { 81 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorDisplayName}) 82 } 83 if o.GetDescription() != other.GetDescription() { 84 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorDescription}) 85 } 86 87 if len(o.GetSupportingDocs()) == len(other.GetSupportingDocs()) { 88 for i, lValue := range o.GetSupportingDocs() { 89 rValue := other.GetSupportingDocs()[i] 90 if lValue.String() != rValue.String() { 91 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorSupportingDocs}) 92 break 93 } 94 } 95 } else { 96 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorSupportingDocs}) 97 } 98 { 99 subMask := o.GetSpec().MakeDiffFieldMask(other.GetSpec()) 100 if subMask.IsFull() { 101 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorSpec}) 102 } else { 103 for _, subpath := range subMask.Paths { 104 res.Paths = append(res.Paths, &TsCondition_FieldSubPath{selector: TsCondition_FieldPathSelectorSpec, subPath: subpath}) 105 } 106 } 107 } 108 { 109 subMask := o.GetInternal().MakeDiffFieldMask(other.GetInternal()) 110 if subMask.IsFull() { 111 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorInternal}) 112 } else { 113 for _, subpath := range subMask.Paths { 114 res.Paths = append(res.Paths, &TsCondition_FieldSubPath{selector: TsCondition_FieldPathSelectorInternal, subPath: subpath}) 115 } 116 } 117 } 118 { 119 subMask := o.GetFilterSelector().MakeDiffFieldMask(other.GetFilterSelector()) 120 if subMask.IsFull() { 121 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorFilterSelector}) 122 } else { 123 for _, subpath := range subMask.Paths { 124 res.Paths = append(res.Paths, &TsCondition_FieldSubPath{selector: TsCondition_FieldPathSelectorFilterSelector, subPath: subpath}) 125 } 126 } 127 } 128 { 129 subMask := o.GetTemplateSource().MakeDiffFieldMask(other.GetTemplateSource()) 130 if subMask.IsFull() { 131 res.Paths = append(res.Paths, &TsCondition_FieldTerminalPath{selector: TsCondition_FieldPathSelectorTemplateSource}) 132 } else { 133 for _, subpath := range subMask.Paths { 134 res.Paths = append(res.Paths, &TsCondition_FieldSubPath{selector: TsCondition_FieldPathSelectorTemplateSource, subPath: subpath}) 135 } 136 } 137 } 138 return res 139 } 140 141 func (o *TsCondition) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 142 return o.MakeDiffFieldMask(other.(*TsCondition)) 143 } 144 145 func (o *TsCondition) Clone() *TsCondition { 146 if o == nil { 147 return nil 148 } 149 result := &TsCondition{} 150 if o.Name == nil { 151 result.Name = nil 152 } else if data, err := o.Name.ProtoString(); err != nil { 153 panic(err) 154 } else { 155 result.Name = &Name{} 156 if err := result.Name.ParseProtoString(data); err != nil { 157 panic(err) 158 } 159 } 160 result.Metadata = o.Metadata.Clone() 161 result.DisplayName = o.DisplayName 162 result.Description = o.Description 163 result.SupportingDocs = make([]*document.Reference, len(o.SupportingDocs)) 164 for i, sourceValue := range o.SupportingDocs { 165 if sourceValue == nil { 166 result.SupportingDocs[i] = nil 167 } else if data, err := sourceValue.ProtoString(); err != nil { 168 panic(err) 169 } else { 170 result.SupportingDocs[i] = &document.Reference{} 171 if err := result.SupportingDocs[i].ParseProtoString(data); err != nil { 172 panic(err) 173 } 174 } 175 } 176 result.Spec = o.Spec.Clone() 177 result.Internal = o.Internal.Clone() 178 result.FilterSelector = o.FilterSelector.Clone() 179 result.TemplateSource = o.TemplateSource.Clone() 180 return result 181 } 182 183 func (o *TsCondition) CloneRaw() gotenobject.GotenObjectExt { 184 return o.Clone() 185 } 186 187 func (o *TsCondition) Merge(source *TsCondition) { 188 if source.GetName() != nil { 189 if data, err := source.GetName().ProtoString(); err != nil { 190 panic(err) 191 } else { 192 o.Name = &Name{} 193 if err := o.Name.ParseProtoString(data); err != nil { 194 panic(err) 195 } 196 } 197 } else { 198 o.Name = nil 199 } 200 if source.GetMetadata() != nil { 201 if o.Metadata == nil { 202 o.Metadata = new(meta.Meta) 203 } 204 o.Metadata.Merge(source.GetMetadata()) 205 } 206 o.DisplayName = source.GetDisplayName() 207 o.Description = source.GetDescription() 208 for _, sourceValue := range source.GetSupportingDocs() { 209 exists := false 210 for _, currentValue := range o.SupportingDocs { 211 leftProtoStr, _ := currentValue.ProtoString() 212 rightProtoStr, _ := sourceValue.ProtoString() 213 if leftProtoStr == rightProtoStr { 214 exists = true 215 break 216 } 217 } 218 if !exists { 219 var newDstElement *document.Reference 220 if sourceValue != nil { 221 if data, err := sourceValue.ProtoString(); err != nil { 222 panic(err) 223 } else { 224 newDstElement = &document.Reference{} 225 if err := newDstElement.ParseProtoString(data); err != nil { 226 panic(err) 227 } 228 } 229 } 230 o.SupportingDocs = append(o.SupportingDocs, newDstElement) 231 } 232 } 233 234 if source.GetSpec() != nil { 235 if o.Spec == nil { 236 o.Spec = new(rcommon.TsCndSpec) 237 } 238 o.Spec.Merge(source.GetSpec()) 239 } 240 if source.GetInternal() != nil { 241 if o.Internal == nil { 242 o.Internal = new(TsCondition_Internal) 243 } 244 o.Internal.Merge(source.GetInternal()) 245 } 246 if source.GetFilterSelector() != nil { 247 if o.FilterSelector == nil { 248 o.FilterSelector = new(TsCondition_Selector) 249 } 250 o.FilterSelector.Merge(source.GetFilterSelector()) 251 } 252 if source.GetTemplateSource() != nil { 253 if o.TemplateSource == nil { 254 o.TemplateSource = new(TsCondition_TemplateSource) 255 } 256 o.TemplateSource.Merge(source.GetTemplateSource()) 257 } 258 } 259 260 func (o *TsCondition) MergeRaw(source gotenobject.GotenObjectExt) { 261 o.Merge(source.(*TsCondition)) 262 } 263 264 func (o *TsCondition_Internal) GotenObjectExt() {} 265 266 func (o *TsCondition_Internal) MakeFullFieldMask() *TsCondition_Internal_FieldMask { 267 return FullTsCondition_Internal_FieldMask() 268 } 269 270 func (o *TsCondition_Internal) MakeRawFullFieldMask() gotenobject.FieldMask { 271 return FullTsCondition_Internal_FieldMask() 272 } 273 274 func (o *TsCondition_Internal) MakeDiffFieldMask(other *TsCondition_Internal) *TsCondition_Internal_FieldMask { 275 if o == nil && other == nil { 276 return &TsCondition_Internal_FieldMask{} 277 } 278 if o == nil || other == nil { 279 return FullTsCondition_Internal_FieldMask() 280 } 281 282 res := &TsCondition_Internal_FieldMask{} 283 if string(o.GetCommonKeyKset()) != string(other.GetCommonKeyKset()) { 284 res.Paths = append(res.Paths, &TsConditionInternal_FieldTerminalPath{selector: TsConditionInternal_FieldPathSelectorCommonKeyKset}) 285 } 286 if o.GetEntrySpecGeneration() != other.GetEntrySpecGeneration() { 287 res.Paths = append(res.Paths, &TsConditionInternal_FieldTerminalPath{selector: TsConditionInternal_FieldPathSelectorEntrySpecGeneration}) 288 } 289 if o.GetAlertingLocation() != other.GetAlertingLocation() { 290 res.Paths = append(res.Paths, &TsConditionInternal_FieldTerminalPath{selector: TsConditionInternal_FieldPathSelectorAlertingLocation}) 291 } 292 return res 293 } 294 295 func (o *TsCondition_Internal) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 296 return o.MakeDiffFieldMask(other.(*TsCondition_Internal)) 297 } 298 299 func (o *TsCondition_Internal) Clone() *TsCondition_Internal { 300 if o == nil { 301 return nil 302 } 303 result := &TsCondition_Internal{} 304 result.CommonKeyKset = make([]byte, len(o.CommonKeyKset)) 305 for i, bt := range o.CommonKeyKset { 306 result.CommonKeyKset[i] = bt 307 } 308 result.EntrySpecGeneration = o.EntrySpecGeneration 309 result.AlertingLocation = o.AlertingLocation 310 return result 311 } 312 313 func (o *TsCondition_Internal) CloneRaw() gotenobject.GotenObjectExt { 314 return o.Clone() 315 } 316 317 func (o *TsCondition_Internal) Merge(source *TsCondition_Internal) { 318 o.CommonKeyKset = make([]byte, len(source.GetCommonKeyKset())) 319 for i, bt := range source.GetCommonKeyKset() { 320 o.CommonKeyKset[i] = bt 321 } 322 o.EntrySpecGeneration = source.GetEntrySpecGeneration() 323 o.AlertingLocation = source.GetAlertingLocation() 324 } 325 326 func (o *TsCondition_Internal) MergeRaw(source gotenobject.GotenObjectExt) { 327 o.Merge(source.(*TsCondition_Internal)) 328 } 329 330 func (o *TsCondition_Selector) GotenObjectExt() {} 331 332 func (o *TsCondition_Selector) MakeFullFieldMask() *TsCondition_Selector_FieldMask { 333 return FullTsCondition_Selector_FieldMask() 334 } 335 336 func (o *TsCondition_Selector) MakeRawFullFieldMask() gotenobject.FieldMask { 337 return FullTsCondition_Selector_FieldMask() 338 } 339 340 func (o *TsCondition_Selector) MakeDiffFieldMask(other *TsCondition_Selector) *TsCondition_Selector_FieldMask { 341 if o == nil && other == nil { 342 return &TsCondition_Selector_FieldMask{} 343 } 344 if o == nil || other == nil { 345 return FullTsCondition_Selector_FieldMask() 346 } 347 348 res := &TsCondition_Selector_FieldMask{} 349 350 if len(o.GetMetricTypes()) == len(other.GetMetricTypes()) { 351 for i, lValue := range o.GetMetricTypes() { 352 rValue := other.GetMetricTypes()[i] 353 if lValue != rValue { 354 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorMetricTypes}) 355 break 356 } 357 } 358 } else { 359 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorMetricTypes}) 360 } 361 362 if len(o.GetResourceTypes()) == len(other.GetResourceTypes()) { 363 for i, lValue := range o.GetResourceTypes() { 364 rValue := other.GetResourceTypes()[i] 365 if lValue != rValue { 366 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorResourceTypes}) 367 break 368 } 369 } 370 } else { 371 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorResourceTypes}) 372 } 373 374 if len(o.GetCommonMetricLabels()) == len(other.GetCommonMetricLabels()) { 375 for i, lValue := range o.GetCommonMetricLabels() { 376 rValue := other.GetCommonMetricLabels()[i] 377 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 378 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorCommonMetricLabels}) 379 break 380 } 381 } 382 } else { 383 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorCommonMetricLabels}) 384 } 385 386 if len(o.GetCommonResourceLabels()) == len(other.GetCommonResourceLabels()) { 387 for i, lValue := range o.GetCommonResourceLabels() { 388 rValue := other.GetCommonResourceLabels()[i] 389 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 390 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorCommonResourceLabels}) 391 break 392 } 393 } 394 } else { 395 res.Paths = append(res.Paths, &TsConditionSelector_FieldTerminalPath{selector: TsConditionSelector_FieldPathSelectorCommonResourceLabels}) 396 } 397 return res 398 } 399 400 func (o *TsCondition_Selector) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 401 return o.MakeDiffFieldMask(other.(*TsCondition_Selector)) 402 } 403 404 func (o *TsCondition_Selector) Clone() *TsCondition_Selector { 405 if o == nil { 406 return nil 407 } 408 result := &TsCondition_Selector{} 409 result.MetricTypes = make([]string, len(o.MetricTypes)) 410 for i, sourceValue := range o.MetricTypes { 411 result.MetricTypes[i] = sourceValue 412 } 413 result.ResourceTypes = make([]string, len(o.ResourceTypes)) 414 for i, sourceValue := range o.ResourceTypes { 415 result.ResourceTypes[i] = sourceValue 416 } 417 result.CommonMetricLabels = map[string]*TsCondition_Selector_Strings{} 418 for key, sourceValue := range o.CommonMetricLabels { 419 result.CommonMetricLabels[key] = sourceValue.Clone() 420 } 421 result.CommonResourceLabels = map[string]*TsCondition_Selector_Strings{} 422 for key, sourceValue := range o.CommonResourceLabels { 423 result.CommonResourceLabels[key] = sourceValue.Clone() 424 } 425 return result 426 } 427 428 func (o *TsCondition_Selector) CloneRaw() gotenobject.GotenObjectExt { 429 return o.Clone() 430 } 431 432 func (o *TsCondition_Selector) Merge(source *TsCondition_Selector) { 433 for _, sourceValue := range source.GetMetricTypes() { 434 exists := false 435 for _, currentValue := range o.MetricTypes { 436 if currentValue == sourceValue { 437 exists = true 438 break 439 } 440 } 441 if !exists { 442 var newDstElement string 443 newDstElement = sourceValue 444 o.MetricTypes = append(o.MetricTypes, newDstElement) 445 } 446 } 447 448 for _, sourceValue := range source.GetResourceTypes() { 449 exists := false 450 for _, currentValue := range o.ResourceTypes { 451 if currentValue == sourceValue { 452 exists = true 453 break 454 } 455 } 456 if !exists { 457 var newDstElement string 458 newDstElement = sourceValue 459 o.ResourceTypes = append(o.ResourceTypes, newDstElement) 460 } 461 } 462 463 if source.GetCommonMetricLabels() != nil { 464 if o.CommonMetricLabels == nil { 465 o.CommonMetricLabels = make(map[string]*TsCondition_Selector_Strings, len(source.GetCommonMetricLabels())) 466 } 467 for key, sourceValue := range source.GetCommonMetricLabels() { 468 if sourceValue != nil { 469 if o.CommonMetricLabels[key] == nil { 470 o.CommonMetricLabels[key] = new(TsCondition_Selector_Strings) 471 } 472 o.CommonMetricLabels[key].Merge(sourceValue) 473 } 474 } 475 } 476 if source.GetCommonResourceLabels() != nil { 477 if o.CommonResourceLabels == nil { 478 o.CommonResourceLabels = make(map[string]*TsCondition_Selector_Strings, len(source.GetCommonResourceLabels())) 479 } 480 for key, sourceValue := range source.GetCommonResourceLabels() { 481 if sourceValue != nil { 482 if o.CommonResourceLabels[key] == nil { 483 o.CommonResourceLabels[key] = new(TsCondition_Selector_Strings) 484 } 485 o.CommonResourceLabels[key].Merge(sourceValue) 486 } 487 } 488 } 489 } 490 491 func (o *TsCondition_Selector) MergeRaw(source gotenobject.GotenObjectExt) { 492 o.Merge(source.(*TsCondition_Selector)) 493 } 494 495 func (o *TsCondition_TemplateSource) GotenObjectExt() {} 496 497 func (o *TsCondition_TemplateSource) MakeFullFieldMask() *TsCondition_TemplateSource_FieldMask { 498 return FullTsCondition_TemplateSource_FieldMask() 499 } 500 501 func (o *TsCondition_TemplateSource) MakeRawFullFieldMask() gotenobject.FieldMask { 502 return FullTsCondition_TemplateSource_FieldMask() 503 } 504 505 func (o *TsCondition_TemplateSource) MakeDiffFieldMask(other *TsCondition_TemplateSource) *TsCondition_TemplateSource_FieldMask { 506 if o == nil && other == nil { 507 return &TsCondition_TemplateSource_FieldMask{} 508 } 509 if o == nil || other == nil { 510 return FullTsCondition_TemplateSource_FieldMask() 511 } 512 513 res := &TsCondition_TemplateSource_FieldMask{} 514 if o.GetTemplate().String() != other.GetTemplate().String() { 515 res.Paths = append(res.Paths, &TsConditionTemplateSource_FieldTerminalPath{selector: TsConditionTemplateSource_FieldPathSelectorTemplate}) 516 } 517 if !proto.Equal(o.GetUpdatedFields(), other.GetUpdatedFields()) { 518 res.Paths = append(res.Paths, &TsConditionTemplateSource_FieldTerminalPath{selector: TsConditionTemplateSource_FieldPathSelectorUpdatedFields}) 519 } 520 return res 521 } 522 523 func (o *TsCondition_TemplateSource) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 524 return o.MakeDiffFieldMask(other.(*TsCondition_TemplateSource)) 525 } 526 527 func (o *TsCondition_TemplateSource) Clone() *TsCondition_TemplateSource { 528 if o == nil { 529 return nil 530 } 531 result := &TsCondition_TemplateSource{} 532 if o.Template == nil { 533 result.Template = nil 534 } else if data, err := o.Template.ProtoString(); err != nil { 535 panic(err) 536 } else { 537 result.Template = &log_condition_template.Reference{} 538 if err := result.Template.ParseProtoString(data); err != nil { 539 panic(err) 540 } 541 } 542 result.UpdatedFields = proto.Clone(o.UpdatedFields).(*fieldmaskpb.FieldMask) 543 return result 544 } 545 546 func (o *TsCondition_TemplateSource) CloneRaw() gotenobject.GotenObjectExt { 547 return o.Clone() 548 } 549 550 func (o *TsCondition_TemplateSource) Merge(source *TsCondition_TemplateSource) { 551 if source.GetTemplate() != nil { 552 if data, err := source.GetTemplate().ProtoString(); err != nil { 553 panic(err) 554 } else { 555 o.Template = &log_condition_template.Reference{} 556 if err := o.Template.ParseProtoString(data); err != nil { 557 panic(err) 558 } 559 } 560 } else { 561 o.Template = nil 562 } 563 if source.GetUpdatedFields() != nil { 564 if o.UpdatedFields == nil { 565 o.UpdatedFields = new(fieldmaskpb.FieldMask) 566 } 567 proto.Merge(o.UpdatedFields, source.GetUpdatedFields()) 568 } 569 } 570 571 func (o *TsCondition_TemplateSource) MergeRaw(source gotenobject.GotenObjectExt) { 572 o.Merge(source.(*TsCondition_TemplateSource)) 573 } 574 575 func (o *TsCondition_Selector_Strings) GotenObjectExt() {} 576 577 func (o *TsCondition_Selector_Strings) MakeFullFieldMask() *TsCondition_Selector_Strings_FieldMask { 578 return FullTsCondition_Selector_Strings_FieldMask() 579 } 580 581 func (o *TsCondition_Selector_Strings) MakeRawFullFieldMask() gotenobject.FieldMask { 582 return FullTsCondition_Selector_Strings_FieldMask() 583 } 584 585 func (o *TsCondition_Selector_Strings) MakeDiffFieldMask(other *TsCondition_Selector_Strings) *TsCondition_Selector_Strings_FieldMask { 586 if o == nil && other == nil { 587 return &TsCondition_Selector_Strings_FieldMask{} 588 } 589 if o == nil || other == nil { 590 return FullTsCondition_Selector_Strings_FieldMask() 591 } 592 593 res := &TsCondition_Selector_Strings_FieldMask{} 594 595 if len(o.GetValues()) == len(other.GetValues()) { 596 for i, lValue := range o.GetValues() { 597 rValue := other.GetValues()[i] 598 if lValue != rValue { 599 res.Paths = append(res.Paths, &TsConditionSelectorStrings_FieldTerminalPath{selector: TsConditionSelectorStrings_FieldPathSelectorValues}) 600 break 601 } 602 } 603 } else { 604 res.Paths = append(res.Paths, &TsConditionSelectorStrings_FieldTerminalPath{selector: TsConditionSelectorStrings_FieldPathSelectorValues}) 605 } 606 return res 607 } 608 609 func (o *TsCondition_Selector_Strings) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 610 return o.MakeDiffFieldMask(other.(*TsCondition_Selector_Strings)) 611 } 612 613 func (o *TsCondition_Selector_Strings) Clone() *TsCondition_Selector_Strings { 614 if o == nil { 615 return nil 616 } 617 result := &TsCondition_Selector_Strings{} 618 result.Values = make([]string, len(o.Values)) 619 for i, sourceValue := range o.Values { 620 result.Values[i] = sourceValue 621 } 622 return result 623 } 624 625 func (o *TsCondition_Selector_Strings) CloneRaw() gotenobject.GotenObjectExt { 626 return o.Clone() 627 } 628 629 func (o *TsCondition_Selector_Strings) Merge(source *TsCondition_Selector_Strings) { 630 for _, sourceValue := range source.GetValues() { 631 exists := false 632 for _, currentValue := range o.Values { 633 if currentValue == sourceValue { 634 exists = true 635 break 636 } 637 } 638 if !exists { 639 var newDstElement string 640 newDstElement = sourceValue 641 o.Values = append(o.Values, newDstElement) 642 } 643 } 644 645 } 646 647 func (o *TsCondition_Selector_Strings) MergeRaw(source gotenobject.GotenObjectExt) { 648 o.Merge(source.(*TsCondition_Selector_Strings)) 649 }