github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/alerting_condition/alerting_condition.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/monitoring/proto/v4/alerting_condition.proto 3 // DO NOT EDIT!!! 4 5 package alerting_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 alerting_policy "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_policy" 20 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 21 time_serie "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/time_serie" 22 meta "github.com/cloudwan/goten-sdk/types/meta" 23 durationpb "google.golang.org/protobuf/types/known/durationpb" 24 ) 25 26 // ensure the imports are used 27 var ( 28 _ = new(fmt.Stringer) 29 _ = new(sort.Interface) 30 31 _ = new(proto.Message) 32 _ = googlefieldmaskpb.FieldMask{} 33 34 _ = new(gotenobject.FieldPath) 35 ) 36 37 // make sure we're using proto imports 38 var ( 39 _ = &alerting_policy.AlertingPolicy{} 40 _ = &common.LabelDescriptor{} 41 _ = &time_serie.Point{} 42 _ = &durationpb.Duration{} 43 _ = &meta.Meta{} 44 ) 45 46 func (o *AlertingCondition) GotenObjectExt() {} 47 48 func (o *AlertingCondition) MakeFullFieldMask() *AlertingCondition_FieldMask { 49 return FullAlertingCondition_FieldMask() 50 } 51 52 func (o *AlertingCondition) MakeRawFullFieldMask() gotenobject.FieldMask { 53 return FullAlertingCondition_FieldMask() 54 } 55 56 func (o *AlertingCondition) MakeDiffFieldMask(other *AlertingCondition) *AlertingCondition_FieldMask { 57 if o == nil && other == nil { 58 return &AlertingCondition_FieldMask{} 59 } 60 if o == nil || other == nil { 61 return FullAlertingCondition_FieldMask() 62 } 63 64 res := &AlertingCondition_FieldMask{} 65 if o.GetName().String() != other.GetName().String() { 66 res.Paths = append(res.Paths, &AlertingCondition_FieldTerminalPath{selector: AlertingCondition_FieldPathSelectorName}) 67 } 68 { 69 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 70 if subMask.IsFull() { 71 res.Paths = append(res.Paths, &AlertingCondition_FieldTerminalPath{selector: AlertingCondition_FieldPathSelectorMetadata}) 72 } else { 73 for _, subpath := range subMask.Paths { 74 res.Paths = append(res.Paths, &AlertingCondition_FieldSubPath{selector: AlertingCondition_FieldPathSelectorMetadata, subPath: subpath}) 75 } 76 } 77 } 78 if o.GetDisplayName() != other.GetDisplayName() { 79 res.Paths = append(res.Paths, &AlertingCondition_FieldTerminalPath{selector: AlertingCondition_FieldPathSelectorDisplayName}) 80 } 81 if o.GetDescription() != other.GetDescription() { 82 res.Paths = append(res.Paths, &AlertingCondition_FieldTerminalPath{selector: AlertingCondition_FieldPathSelectorDescription}) 83 } 84 { 85 subMask := o.GetSpec().MakeDiffFieldMask(other.GetSpec()) 86 if subMask.IsFull() { 87 res.Paths = append(res.Paths, &AlertingCondition_FieldTerminalPath{selector: AlertingCondition_FieldPathSelectorSpec}) 88 } else { 89 for _, subpath := range subMask.Paths { 90 res.Paths = append(res.Paths, &AlertingCondition_FieldSubPath{selector: AlertingCondition_FieldPathSelectorSpec, subPath: subpath}) 91 } 92 } 93 } 94 { 95 subMask := o.GetState().MakeDiffFieldMask(other.GetState()) 96 if subMask.IsFull() { 97 res.Paths = append(res.Paths, &AlertingCondition_FieldTerminalPath{selector: AlertingCondition_FieldPathSelectorState}) 98 } else { 99 for _, subpath := range subMask.Paths { 100 res.Paths = append(res.Paths, &AlertingCondition_FieldSubPath{selector: AlertingCondition_FieldPathSelectorState, subPath: subpath}) 101 } 102 } 103 } 104 return res 105 } 106 107 func (o *AlertingCondition) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 108 return o.MakeDiffFieldMask(other.(*AlertingCondition)) 109 } 110 111 func (o *AlertingCondition) Clone() *AlertingCondition { 112 if o == nil { 113 return nil 114 } 115 result := &AlertingCondition{} 116 if o.Name == nil { 117 result.Name = nil 118 } else if data, err := o.Name.ProtoString(); err != nil { 119 panic(err) 120 } else { 121 result.Name = &Name{} 122 if err := result.Name.ParseProtoString(data); err != nil { 123 panic(err) 124 } 125 } 126 result.Metadata = o.Metadata.Clone() 127 result.DisplayName = o.DisplayName 128 result.Description = o.Description 129 result.Spec = o.Spec.Clone() 130 result.State = o.State.Clone() 131 return result 132 } 133 134 func (o *AlertingCondition) CloneRaw() gotenobject.GotenObjectExt { 135 return o.Clone() 136 } 137 138 func (o *AlertingCondition) Merge(source *AlertingCondition) { 139 if source.GetName() != nil { 140 if data, err := source.GetName().ProtoString(); err != nil { 141 panic(err) 142 } else { 143 o.Name = &Name{} 144 if err := o.Name.ParseProtoString(data); err != nil { 145 panic(err) 146 } 147 } 148 } else { 149 o.Name = nil 150 } 151 if source.GetMetadata() != nil { 152 if o.Metadata == nil { 153 o.Metadata = new(meta.Meta) 154 } 155 o.Metadata.Merge(source.GetMetadata()) 156 } 157 o.DisplayName = source.GetDisplayName() 158 o.Description = source.GetDescription() 159 if source.GetSpec() != nil { 160 if o.Spec == nil { 161 o.Spec = new(AlertingCondition_Spec) 162 } 163 o.Spec.Merge(source.GetSpec()) 164 } 165 if source.GetState() != nil { 166 if o.State == nil { 167 o.State = new(AlertingCondition_State) 168 } 169 o.State.Merge(source.GetState()) 170 } 171 } 172 173 func (o *AlertingCondition) MergeRaw(source gotenobject.GotenObjectExt) { 174 o.Merge(source.(*AlertingCondition)) 175 } 176 177 func (o *AlertingCondition_Spec) GotenObjectExt() {} 178 179 func (o *AlertingCondition_Spec) MakeFullFieldMask() *AlertingCondition_Spec_FieldMask { 180 return FullAlertingCondition_Spec_FieldMask() 181 } 182 183 func (o *AlertingCondition_Spec) MakeRawFullFieldMask() gotenobject.FieldMask { 184 return FullAlertingCondition_Spec_FieldMask() 185 } 186 187 func (o *AlertingCondition_Spec) MakeDiffFieldMask(other *AlertingCondition_Spec) *AlertingCondition_Spec_FieldMask { 188 if o == nil && other == nil { 189 return &AlertingCondition_Spec_FieldMask{} 190 } 191 if o == nil || other == nil { 192 return FullAlertingCondition_Spec_FieldMask() 193 } 194 195 res := &AlertingCondition_Spec_FieldMask{} 196 { 197 subMask := o.GetTimeSeries().MakeDiffFieldMask(other.GetTimeSeries()) 198 if subMask.IsFull() { 199 res.Paths = append(res.Paths, &AlertingConditionSpec_FieldTerminalPath{selector: AlertingConditionSpec_FieldPathSelectorTimeSeries}) 200 } else { 201 for _, subpath := range subMask.Paths { 202 res.Paths = append(res.Paths, &AlertingConditionSpec_FieldSubPath{selector: AlertingConditionSpec_FieldPathSelectorTimeSeries, subPath: subpath}) 203 } 204 } 205 } 206 return res 207 } 208 209 func (o *AlertingCondition_Spec) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 210 return o.MakeDiffFieldMask(other.(*AlertingCondition_Spec)) 211 } 212 213 func (o *AlertingCondition_Spec) Clone() *AlertingCondition_Spec { 214 if o == nil { 215 return nil 216 } 217 result := &AlertingCondition_Spec{} 218 result.TimeSeries = o.TimeSeries.Clone() 219 return result 220 } 221 222 func (o *AlertingCondition_Spec) CloneRaw() gotenobject.GotenObjectExt { 223 return o.Clone() 224 } 225 226 func (o *AlertingCondition_Spec) Merge(source *AlertingCondition_Spec) { 227 if source.GetTimeSeries() != nil { 228 if o.TimeSeries == nil { 229 o.TimeSeries = new(AlertingCondition_Spec_TimeSeries) 230 } 231 o.TimeSeries.Merge(source.GetTimeSeries()) 232 } 233 } 234 235 func (o *AlertingCondition_Spec) MergeRaw(source gotenobject.GotenObjectExt) { 236 o.Merge(source.(*AlertingCondition_Spec)) 237 } 238 239 func (o *AlertingCondition_State) GotenObjectExt() {} 240 241 func (o *AlertingCondition_State) MakeFullFieldMask() *AlertingCondition_State_FieldMask { 242 return FullAlertingCondition_State_FieldMask() 243 } 244 245 func (o *AlertingCondition_State) MakeRawFullFieldMask() gotenobject.FieldMask { 246 return FullAlertingCondition_State_FieldMask() 247 } 248 249 func (o *AlertingCondition_State) MakeDiffFieldMask(other *AlertingCondition_State) *AlertingCondition_State_FieldMask { 250 if o == nil && other == nil { 251 return &AlertingCondition_State_FieldMask{} 252 } 253 if o == nil || other == nil { 254 return FullAlertingCondition_State_FieldMask() 255 } 256 257 res := &AlertingCondition_State_FieldMask{} 258 if o.GetFiringAlertsCount() != other.GetFiringAlertsCount() { 259 res.Paths = append(res.Paths, &AlertingConditionState_FieldTerminalPath{selector: AlertingConditionState_FieldPathSelectorFiringAlertsCount}) 260 } 261 return res 262 } 263 264 func (o *AlertingCondition_State) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 265 return o.MakeDiffFieldMask(other.(*AlertingCondition_State)) 266 } 267 268 func (o *AlertingCondition_State) Clone() *AlertingCondition_State { 269 if o == nil { 270 return nil 271 } 272 result := &AlertingCondition_State{} 273 result.FiringAlertsCount = o.FiringAlertsCount 274 return result 275 } 276 277 func (o *AlertingCondition_State) CloneRaw() gotenobject.GotenObjectExt { 278 return o.Clone() 279 } 280 281 func (o *AlertingCondition_State) Merge(source *AlertingCondition_State) { 282 o.FiringAlertsCount = source.GetFiringAlertsCount() 283 } 284 285 func (o *AlertingCondition_State) MergeRaw(source gotenobject.GotenObjectExt) { 286 o.Merge(source.(*AlertingCondition_State)) 287 } 288 289 func (o *AlertingCondition_Spec_TimeSeries) GotenObjectExt() {} 290 291 func (o *AlertingCondition_Spec_TimeSeries) MakeFullFieldMask() *AlertingCondition_Spec_TimeSeries_FieldMask { 292 return FullAlertingCondition_Spec_TimeSeries_FieldMask() 293 } 294 295 func (o *AlertingCondition_Spec_TimeSeries) MakeRawFullFieldMask() gotenobject.FieldMask { 296 return FullAlertingCondition_Spec_TimeSeries_FieldMask() 297 } 298 299 func (o *AlertingCondition_Spec_TimeSeries) MakeDiffFieldMask(other *AlertingCondition_Spec_TimeSeries) *AlertingCondition_Spec_TimeSeries_FieldMask { 300 if o == nil && other == nil { 301 return &AlertingCondition_Spec_TimeSeries_FieldMask{} 302 } 303 if o == nil || other == nil { 304 return FullAlertingCondition_Spec_TimeSeries_FieldMask() 305 } 306 307 res := &AlertingCondition_Spec_TimeSeries_FieldMask{} 308 { 309 subMask := o.GetQuery().MakeDiffFieldMask(other.GetQuery()) 310 if subMask.IsFull() { 311 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldTerminalPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorQuery}) 312 } else { 313 for _, subpath := range subMask.Paths { 314 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldSubPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorQuery, subPath: subpath}) 315 } 316 } 317 } 318 { 319 subMask := o.GetThreshold().MakeDiffFieldMask(other.GetThreshold()) 320 if subMask.IsFull() { 321 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldTerminalPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorThreshold}) 322 } else { 323 for _, subpath := range subMask.Paths { 324 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldSubPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorThreshold, subPath: subpath}) 325 } 326 } 327 } 328 { 329 subMask := o.GetCombineThreshold().MakeDiffFieldMask(other.GetCombineThreshold()) 330 if subMask.IsFull() { 331 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldTerminalPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorCombineThreshold}) 332 } else { 333 for _, subpath := range subMask.Paths { 334 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldSubPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorCombineThreshold, subPath: subpath}) 335 } 336 } 337 } 338 if !proto.Equal(o.GetDuration(), other.GetDuration()) { 339 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeries_FieldTerminalPath{selector: AlertingConditionSpecTimeSeries_FieldPathSelectorDuration}) 340 } 341 return res 342 } 343 344 func (o *AlertingCondition_Spec_TimeSeries) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 345 return o.MakeDiffFieldMask(other.(*AlertingCondition_Spec_TimeSeries)) 346 } 347 348 func (o *AlertingCondition_Spec_TimeSeries) Clone() *AlertingCondition_Spec_TimeSeries { 349 if o == nil { 350 return nil 351 } 352 result := &AlertingCondition_Spec_TimeSeries{} 353 result.Query = o.Query.Clone() 354 result.Threshold = o.Threshold.Clone() 355 result.CombineThreshold = o.CombineThreshold.Clone() 356 result.Duration = proto.Clone(o.Duration).(*durationpb.Duration) 357 return result 358 } 359 360 func (o *AlertingCondition_Spec_TimeSeries) CloneRaw() gotenobject.GotenObjectExt { 361 return o.Clone() 362 } 363 364 func (o *AlertingCondition_Spec_TimeSeries) Merge(source *AlertingCondition_Spec_TimeSeries) { 365 if source.GetQuery() != nil { 366 if o.Query == nil { 367 o.Query = new(AlertingCondition_Spec_TimeSeries_Query) 368 } 369 o.Query.Merge(source.GetQuery()) 370 } 371 if source.GetThreshold() != nil { 372 if o.Threshold == nil { 373 o.Threshold = new(AlertingCondition_Spec_TimeSeries_Threshold) 374 } 375 o.Threshold.Merge(source.GetThreshold()) 376 } 377 if source.GetCombineThreshold() != nil { 378 if o.CombineThreshold == nil { 379 o.CombineThreshold = new(AlertingCondition_Spec_TimeSeries_CombineThreshold) 380 } 381 o.CombineThreshold.Merge(source.GetCombineThreshold()) 382 } 383 if source.GetDuration() != nil { 384 if o.Duration == nil { 385 o.Duration = new(durationpb.Duration) 386 } 387 proto.Merge(o.Duration, source.GetDuration()) 388 } 389 } 390 391 func (o *AlertingCondition_Spec_TimeSeries) MergeRaw(source gotenobject.GotenObjectExt) { 392 o.Merge(source.(*AlertingCondition_Spec_TimeSeries)) 393 } 394 395 func (o *AlertingCondition_Spec_TimeSeries_Query) GotenObjectExt() {} 396 397 func (o *AlertingCondition_Spec_TimeSeries_Query) MakeFullFieldMask() *AlertingCondition_Spec_TimeSeries_Query_FieldMask { 398 return FullAlertingCondition_Spec_TimeSeries_Query_FieldMask() 399 } 400 401 func (o *AlertingCondition_Spec_TimeSeries_Query) MakeRawFullFieldMask() gotenobject.FieldMask { 402 return FullAlertingCondition_Spec_TimeSeries_Query_FieldMask() 403 } 404 405 func (o *AlertingCondition_Spec_TimeSeries_Query) MakeDiffFieldMask(other *AlertingCondition_Spec_TimeSeries_Query) *AlertingCondition_Spec_TimeSeries_Query_FieldMask { 406 if o == nil && other == nil { 407 return &AlertingCondition_Spec_TimeSeries_Query_FieldMask{} 408 } 409 if o == nil || other == nil { 410 return FullAlertingCondition_Spec_TimeSeries_Query_FieldMask() 411 } 412 413 res := &AlertingCondition_Spec_TimeSeries_Query_FieldMask{} 414 if o.GetFilter().String() != other.GetFilter().String() { 415 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorFilter}) 416 } 417 { 418 subMask := o.GetSelector().MakeDiffFieldMask(other.GetSelector()) 419 if subMask.IsFull() { 420 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorSelector}) 421 } else { 422 for _, subpath := range subMask.Paths { 423 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldSubPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorSelector, subPath: subpath}) 424 } 425 } 426 } 427 { 428 subMask := o.GetAggregation().MakeDiffFieldMask(other.GetAggregation()) 429 if subMask.IsFull() { 430 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorAggregation}) 431 } else { 432 for _, subpath := range subMask.Paths { 433 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldSubPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorAggregation, subPath: subpath}) 434 } 435 } 436 } 437 438 if len(o.GetPerMetricAggregations()) == len(other.GetPerMetricAggregations()) { 439 for i, lValue := range o.GetPerMetricAggregations() { 440 rValue := other.GetPerMetricAggregations()[i] 441 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 442 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorPerMetricAggregations}) 443 break 444 } 445 } 446 } else { 447 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesQuery_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesQuery_FieldPathSelectorPerMetricAggregations}) 448 } 449 return res 450 } 451 452 func (o *AlertingCondition_Spec_TimeSeries_Query) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 453 return o.MakeDiffFieldMask(other.(*AlertingCondition_Spec_TimeSeries_Query)) 454 } 455 456 func (o *AlertingCondition_Spec_TimeSeries_Query) Clone() *AlertingCondition_Spec_TimeSeries_Query { 457 if o == nil { 458 return nil 459 } 460 result := &AlertingCondition_Spec_TimeSeries_Query{} 461 if o.Filter == nil { 462 result.Filter = nil 463 } else if data, err := o.Filter.ProtoString(); err != nil { 464 panic(err) 465 } else { 466 result.Filter = &time_serie.Filter{} 467 if err := result.Filter.ParseProtoString(data); err != nil { 468 panic(err) 469 } 470 } 471 result.Selector = o.Selector.Clone() 472 result.Aggregation = o.Aggregation.Clone() 473 result.PerMetricAggregations = map[string]*common.Aggregation{} 474 for key, sourceValue := range o.PerMetricAggregations { 475 result.PerMetricAggregations[key] = sourceValue.Clone() 476 } 477 return result 478 } 479 480 func (o *AlertingCondition_Spec_TimeSeries_Query) CloneRaw() gotenobject.GotenObjectExt { 481 return o.Clone() 482 } 483 484 func (o *AlertingCondition_Spec_TimeSeries_Query) Merge(source *AlertingCondition_Spec_TimeSeries_Query) { 485 if source.GetFilter() != nil { 486 if data, err := source.GetFilter().ProtoString(); err != nil { 487 panic(err) 488 } else { 489 o.Filter = &time_serie.Filter{} 490 if err := o.Filter.ParseProtoString(data); err != nil { 491 panic(err) 492 } 493 } 494 } else { 495 o.Filter = nil 496 } 497 if source.GetSelector() != nil { 498 if o.Selector == nil { 499 o.Selector = new(common.TimeSeriesSelector) 500 } 501 o.Selector.Merge(source.GetSelector()) 502 } 503 if source.GetAggregation() != nil { 504 if o.Aggregation == nil { 505 o.Aggregation = new(common.Aggregation) 506 } 507 o.Aggregation.Merge(source.GetAggregation()) 508 } 509 if source.GetPerMetricAggregations() != nil { 510 if o.PerMetricAggregations == nil { 511 o.PerMetricAggregations = make(map[string]*common.Aggregation, len(source.GetPerMetricAggregations())) 512 } 513 for key, sourceValue := range source.GetPerMetricAggregations() { 514 if sourceValue != nil { 515 if o.PerMetricAggregations[key] == nil { 516 o.PerMetricAggregations[key] = new(common.Aggregation) 517 } 518 o.PerMetricAggregations[key].Merge(sourceValue) 519 } 520 } 521 } 522 } 523 524 func (o *AlertingCondition_Spec_TimeSeries_Query) MergeRaw(source gotenobject.GotenObjectExt) { 525 o.Merge(source.(*AlertingCondition_Spec_TimeSeries_Query)) 526 } 527 528 func (o *AlertingCondition_Spec_TimeSeries_Threshold) GotenObjectExt() {} 529 530 func (o *AlertingCondition_Spec_TimeSeries_Threshold) MakeFullFieldMask() *AlertingCondition_Spec_TimeSeries_Threshold_FieldMask { 531 return FullAlertingCondition_Spec_TimeSeries_Threshold_FieldMask() 532 } 533 534 func (o *AlertingCondition_Spec_TimeSeries_Threshold) MakeRawFullFieldMask() gotenobject.FieldMask { 535 return FullAlertingCondition_Spec_TimeSeries_Threshold_FieldMask() 536 } 537 538 func (o *AlertingCondition_Spec_TimeSeries_Threshold) MakeDiffFieldMask(other *AlertingCondition_Spec_TimeSeries_Threshold) *AlertingCondition_Spec_TimeSeries_Threshold_FieldMask { 539 if o == nil && other == nil { 540 return &AlertingCondition_Spec_TimeSeries_Threshold_FieldMask{} 541 } 542 if o == nil || other == nil { 543 return FullAlertingCondition_Spec_TimeSeries_Threshold_FieldMask() 544 } 545 546 res := &AlertingCondition_Spec_TimeSeries_Threshold_FieldMask{} 547 if o.GetCompare() != other.GetCompare() { 548 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesThreshold_FieldPathSelectorCompare}) 549 } 550 if o.GetValue() != other.GetValue() { 551 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesThreshold_FieldPathSelectorValue}) 552 } 553 return res 554 } 555 556 func (o *AlertingCondition_Spec_TimeSeries_Threshold) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 557 return o.MakeDiffFieldMask(other.(*AlertingCondition_Spec_TimeSeries_Threshold)) 558 } 559 560 func (o *AlertingCondition_Spec_TimeSeries_Threshold) Clone() *AlertingCondition_Spec_TimeSeries_Threshold { 561 if o == nil { 562 return nil 563 } 564 result := &AlertingCondition_Spec_TimeSeries_Threshold{} 565 result.Compare = o.Compare 566 result.Value = o.Value 567 return result 568 } 569 570 func (o *AlertingCondition_Spec_TimeSeries_Threshold) CloneRaw() gotenobject.GotenObjectExt { 571 return o.Clone() 572 } 573 574 func (o *AlertingCondition_Spec_TimeSeries_Threshold) Merge(source *AlertingCondition_Spec_TimeSeries_Threshold) { 575 o.Compare = source.GetCompare() 576 o.Value = source.GetValue() 577 } 578 579 func (o *AlertingCondition_Spec_TimeSeries_Threshold) MergeRaw(source gotenobject.GotenObjectExt) { 580 o.Merge(source.(*AlertingCondition_Spec_TimeSeries_Threshold)) 581 } 582 583 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) GotenObjectExt() {} 584 585 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) MakeFullFieldMask() *AlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask { 586 return FullAlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask() 587 } 588 589 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) MakeRawFullFieldMask() gotenobject.FieldMask { 590 return FullAlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask() 591 } 592 593 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) MakeDiffFieldMask(other *AlertingCondition_Spec_TimeSeries_CombineThreshold) *AlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask { 594 if o == nil && other == nil { 595 return &AlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask{} 596 } 597 if o == nil || other == nil { 598 return FullAlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask() 599 } 600 601 res := &AlertingCondition_Spec_TimeSeries_CombineThreshold_FieldMask{} 602 603 if len(o.GetPerMetric()) == len(other.GetPerMetric()) { 604 for i, lValue := range o.GetPerMetric() { 605 rValue := other.GetPerMetric()[i] 606 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 607 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesCombineThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesCombineThreshold_FieldPathSelectorPerMetric}) 608 break 609 } 610 } 611 } else { 612 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesCombineThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesCombineThreshold_FieldPathSelectorPerMetric}) 613 } 614 if o.GetMainMetricType() != other.GetMainMetricType() { 615 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesCombineThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesCombineThreshold_FieldPathSelectorMainMetricType}) 616 } 617 618 if len(o.GetPerMetricTypeKv()) == len(other.GetPerMetricTypeKv()) { 619 for i, lValue := range o.GetPerMetricTypeKv() { 620 rValue := other.GetPerMetricTypeKv()[i] 621 if string(lValue) != string(rValue) { 622 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesCombineThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesCombineThreshold_FieldPathSelectorPerMetricTypeKv}) 623 break 624 } 625 } 626 } else { 627 res.Paths = append(res.Paths, &AlertingConditionSpecTimeSeriesCombineThreshold_FieldTerminalPath{selector: AlertingConditionSpecTimeSeriesCombineThreshold_FieldPathSelectorPerMetricTypeKv}) 628 } 629 return res 630 } 631 632 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 633 return o.MakeDiffFieldMask(other.(*AlertingCondition_Spec_TimeSeries_CombineThreshold)) 634 } 635 636 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) Clone() *AlertingCondition_Spec_TimeSeries_CombineThreshold { 637 if o == nil { 638 return nil 639 } 640 result := &AlertingCondition_Spec_TimeSeries_CombineThreshold{} 641 result.PerMetric = map[string]*AlertingCondition_Spec_TimeSeries_Threshold{} 642 for key, sourceValue := range o.PerMetric { 643 result.PerMetric[key] = sourceValue.Clone() 644 } 645 result.MainMetricType = o.MainMetricType 646 result.PerMetricTypeKv = map[string][]byte{} 647 for key, sourceValue := range o.PerMetricTypeKv { 648 result.PerMetricTypeKv[key] = sourceValue 649 } 650 return result 651 } 652 653 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) CloneRaw() gotenobject.GotenObjectExt { 654 return o.Clone() 655 } 656 657 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) Merge(source *AlertingCondition_Spec_TimeSeries_CombineThreshold) { 658 if source.GetPerMetric() != nil { 659 if o.PerMetric == nil { 660 o.PerMetric = make(map[string]*AlertingCondition_Spec_TimeSeries_Threshold, len(source.GetPerMetric())) 661 } 662 for key, sourceValue := range source.GetPerMetric() { 663 if sourceValue != nil { 664 if o.PerMetric[key] == nil { 665 o.PerMetric[key] = new(AlertingCondition_Spec_TimeSeries_Threshold) 666 } 667 o.PerMetric[key].Merge(sourceValue) 668 } 669 } 670 } 671 o.MainMetricType = source.GetMainMetricType() 672 if source.GetPerMetricTypeKv() != nil { 673 if o.PerMetricTypeKv == nil { 674 o.PerMetricTypeKv = make(map[string][]byte, len(source.GetPerMetricTypeKv())) 675 } 676 for key, sourceValue := range source.GetPerMetricTypeKv() { 677 o.PerMetricTypeKv[key] = sourceValue 678 } 679 } 680 } 681 682 func (o *AlertingCondition_Spec_TimeSeries_CombineThreshold) MergeRaw(source gotenobject.GotenObjectExt) { 683 o.Merge(source.(*AlertingCondition_Spec_TimeSeries_CombineThreshold)) 684 }