github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/resources/v1/ts_entry/ts_entry.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/alerting/proto/v1/ts_entry.proto 3 // DO NOT EDIT!!! 4 5 package ts_entry 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 ts_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_condition" 21 monitoring_common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 22 meta "github.com/cloudwan/goten-sdk/types/meta" 23 durationpb "google.golang.org/protobuf/types/known/durationpb" 24 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 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 _ = &rcommon.LogCndSpec{} 41 _ = &ts_condition.TsCondition{} 42 _ = &monitoring_common.LabelDescriptor{} 43 _ = &durationpb.Duration{} 44 _ = ×tamppb.Timestamp{} 45 _ = &meta.Meta{} 46 ) 47 48 func (o *TsEntry) GotenObjectExt() {} 49 50 func (o *TsEntry) MakeFullFieldMask() *TsEntry_FieldMask { 51 return FullTsEntry_FieldMask() 52 } 53 54 func (o *TsEntry) MakeRawFullFieldMask() gotenobject.FieldMask { 55 return FullTsEntry_FieldMask() 56 } 57 58 func (o *TsEntry) MakeDiffFieldMask(other *TsEntry) *TsEntry_FieldMask { 59 if o == nil && other == nil { 60 return &TsEntry_FieldMask{} 61 } 62 if o == nil || other == nil { 63 return FullTsEntry_FieldMask() 64 } 65 66 res := &TsEntry_FieldMask{} 67 if o.GetName().String() != other.GetName().String() { 68 res.Paths = append(res.Paths, &TsEntry_FieldTerminalPath{selector: TsEntry_FieldPathSelectorName}) 69 } 70 { 71 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 72 if subMask.IsFull() { 73 res.Paths = append(res.Paths, &TsEntry_FieldTerminalPath{selector: TsEntry_FieldPathSelectorMetadata}) 74 } else { 75 for _, subpath := range subMask.Paths { 76 res.Paths = append(res.Paths, &TsEntry_FieldSubPath{selector: TsEntry_FieldPathSelectorMetadata, subPath: subpath}) 77 } 78 } 79 } 80 { 81 subMask := o.GetInfo().MakeDiffFieldMask(other.GetInfo()) 82 if subMask.IsFull() { 83 res.Paths = append(res.Paths, &TsEntry_FieldTerminalPath{selector: TsEntry_FieldPathSelectorInfo}) 84 } else { 85 for _, subpath := range subMask.Paths { 86 res.Paths = append(res.Paths, &TsEntry_FieldSubPath{selector: TsEntry_FieldPathSelectorInfo, subPath: subpath}) 87 } 88 } 89 } 90 { 91 subMask := o.GetState().MakeDiffFieldMask(other.GetState()) 92 if subMask.IsFull() { 93 res.Paths = append(res.Paths, &TsEntry_FieldTerminalPath{selector: TsEntry_FieldPathSelectorState}) 94 } else { 95 for _, subpath := range subMask.Paths { 96 res.Paths = append(res.Paths, &TsEntry_FieldSubPath{selector: TsEntry_FieldPathSelectorState, subPath: subpath}) 97 } 98 } 99 } 100 { 101 subMask := o.GetInternal().MakeDiffFieldMask(other.GetInternal()) 102 if subMask.IsFull() { 103 res.Paths = append(res.Paths, &TsEntry_FieldTerminalPath{selector: TsEntry_FieldPathSelectorInternal}) 104 } else { 105 for _, subpath := range subMask.Paths { 106 res.Paths = append(res.Paths, &TsEntry_FieldSubPath{selector: TsEntry_FieldPathSelectorInternal, subPath: subpath}) 107 } 108 } 109 } 110 return res 111 } 112 113 func (o *TsEntry) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 114 return o.MakeDiffFieldMask(other.(*TsEntry)) 115 } 116 117 func (o *TsEntry) Clone() *TsEntry { 118 if o == nil { 119 return nil 120 } 121 result := &TsEntry{} 122 if o.Name == nil { 123 result.Name = nil 124 } else if data, err := o.Name.ProtoString(); err != nil { 125 panic(err) 126 } else { 127 result.Name = &Name{} 128 if err := result.Name.ParseProtoString(data); err != nil { 129 panic(err) 130 } 131 } 132 result.Metadata = o.Metadata.Clone() 133 result.Info = o.Info.Clone() 134 result.State = o.State.Clone() 135 result.Internal = o.Internal.Clone() 136 return result 137 } 138 139 func (o *TsEntry) CloneRaw() gotenobject.GotenObjectExt { 140 return o.Clone() 141 } 142 143 func (o *TsEntry) Merge(source *TsEntry) { 144 if source.GetName() != nil { 145 if data, err := source.GetName().ProtoString(); err != nil { 146 panic(err) 147 } else { 148 o.Name = &Name{} 149 if err := o.Name.ParseProtoString(data); err != nil { 150 panic(err) 151 } 152 } 153 } else { 154 o.Name = nil 155 } 156 if source.GetMetadata() != nil { 157 if o.Metadata == nil { 158 o.Metadata = new(meta.Meta) 159 } 160 o.Metadata.Merge(source.GetMetadata()) 161 } 162 if source.GetInfo() != nil { 163 if o.Info == nil { 164 o.Info = new(TsEntry_Info) 165 } 166 o.Info.Merge(source.GetInfo()) 167 } 168 if source.GetState() != nil { 169 if o.State == nil { 170 o.State = new(TsEntry_State) 171 } 172 o.State.Merge(source.GetState()) 173 } 174 if source.GetInternal() != nil { 175 if o.Internal == nil { 176 o.Internal = new(TsEntry_Internal) 177 } 178 o.Internal.Merge(source.GetInternal()) 179 } 180 } 181 182 func (o *TsEntry) MergeRaw(source gotenobject.GotenObjectExt) { 183 o.Merge(source.(*TsEntry)) 184 } 185 186 func (o *TsEntry_Info) GotenObjectExt() {} 187 188 func (o *TsEntry_Info) MakeFullFieldMask() *TsEntry_Info_FieldMask { 189 return FullTsEntry_Info_FieldMask() 190 } 191 192 func (o *TsEntry_Info) MakeRawFullFieldMask() gotenobject.FieldMask { 193 return FullTsEntry_Info_FieldMask() 194 } 195 196 func (o *TsEntry_Info) MakeDiffFieldMask(other *TsEntry_Info) *TsEntry_Info_FieldMask { 197 if o == nil && other == nil { 198 return &TsEntry_Info_FieldMask{} 199 } 200 if o == nil || other == nil { 201 return FullTsEntry_Info_FieldMask() 202 } 203 204 res := &TsEntry_Info_FieldMask{} 205 { 206 subMask := o.GetAlertingResource().MakeDiffFieldMask(other.GetAlertingResource()) 207 if subMask.IsFull() { 208 res.Paths = append(res.Paths, &TsEntryInfo_FieldTerminalPath{selector: TsEntryInfo_FieldPathSelectorAlertingResource}) 209 } else { 210 for _, subpath := range subMask.Paths { 211 res.Paths = append(res.Paths, &TsEntryInfo_FieldSubPath{selector: TsEntryInfo_FieldPathSelectorAlertingResource, subPath: subpath}) 212 } 213 } 214 } 215 if string(o.GetGroupByKey()) != string(other.GetGroupByKey()) { 216 res.Paths = append(res.Paths, &TsEntryInfo_FieldTerminalPath{selector: TsEntryInfo_FieldPathSelectorGroupByKey}) 217 } 218 219 if len(o.GetCommonMetricLabels()) == len(other.GetCommonMetricLabels()) { 220 for i, lValue := range o.GetCommonMetricLabels() { 221 rValue := other.GetCommonMetricLabels()[i] 222 if lValue != rValue { 223 res.Paths = append(res.Paths, &TsEntryInfo_FieldTerminalPath{selector: TsEntryInfo_FieldPathSelectorCommonMetricLabels}) 224 break 225 } 226 } 227 } else { 228 res.Paths = append(res.Paths, &TsEntryInfo_FieldTerminalPath{selector: TsEntryInfo_FieldPathSelectorCommonMetricLabels}) 229 } 230 231 if len(o.GetCommonResourceLabels()) == len(other.GetCommonResourceLabels()) { 232 for i, lValue := range o.GetCommonResourceLabels() { 233 rValue := other.GetCommonResourceLabels()[i] 234 if lValue != rValue { 235 res.Paths = append(res.Paths, &TsEntryInfo_FieldTerminalPath{selector: TsEntryInfo_FieldPathSelectorCommonResourceLabels}) 236 break 237 } 238 } 239 } else { 240 res.Paths = append(res.Paths, &TsEntryInfo_FieldTerminalPath{selector: TsEntryInfo_FieldPathSelectorCommonResourceLabels}) 241 } 242 return res 243 } 244 245 func (o *TsEntry_Info) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 246 return o.MakeDiffFieldMask(other.(*TsEntry_Info)) 247 } 248 249 func (o *TsEntry_Info) Clone() *TsEntry_Info { 250 if o == nil { 251 return nil 252 } 253 result := &TsEntry_Info{} 254 result.AlertingResource = o.AlertingResource.Clone() 255 result.GroupByKey = make([]byte, len(o.GroupByKey)) 256 for i, bt := range o.GroupByKey { 257 result.GroupByKey[i] = bt 258 } 259 result.CommonMetricLabels = map[string]string{} 260 for key, sourceValue := range o.CommonMetricLabels { 261 result.CommonMetricLabels[key] = sourceValue 262 } 263 result.CommonResourceLabels = map[string]string{} 264 for key, sourceValue := range o.CommonResourceLabels { 265 result.CommonResourceLabels[key] = sourceValue 266 } 267 return result 268 } 269 270 func (o *TsEntry_Info) CloneRaw() gotenobject.GotenObjectExt { 271 return o.Clone() 272 } 273 274 func (o *TsEntry_Info) Merge(source *TsEntry_Info) { 275 if source.GetAlertingResource() != nil { 276 if o.AlertingResource == nil { 277 o.AlertingResource = new(meta.OwnerReference) 278 } 279 o.AlertingResource.Merge(source.GetAlertingResource()) 280 } 281 o.GroupByKey = make([]byte, len(source.GetGroupByKey())) 282 for i, bt := range source.GetGroupByKey() { 283 o.GroupByKey[i] = bt 284 } 285 if source.GetCommonMetricLabels() != nil { 286 if o.CommonMetricLabels == nil { 287 o.CommonMetricLabels = make(map[string]string, len(source.GetCommonMetricLabels())) 288 } 289 for key, sourceValue := range source.GetCommonMetricLabels() { 290 o.CommonMetricLabels[key] = sourceValue 291 } 292 } 293 if source.GetCommonResourceLabels() != nil { 294 if o.CommonResourceLabels == nil { 295 o.CommonResourceLabels = make(map[string]string, len(source.GetCommonResourceLabels())) 296 } 297 for key, sourceValue := range source.GetCommonResourceLabels() { 298 o.CommonResourceLabels[key] = sourceValue 299 } 300 } 301 } 302 303 func (o *TsEntry_Info) MergeRaw(source gotenobject.GotenObjectExt) { 304 o.Merge(source.(*TsEntry_Info)) 305 } 306 307 func (o *TsEntry_State) GotenObjectExt() {} 308 309 func (o *TsEntry_State) MakeFullFieldMask() *TsEntry_State_FieldMask { 310 return FullTsEntry_State_FieldMask() 311 } 312 313 func (o *TsEntry_State) MakeRawFullFieldMask() gotenobject.FieldMask { 314 return FullTsEntry_State_FieldMask() 315 } 316 317 func (o *TsEntry_State) MakeDiffFieldMask(other *TsEntry_State) *TsEntry_State_FieldMask { 318 if o == nil && other == nil { 319 return &TsEntry_State_FieldMask{} 320 } 321 if o == nil || other == nil { 322 return FullTsEntry_State_FieldMask() 323 } 324 325 res := &TsEntry_State_FieldMask{} 326 327 if len(o.GetModels()) == len(other.GetModels()) { 328 for i, lValue := range o.GetModels() { 329 rValue := other.GetModels()[i] 330 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 331 res.Paths = append(res.Paths, &TsEntryState_FieldTerminalPath{selector: TsEntryState_FieldPathSelectorModels}) 332 break 333 } 334 } 335 } else { 336 res.Paths = append(res.Paths, &TsEntryState_FieldTerminalPath{selector: TsEntryState_FieldPathSelectorModels}) 337 } 338 339 if len(o.GetThresholds()) == len(other.GetThresholds()) { 340 for i, lValue := range o.GetThresholds() { 341 rValue := other.GetThresholds()[i] 342 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 343 res.Paths = append(res.Paths, &TsEntryState_FieldTerminalPath{selector: TsEntryState_FieldPathSelectorThresholds}) 344 break 345 } 346 } 347 } else { 348 res.Paths = append(res.Paths, &TsEntryState_FieldTerminalPath{selector: TsEntryState_FieldPathSelectorThresholds}) 349 } 350 return res 351 } 352 353 func (o *TsEntry_State) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 354 return o.MakeDiffFieldMask(other.(*TsEntry_State)) 355 } 356 357 func (o *TsEntry_State) Clone() *TsEntry_State { 358 if o == nil { 359 return nil 360 } 361 result := &TsEntry_State{} 362 result.Models = make([]*TsEntry_State_AnomalyModelData, len(o.Models)) 363 for i, sourceValue := range o.Models { 364 result.Models[i] = sourceValue.Clone() 365 } 366 result.Thresholds = make([]*TsEntry_State_AdaptiveThresholdInfo, len(o.Thresholds)) 367 for i, sourceValue := range o.Thresholds { 368 result.Thresholds[i] = sourceValue.Clone() 369 } 370 return result 371 } 372 373 func (o *TsEntry_State) CloneRaw() gotenobject.GotenObjectExt { 374 return o.Clone() 375 } 376 377 func (o *TsEntry_State) Merge(source *TsEntry_State) { 378 for _, sourceValue := range source.GetModels() { 379 exists := false 380 for _, currentValue := range o.Models { 381 if proto.Equal(sourceValue, currentValue) { 382 exists = true 383 break 384 } 385 } 386 if !exists { 387 var newDstElement *TsEntry_State_AnomalyModelData 388 if sourceValue != nil { 389 newDstElement = new(TsEntry_State_AnomalyModelData) 390 newDstElement.Merge(sourceValue) 391 } 392 o.Models = append(o.Models, newDstElement) 393 } 394 } 395 396 for _, sourceValue := range source.GetThresholds() { 397 exists := false 398 for _, currentValue := range o.Thresholds { 399 if proto.Equal(sourceValue, currentValue) { 400 exists = true 401 break 402 } 403 } 404 if !exists { 405 var newDstElement *TsEntry_State_AdaptiveThresholdInfo 406 if sourceValue != nil { 407 newDstElement = new(TsEntry_State_AdaptiveThresholdInfo) 408 newDstElement.Merge(sourceValue) 409 } 410 o.Thresholds = append(o.Thresholds, newDstElement) 411 } 412 } 413 414 } 415 416 func (o *TsEntry_State) MergeRaw(source gotenobject.GotenObjectExt) { 417 o.Merge(source.(*TsEntry_State)) 418 } 419 420 func (o *TsEntry_Internal) GotenObjectExt() {} 421 422 func (o *TsEntry_Internal) MakeFullFieldMask() *TsEntry_Internal_FieldMask { 423 return FullTsEntry_Internal_FieldMask() 424 } 425 426 func (o *TsEntry_Internal) MakeRawFullFieldMask() gotenobject.FieldMask { 427 return FullTsEntry_Internal_FieldMask() 428 } 429 430 func (o *TsEntry_Internal) MakeDiffFieldMask(other *TsEntry_Internal) *TsEntry_Internal_FieldMask { 431 if o == nil && other == nil { 432 return &TsEntry_Internal_FieldMask{} 433 } 434 if o == nil || other == nil { 435 return FullTsEntry_Internal_FieldMask() 436 } 437 438 res := &TsEntry_Internal_FieldMask{} 439 if o.GetAlertingLocation() != other.GetAlertingLocation() { 440 res.Paths = append(res.Paths, &TsEntryInternal_FieldTerminalPath{selector: TsEntryInternal_FieldPathSelectorAlertingLocation}) 441 } 442 if o.GetSpecGeneration() != other.GetSpecGeneration() { 443 res.Paths = append(res.Paths, &TsEntryInternal_FieldTerminalPath{selector: TsEntryInternal_FieldPathSelectorSpecGeneration}) 444 } 445 return res 446 } 447 448 func (o *TsEntry_Internal) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 449 return o.MakeDiffFieldMask(other.(*TsEntry_Internal)) 450 } 451 452 func (o *TsEntry_Internal) Clone() *TsEntry_Internal { 453 if o == nil { 454 return nil 455 } 456 result := &TsEntry_Internal{} 457 result.AlertingLocation = o.AlertingLocation 458 result.SpecGeneration = o.SpecGeneration 459 return result 460 } 461 462 func (o *TsEntry_Internal) CloneRaw() gotenobject.GotenObjectExt { 463 return o.Clone() 464 } 465 466 func (o *TsEntry_Internal) Merge(source *TsEntry_Internal) { 467 o.AlertingLocation = source.GetAlertingLocation() 468 o.SpecGeneration = source.GetSpecGeneration() 469 } 470 471 func (o *TsEntry_Internal) MergeRaw(source gotenobject.GotenObjectExt) { 472 o.Merge(source.(*TsEntry_Internal)) 473 } 474 475 func (o *TsEntry_State_AnomalyModelData) GotenObjectExt() {} 476 477 func (o *TsEntry_State_AnomalyModelData) MakeFullFieldMask() *TsEntry_State_AnomalyModelData_FieldMask { 478 return FullTsEntry_State_AnomalyModelData_FieldMask() 479 } 480 481 func (o *TsEntry_State_AnomalyModelData) MakeRawFullFieldMask() gotenobject.FieldMask { 482 return FullTsEntry_State_AnomalyModelData_FieldMask() 483 } 484 485 func (o *TsEntry_State_AnomalyModelData) MakeDiffFieldMask(other *TsEntry_State_AnomalyModelData) *TsEntry_State_AnomalyModelData_FieldMask { 486 if o == nil && other == nil { 487 return &TsEntry_State_AnomalyModelData_FieldMask{} 488 } 489 if o == nil || other == nil { 490 return FullTsEntry_State_AnomalyModelData_FieldMask() 491 } 492 493 res := &TsEntry_State_AnomalyModelData_FieldMask{} 494 if !proto.Equal(o.GetAnalysisWindow(), other.GetAnalysisWindow()) { 495 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorAnalysisWindow}) 496 } 497 if string(o.GetModelData()) != string(other.GetModelData()) { 498 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorModelData}) 499 } 500 501 if len(o.GetTrainingMeanErr()) == len(other.GetTrainingMeanErr()) { 502 for i, lValue := range o.GetTrainingMeanErr() { 503 rValue := other.GetTrainingMeanErr()[i] 504 if lValue != rValue { 505 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainingMeanErr}) 506 break 507 } 508 } 509 } else { 510 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainingMeanErr}) 511 } 512 513 if len(o.GetTrainingMaxErr()) == len(other.GetTrainingMaxErr()) { 514 for i, lValue := range o.GetTrainingMaxErr() { 515 rValue := other.GetTrainingMaxErr()[i] 516 if lValue != rValue { 517 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainingMaxErr}) 518 break 519 } 520 } 521 } else { 522 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainingMaxErr}) 523 } 524 if o.GetTrainedInEpochs() != other.GetTrainedInEpochs() { 525 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainedInEpochs}) 526 } 527 if !proto.Equal(o.GetTrainedIn(), other.GetTrainedIn()) { 528 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainedIn}) 529 } 530 if !proto.Equal(o.GetTrainAfter(), other.GetTrainAfter()) { 531 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainAfter}) 532 } 533 { 534 subMask := o.GetTrainingPeriod().MakeDiffFieldMask(other.GetTrainingPeriod()) 535 if subMask.IsFull() { 536 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainingPeriod}) 537 } else { 538 for _, subpath := range subMask.Paths { 539 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldSubPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorTrainingPeriod, subPath: subpath}) 540 } 541 } 542 } 543 544 if len(o.GetSensitiveness()) == len(other.GetSensitiveness()) { 545 for i, lValue := range o.GetSensitiveness() { 546 rValue := other.GetSensitiveness()[i] 547 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 548 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorSensitiveness}) 549 break 550 } 551 } 552 } else { 553 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelData_FieldTerminalPath{selector: TsEntryStateAnomalyModelData_FieldPathSelectorSensitiveness}) 554 } 555 return res 556 } 557 558 func (o *TsEntry_State_AnomalyModelData) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 559 return o.MakeDiffFieldMask(other.(*TsEntry_State_AnomalyModelData)) 560 } 561 562 func (o *TsEntry_State_AnomalyModelData) Clone() *TsEntry_State_AnomalyModelData { 563 if o == nil { 564 return nil 565 } 566 result := &TsEntry_State_AnomalyModelData{} 567 result.AnalysisWindow = proto.Clone(o.AnalysisWindow).(*durationpb.Duration) 568 result.ModelData = make([]byte, len(o.ModelData)) 569 for i, bt := range o.ModelData { 570 result.ModelData[i] = bt 571 } 572 result.TrainingMeanErr = make([]float64, len(o.TrainingMeanErr)) 573 for i, sourceValue := range o.TrainingMeanErr { 574 result.TrainingMeanErr[i] = sourceValue 575 } 576 result.TrainingMaxErr = make([]float64, len(o.TrainingMaxErr)) 577 for i, sourceValue := range o.TrainingMaxErr { 578 result.TrainingMaxErr[i] = sourceValue 579 } 580 result.TrainedInEpochs = o.TrainedInEpochs 581 result.TrainedIn = proto.Clone(o.TrainedIn).(*durationpb.Duration) 582 result.TrainAfter = proto.Clone(o.TrainAfter).(*timestamppb.Timestamp) 583 result.TrainingPeriod = o.TrainingPeriod.Clone() 584 result.Sensitiveness = make([]*TsEntry_State_AnomalyModelSensitiveness, len(o.Sensitiveness)) 585 for i, sourceValue := range o.Sensitiveness { 586 result.Sensitiveness[i] = sourceValue.Clone() 587 } 588 return result 589 } 590 591 func (o *TsEntry_State_AnomalyModelData) CloneRaw() gotenobject.GotenObjectExt { 592 return o.Clone() 593 } 594 595 func (o *TsEntry_State_AnomalyModelData) Merge(source *TsEntry_State_AnomalyModelData) { 596 if source.GetAnalysisWindow() != nil { 597 if o.AnalysisWindow == nil { 598 o.AnalysisWindow = new(durationpb.Duration) 599 } 600 proto.Merge(o.AnalysisWindow, source.GetAnalysisWindow()) 601 } 602 o.ModelData = make([]byte, len(source.GetModelData())) 603 for i, bt := range source.GetModelData() { 604 o.ModelData[i] = bt 605 } 606 for _, sourceValue := range source.GetTrainingMeanErr() { 607 exists := false 608 for _, currentValue := range o.TrainingMeanErr { 609 if currentValue == sourceValue { 610 exists = true 611 break 612 } 613 } 614 if !exists { 615 var newDstElement float64 616 newDstElement = sourceValue 617 o.TrainingMeanErr = append(o.TrainingMeanErr, newDstElement) 618 } 619 } 620 621 for _, sourceValue := range source.GetTrainingMaxErr() { 622 exists := false 623 for _, currentValue := range o.TrainingMaxErr { 624 if currentValue == sourceValue { 625 exists = true 626 break 627 } 628 } 629 if !exists { 630 var newDstElement float64 631 newDstElement = sourceValue 632 o.TrainingMaxErr = append(o.TrainingMaxErr, newDstElement) 633 } 634 } 635 636 o.TrainedInEpochs = source.GetTrainedInEpochs() 637 if source.GetTrainedIn() != nil { 638 if o.TrainedIn == nil { 639 o.TrainedIn = new(durationpb.Duration) 640 } 641 proto.Merge(o.TrainedIn, source.GetTrainedIn()) 642 } 643 if source.GetTrainAfter() != nil { 644 if o.TrainAfter == nil { 645 o.TrainAfter = new(timestamppb.Timestamp) 646 } 647 proto.Merge(o.TrainAfter, source.GetTrainAfter()) 648 } 649 if source.GetTrainingPeriod() != nil { 650 if o.TrainingPeriod == nil { 651 o.TrainingPeriod = new(monitoring_common.TimeInterval) 652 } 653 o.TrainingPeriod.Merge(source.GetTrainingPeriod()) 654 } 655 for _, sourceValue := range source.GetSensitiveness() { 656 exists := false 657 for _, currentValue := range o.Sensitiveness { 658 if proto.Equal(sourceValue, currentValue) { 659 exists = true 660 break 661 } 662 } 663 if !exists { 664 var newDstElement *TsEntry_State_AnomalyModelSensitiveness 665 if sourceValue != nil { 666 newDstElement = new(TsEntry_State_AnomalyModelSensitiveness) 667 newDstElement.Merge(sourceValue) 668 } 669 o.Sensitiveness = append(o.Sensitiveness, newDstElement) 670 } 671 } 672 673 } 674 675 func (o *TsEntry_State_AnomalyModelData) MergeRaw(source gotenobject.GotenObjectExt) { 676 o.Merge(source.(*TsEntry_State_AnomalyModelData)) 677 } 678 679 func (o *TsEntry_State_AnomalyModelSensitiveness) GotenObjectExt() {} 680 681 func (o *TsEntry_State_AnomalyModelSensitiveness) MakeFullFieldMask() *TsEntry_State_AnomalyModelSensitiveness_FieldMask { 682 return FullTsEntry_State_AnomalyModelSensitiveness_FieldMask() 683 } 684 685 func (o *TsEntry_State_AnomalyModelSensitiveness) MakeRawFullFieldMask() gotenobject.FieldMask { 686 return FullTsEntry_State_AnomalyModelSensitiveness_FieldMask() 687 } 688 689 func (o *TsEntry_State_AnomalyModelSensitiveness) MakeDiffFieldMask(other *TsEntry_State_AnomalyModelSensitiveness) *TsEntry_State_AnomalyModelSensitiveness_FieldMask { 690 if o == nil && other == nil { 691 return &TsEntry_State_AnomalyModelSensitiveness_FieldMask{} 692 } 693 if o == nil || other == nil { 694 return FullTsEntry_State_AnomalyModelSensitiveness_FieldMask() 695 } 696 697 res := &TsEntry_State_AnomalyModelSensitiveness_FieldMask{} 698 if o.GetQueryName() != other.GetQueryName() { 699 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelSensitiveness_FieldTerminalPath{selector: TsEntryStateAnomalyModelSensitiveness_FieldPathSelectorQueryName}) 700 } 701 if o.GetAnomalyThreshold() != other.GetAnomalyThreshold() { 702 res.Paths = append(res.Paths, &TsEntryStateAnomalyModelSensitiveness_FieldTerminalPath{selector: TsEntryStateAnomalyModelSensitiveness_FieldPathSelectorAnomalyThreshold}) 703 } 704 return res 705 } 706 707 func (o *TsEntry_State_AnomalyModelSensitiveness) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 708 return o.MakeDiffFieldMask(other.(*TsEntry_State_AnomalyModelSensitiveness)) 709 } 710 711 func (o *TsEntry_State_AnomalyModelSensitiveness) Clone() *TsEntry_State_AnomalyModelSensitiveness { 712 if o == nil { 713 return nil 714 } 715 result := &TsEntry_State_AnomalyModelSensitiveness{} 716 result.QueryName = o.QueryName 717 result.AnomalyThreshold = o.AnomalyThreshold 718 return result 719 } 720 721 func (o *TsEntry_State_AnomalyModelSensitiveness) CloneRaw() gotenobject.GotenObjectExt { 722 return o.Clone() 723 } 724 725 func (o *TsEntry_State_AnomalyModelSensitiveness) Merge(source *TsEntry_State_AnomalyModelSensitiveness) { 726 o.QueryName = source.GetQueryName() 727 o.AnomalyThreshold = source.GetAnomalyThreshold() 728 } 729 730 func (o *TsEntry_State_AnomalyModelSensitiveness) MergeRaw(source gotenobject.GotenObjectExt) { 731 o.Merge(source.(*TsEntry_State_AnomalyModelSensitiveness)) 732 } 733 734 func (o *TsEntry_State_AdaptiveThresholdInfo) GotenObjectExt() {} 735 736 func (o *TsEntry_State_AdaptiveThresholdInfo) MakeFullFieldMask() *TsEntry_State_AdaptiveThresholdInfo_FieldMask { 737 return FullTsEntry_State_AdaptiveThresholdInfo_FieldMask() 738 } 739 740 func (o *TsEntry_State_AdaptiveThresholdInfo) MakeRawFullFieldMask() gotenobject.FieldMask { 741 return FullTsEntry_State_AdaptiveThresholdInfo_FieldMask() 742 } 743 744 func (o *TsEntry_State_AdaptiveThresholdInfo) MakeDiffFieldMask(other *TsEntry_State_AdaptiveThresholdInfo) *TsEntry_State_AdaptiveThresholdInfo_FieldMask { 745 if o == nil && other == nil { 746 return &TsEntry_State_AdaptiveThresholdInfo_FieldMask{} 747 } 748 if o == nil || other == nil { 749 return FullTsEntry_State_AdaptiveThresholdInfo_FieldMask() 750 } 751 752 res := &TsEntry_State_AdaptiveThresholdInfo_FieldMask{} 753 if o.GetQueryName() != other.GetQueryName() { 754 res.Paths = append(res.Paths, &TsEntryStateAdaptiveThresholdInfo_FieldTerminalPath{selector: TsEntryStateAdaptiveThresholdInfo_FieldPathSelectorQueryName}) 755 } 756 { 757 subMask := o.GetLower().MakeDiffFieldMask(other.GetLower()) 758 if subMask.IsFull() { 759 res.Paths = append(res.Paths, &TsEntryStateAdaptiveThresholdInfo_FieldTerminalPath{selector: TsEntryStateAdaptiveThresholdInfo_FieldPathSelectorLower}) 760 } else { 761 for _, subpath := range subMask.Paths { 762 res.Paths = append(res.Paths, &TsEntryStateAdaptiveThresholdInfo_FieldSubPath{selector: TsEntryStateAdaptiveThresholdInfo_FieldPathSelectorLower, subPath: subpath}) 763 } 764 } 765 } 766 { 767 subMask := o.GetUpper().MakeDiffFieldMask(other.GetUpper()) 768 if subMask.IsFull() { 769 res.Paths = append(res.Paths, &TsEntryStateAdaptiveThresholdInfo_FieldTerminalPath{selector: TsEntryStateAdaptiveThresholdInfo_FieldPathSelectorUpper}) 770 } else { 771 for _, subpath := range subMask.Paths { 772 res.Paths = append(res.Paths, &TsEntryStateAdaptiveThresholdInfo_FieldSubPath{selector: TsEntryStateAdaptiveThresholdInfo_FieldPathSelectorUpper, subPath: subpath}) 773 } 774 } 775 } 776 if !proto.Equal(o.GetNextCheck(), other.GetNextCheck()) { 777 res.Paths = append(res.Paths, &TsEntryStateAdaptiveThresholdInfo_FieldTerminalPath{selector: TsEntryStateAdaptiveThresholdInfo_FieldPathSelectorNextCheck}) 778 } 779 return res 780 } 781 782 func (o *TsEntry_State_AdaptiveThresholdInfo) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 783 return o.MakeDiffFieldMask(other.(*TsEntry_State_AdaptiveThresholdInfo)) 784 } 785 786 func (o *TsEntry_State_AdaptiveThresholdInfo) Clone() *TsEntry_State_AdaptiveThresholdInfo { 787 if o == nil { 788 return nil 789 } 790 result := &TsEntry_State_AdaptiveThresholdInfo{} 791 result.QueryName = o.QueryName 792 result.Lower = o.Lower.Clone() 793 result.Upper = o.Upper.Clone() 794 result.NextCheck = proto.Clone(o.NextCheck).(*timestamppb.Timestamp) 795 return result 796 } 797 798 func (o *TsEntry_State_AdaptiveThresholdInfo) CloneRaw() gotenobject.GotenObjectExt { 799 return o.Clone() 800 } 801 802 func (o *TsEntry_State_AdaptiveThresholdInfo) Merge(source *TsEntry_State_AdaptiveThresholdInfo) { 803 o.QueryName = source.GetQueryName() 804 if source.GetLower() != nil { 805 if o.Lower == nil { 806 o.Lower = new(rcommon.AlertingThreshold) 807 } 808 o.Lower.Merge(source.GetLower()) 809 } 810 if source.GetUpper() != nil { 811 if o.Upper == nil { 812 o.Upper = new(rcommon.AlertingThreshold) 813 } 814 o.Upper.Merge(source.GetUpper()) 815 } 816 if source.GetNextCheck() != nil { 817 if o.NextCheck == nil { 818 o.NextCheck = new(timestamppb.Timestamp) 819 } 820 proto.Merge(o.NextCheck, source.GetNextCheck()) 821 } 822 } 823 824 func (o *TsEntry_State_AdaptiveThresholdInfo) MergeRaw(source gotenobject.GotenObjectExt) { 825 o.Merge(source.(*TsEntry_State_AdaptiveThresholdInfo)) 826 }