github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/notification/notification.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/monitoring/proto/v4/notification.proto 3 // DO NOT EDIT!!! 4 5 package notification 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 alert "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alert" 20 alerting_condition "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_condition" 21 alerting_policy "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_policy" 22 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 23 notification_channel "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/notification_channel" 24 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/project" 25 meta "github.com/cloudwan/goten-sdk/types/meta" 26 ) 27 28 // ensure the imports are used 29 var ( 30 _ = new(fmt.Stringer) 31 _ = new(sort.Interface) 32 33 _ = new(proto.Message) 34 _ = googlefieldmaskpb.FieldMask{} 35 36 _ = new(gotenobject.FieldPath) 37 ) 38 39 // make sure we're using proto imports 40 var ( 41 _ = &alert.Alert{} 42 _ = &alerting_condition.AlertingCondition{} 43 _ = &alerting_policy.AlertingPolicy{} 44 _ = &common.LabelDescriptor{} 45 _ = ¬ification_channel.NotificationChannel{} 46 _ = &project.Project{} 47 _ = &meta.Meta{} 48 ) 49 50 func (o *Notification) GotenObjectExt() {} 51 52 func (o *Notification) MakeFullFieldMask() *Notification_FieldMask { 53 return FullNotification_FieldMask() 54 } 55 56 func (o *Notification) MakeRawFullFieldMask() gotenobject.FieldMask { 57 return FullNotification_FieldMask() 58 } 59 60 func (o *Notification) MakeDiffFieldMask(other *Notification) *Notification_FieldMask { 61 if o == nil && other == nil { 62 return &Notification_FieldMask{} 63 } 64 if o == nil || other == nil { 65 return FullNotification_FieldMask() 66 } 67 68 res := &Notification_FieldMask{} 69 if o.GetName().String() != other.GetName().String() { 70 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorName}) 71 } 72 { 73 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 74 if subMask.IsFull() { 75 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorMetadata}) 76 } else { 77 for _, subpath := range subMask.Paths { 78 res.Paths = append(res.Paths, &Notification_FieldSubPath{selector: Notification_FieldPathSelectorMetadata, subPath: subpath}) 79 } 80 } 81 } 82 83 if len(o.GetAlerts()) == len(other.GetAlerts()) { 84 for i, lValue := range o.GetAlerts() { 85 rValue := other.GetAlerts()[i] 86 if lValue.String() != rValue.String() { 87 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorAlerts}) 88 break 89 } 90 } 91 } else { 92 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorAlerts}) 93 } 94 95 if len(o.GetAlertSets()) == len(other.GetAlertSets()) { 96 for i, lValue := range o.GetAlertSets() { 97 rValue := other.GetAlertSets()[i] 98 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 99 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorAlertSets}) 100 break 101 } 102 } 103 } else { 104 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorAlertSets}) 105 } 106 { 107 subMask := o.GetState().MakeDiffFieldMask(other.GetState()) 108 if subMask.IsFull() { 109 res.Paths = append(res.Paths, &Notification_FieldTerminalPath{selector: Notification_FieldPathSelectorState}) 110 } else { 111 for _, subpath := range subMask.Paths { 112 res.Paths = append(res.Paths, &Notification_FieldSubPath{selector: Notification_FieldPathSelectorState, subPath: subpath}) 113 } 114 } 115 } 116 return res 117 } 118 119 func (o *Notification) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 120 return o.MakeDiffFieldMask(other.(*Notification)) 121 } 122 123 func (o *Notification) Clone() *Notification { 124 if o == nil { 125 return nil 126 } 127 result := &Notification{} 128 if o.Name == nil { 129 result.Name = nil 130 } else if data, err := o.Name.ProtoString(); err != nil { 131 panic(err) 132 } else { 133 result.Name = &Name{} 134 if err := result.Name.ParseProtoString(data); err != nil { 135 panic(err) 136 } 137 } 138 result.Metadata = o.Metadata.Clone() 139 result.Alerts = make([]*alert.Name, len(o.Alerts)) 140 for i, sourceValue := range o.Alerts { 141 if sourceValue == nil { 142 result.Alerts[i] = nil 143 } else if data, err := sourceValue.ProtoString(); err != nil { 144 panic(err) 145 } else { 146 result.Alerts[i] = &alert.Name{} 147 if err := result.Alerts[i].ParseProtoString(data); err != nil { 148 panic(err) 149 } 150 } 151 } 152 result.AlertSets = make([]*Notification_AlertsSet, len(o.AlertSets)) 153 for i, sourceValue := range o.AlertSets { 154 result.AlertSets[i] = sourceValue.Clone() 155 } 156 result.State = o.State.Clone() 157 return result 158 } 159 160 func (o *Notification) CloneRaw() gotenobject.GotenObjectExt { 161 return o.Clone() 162 } 163 164 func (o *Notification) Merge(source *Notification) { 165 if source.GetName() != nil { 166 if data, err := source.GetName().ProtoString(); err != nil { 167 panic(err) 168 } else { 169 o.Name = &Name{} 170 if err := o.Name.ParseProtoString(data); err != nil { 171 panic(err) 172 } 173 } 174 } else { 175 o.Name = nil 176 } 177 if source.GetMetadata() != nil { 178 if o.Metadata == nil { 179 o.Metadata = new(meta.Meta) 180 } 181 o.Metadata.Merge(source.GetMetadata()) 182 } 183 for _, sourceValue := range source.GetAlerts() { 184 exists := false 185 for _, currentValue := range o.Alerts { 186 leftProtoStr, _ := currentValue.ProtoString() 187 rightProtoStr, _ := sourceValue.ProtoString() 188 if leftProtoStr == rightProtoStr { 189 exists = true 190 break 191 } 192 } 193 if !exists { 194 var newDstElement *alert.Name 195 if sourceValue != nil { 196 if data, err := sourceValue.ProtoString(); err != nil { 197 panic(err) 198 } else { 199 newDstElement = &alert.Name{} 200 if err := newDstElement.ParseProtoString(data); err != nil { 201 panic(err) 202 } 203 } 204 } 205 o.Alerts = append(o.Alerts, newDstElement) 206 } 207 } 208 209 for _, sourceValue := range source.GetAlertSets() { 210 exists := false 211 for _, currentValue := range o.AlertSets { 212 if proto.Equal(sourceValue, currentValue) { 213 exists = true 214 break 215 } 216 } 217 if !exists { 218 var newDstElement *Notification_AlertsSet 219 if sourceValue != nil { 220 newDstElement = new(Notification_AlertsSet) 221 newDstElement.Merge(sourceValue) 222 } 223 o.AlertSets = append(o.AlertSets, newDstElement) 224 } 225 } 226 227 if source.GetState() != nil { 228 if o.State == nil { 229 o.State = new(Notification_State) 230 } 231 o.State.Merge(source.GetState()) 232 } 233 } 234 235 func (o *Notification) MergeRaw(source gotenobject.GotenObjectExt) { 236 o.Merge(source.(*Notification)) 237 } 238 239 func (o *Notification_AlertsSet) GotenObjectExt() {} 240 241 func (o *Notification_AlertsSet) MakeFullFieldMask() *Notification_AlertsSet_FieldMask { 242 return FullNotification_AlertsSet_FieldMask() 243 } 244 245 func (o *Notification_AlertsSet) MakeRawFullFieldMask() gotenobject.FieldMask { 246 return FullNotification_AlertsSet_FieldMask() 247 } 248 249 func (o *Notification_AlertsSet) MakeDiffFieldMask(other *Notification_AlertsSet) *Notification_AlertsSet_FieldMask { 250 if o == nil && other == nil { 251 return &Notification_AlertsSet_FieldMask{} 252 } 253 if o == nil || other == nil { 254 return FullNotification_AlertsSet_FieldMask() 255 } 256 257 res := &Notification_AlertsSet_FieldMask{} 258 if o.GetCondition().String() != other.GetCondition().String() { 259 res.Paths = append(res.Paths, &NotificationAlertsSet_FieldTerminalPath{selector: NotificationAlertsSet_FieldPathSelectorCondition}) 260 } 261 262 if len(o.GetIds()) == len(other.GetIds()) { 263 for i, lValue := range o.GetIds() { 264 rValue := other.GetIds()[i] 265 if lValue != rValue { 266 res.Paths = append(res.Paths, &NotificationAlertsSet_FieldTerminalPath{selector: NotificationAlertsSet_FieldPathSelectorIds}) 267 break 268 } 269 } 270 } else { 271 res.Paths = append(res.Paths, &NotificationAlertsSet_FieldTerminalPath{selector: NotificationAlertsSet_FieldPathSelectorIds}) 272 } 273 return res 274 } 275 276 func (o *Notification_AlertsSet) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 277 return o.MakeDiffFieldMask(other.(*Notification_AlertsSet)) 278 } 279 280 func (o *Notification_AlertsSet) Clone() *Notification_AlertsSet { 281 if o == nil { 282 return nil 283 } 284 result := &Notification_AlertsSet{} 285 if o.Condition == nil { 286 result.Condition = nil 287 } else if data, err := o.Condition.ProtoString(); err != nil { 288 panic(err) 289 } else { 290 result.Condition = &alerting_condition.Name{} 291 if err := result.Condition.ParseProtoString(data); err != nil { 292 panic(err) 293 } 294 } 295 result.Ids = make([]string, len(o.Ids)) 296 for i, sourceValue := range o.Ids { 297 result.Ids[i] = sourceValue 298 } 299 return result 300 } 301 302 func (o *Notification_AlertsSet) CloneRaw() gotenobject.GotenObjectExt { 303 return o.Clone() 304 } 305 306 func (o *Notification_AlertsSet) Merge(source *Notification_AlertsSet) { 307 if source.GetCondition() != nil { 308 if data, err := source.GetCondition().ProtoString(); err != nil { 309 panic(err) 310 } else { 311 o.Condition = &alerting_condition.Name{} 312 if err := o.Condition.ParseProtoString(data); err != nil { 313 panic(err) 314 } 315 } 316 } else { 317 o.Condition = nil 318 } 319 for _, sourceValue := range source.GetIds() { 320 exists := false 321 for _, currentValue := range o.Ids { 322 if currentValue == sourceValue { 323 exists = true 324 break 325 } 326 } 327 if !exists { 328 var newDstElement string 329 newDstElement = sourceValue 330 o.Ids = append(o.Ids, newDstElement) 331 } 332 } 333 334 } 335 336 func (o *Notification_AlertsSet) MergeRaw(source gotenobject.GotenObjectExt) { 337 o.Merge(source.(*Notification_AlertsSet)) 338 } 339 340 func (o *Notification_State) GotenObjectExt() {} 341 342 func (o *Notification_State) MakeFullFieldMask() *Notification_State_FieldMask { 343 return FullNotification_State_FieldMask() 344 } 345 346 func (o *Notification_State) MakeRawFullFieldMask() gotenobject.FieldMask { 347 return FullNotification_State_FieldMask() 348 } 349 350 func (o *Notification_State) MakeDiffFieldMask(other *Notification_State) *Notification_State_FieldMask { 351 if o == nil && other == nil { 352 return &Notification_State_FieldMask{} 353 } 354 if o == nil || other == nil { 355 return FullNotification_State_FieldMask() 356 } 357 358 res := &Notification_State_FieldMask{} 359 if o.GetIsResolved() != other.GetIsResolved() { 360 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorIsResolved}) 361 } 362 363 if len(o.GetNotificationState()) == len(other.GetNotificationState()) { 364 for i, lValue := range o.GetNotificationState() { 365 rValue := other.GetNotificationState()[i] 366 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 367 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorNotificationState}) 368 break 369 } 370 } 371 } else { 372 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorNotificationState}) 373 } 374 if o.GetIncidentNotifyAttemptsDone() != other.GetIncidentNotifyAttemptsDone() { 375 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorIncidentNotifyAttemptsDone}) 376 } 377 if o.GetResolutionNotifyAttemptsDone() != other.GetResolutionNotifyAttemptsDone() { 378 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorResolutionNotifyAttemptsDone}) 379 } 380 { 381 subMask := o.GetAlertsLifetime().MakeDiffFieldMask(other.GetAlertsLifetime()) 382 if subMask.IsFull() { 383 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorAlertsLifetime}) 384 } else { 385 for _, subpath := range subMask.Paths { 386 res.Paths = append(res.Paths, &NotificationState_FieldSubPath{selector: NotificationState_FieldPathSelectorAlertsLifetime, subPath: subpath}) 387 } 388 } 389 } 390 391 if len(o.GetResolutionNotificationState()) == len(other.GetResolutionNotificationState()) { 392 for i, lValue := range o.GetResolutionNotificationState() { 393 rValue := other.GetResolutionNotificationState()[i] 394 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 395 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorResolutionNotificationState}) 396 break 397 } 398 } 399 } else { 400 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorResolutionNotificationState}) 401 } 402 if o.GetLifecycleCompleted() != other.GetLifecycleCompleted() { 403 res.Paths = append(res.Paths, &NotificationState_FieldTerminalPath{selector: NotificationState_FieldPathSelectorLifecycleCompleted}) 404 } 405 return res 406 } 407 408 func (o *Notification_State) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 409 return o.MakeDiffFieldMask(other.(*Notification_State)) 410 } 411 412 func (o *Notification_State) Clone() *Notification_State { 413 if o == nil { 414 return nil 415 } 416 result := &Notification_State{} 417 result.IsResolved = o.IsResolved 418 result.NotificationState = make([]*Notification_State_NotificationState, len(o.NotificationState)) 419 for i, sourceValue := range o.NotificationState { 420 result.NotificationState[i] = sourceValue.Clone() 421 } 422 result.IncidentNotifyAttemptsDone = o.IncidentNotifyAttemptsDone 423 result.ResolutionNotifyAttemptsDone = o.ResolutionNotifyAttemptsDone 424 result.AlertsLifetime = o.AlertsLifetime.Clone() 425 result.ResolutionNotificationState = make([]*Notification_State_NotificationState, len(o.ResolutionNotificationState)) 426 for i, sourceValue := range o.ResolutionNotificationState { 427 result.ResolutionNotificationState[i] = sourceValue.Clone() 428 } 429 result.LifecycleCompleted = o.LifecycleCompleted 430 return result 431 } 432 433 func (o *Notification_State) CloneRaw() gotenobject.GotenObjectExt { 434 return o.Clone() 435 } 436 437 func (o *Notification_State) Merge(source *Notification_State) { 438 o.IsResolved = source.GetIsResolved() 439 for _, sourceValue := range source.GetNotificationState() { 440 exists := false 441 for _, currentValue := range o.NotificationState { 442 if proto.Equal(sourceValue, currentValue) { 443 exists = true 444 break 445 } 446 } 447 if !exists { 448 var newDstElement *Notification_State_NotificationState 449 if sourceValue != nil { 450 newDstElement = new(Notification_State_NotificationState) 451 newDstElement.Merge(sourceValue) 452 } 453 o.NotificationState = append(o.NotificationState, newDstElement) 454 } 455 } 456 457 o.IncidentNotifyAttemptsDone = source.GetIncidentNotifyAttemptsDone() 458 o.ResolutionNotifyAttemptsDone = source.GetResolutionNotifyAttemptsDone() 459 if source.GetAlertsLifetime() != nil { 460 if o.AlertsLifetime == nil { 461 o.AlertsLifetime = new(common.TimeRange) 462 } 463 o.AlertsLifetime.Merge(source.GetAlertsLifetime()) 464 } 465 for _, sourceValue := range source.GetResolutionNotificationState() { 466 exists := false 467 for _, currentValue := range o.ResolutionNotificationState { 468 if proto.Equal(sourceValue, currentValue) { 469 exists = true 470 break 471 } 472 } 473 if !exists { 474 var newDstElement *Notification_State_NotificationState 475 if sourceValue != nil { 476 newDstElement = new(Notification_State_NotificationState) 477 newDstElement.Merge(sourceValue) 478 } 479 o.ResolutionNotificationState = append(o.ResolutionNotificationState, newDstElement) 480 } 481 } 482 483 o.LifecycleCompleted = source.GetLifecycleCompleted() 484 } 485 486 func (o *Notification_State) MergeRaw(source gotenobject.GotenObjectExt) { 487 o.Merge(source.(*Notification_State)) 488 } 489 490 func (o *Notification_State_NotificationState) GotenObjectExt() {} 491 492 func (o *Notification_State_NotificationState) MakeFullFieldMask() *Notification_State_NotificationState_FieldMask { 493 return FullNotification_State_NotificationState_FieldMask() 494 } 495 496 func (o *Notification_State_NotificationState) MakeRawFullFieldMask() gotenobject.FieldMask { 497 return FullNotification_State_NotificationState_FieldMask() 498 } 499 500 func (o *Notification_State_NotificationState) MakeDiffFieldMask(other *Notification_State_NotificationState) *Notification_State_NotificationState_FieldMask { 501 if o == nil && other == nil { 502 return &Notification_State_NotificationState_FieldMask{} 503 } 504 if o == nil || other == nil { 505 return FullNotification_State_NotificationState_FieldMask() 506 } 507 508 res := &Notification_State_NotificationState_FieldMask{} 509 if o.GetNotificationChannel().String() != other.GetNotificationChannel().String() { 510 res.Paths = append(res.Paths, &NotificationStateNotificationState_FieldTerminalPath{selector: NotificationStateNotificationState_FieldPathSelectorNotificationChannel}) 511 } 512 if o.GetStatus() != other.GetStatus() { 513 res.Paths = append(res.Paths, &NotificationStateNotificationState_FieldTerminalPath{selector: NotificationStateNotificationState_FieldPathSelectorStatus}) 514 } 515 if o.GetError() != other.GetError() { 516 res.Paths = append(res.Paths, &NotificationStateNotificationState_FieldTerminalPath{selector: NotificationStateNotificationState_FieldPathSelectorError}) 517 } 518 { 519 subMask := o.GetProviderData().MakeDiffFieldMask(other.GetProviderData()) 520 if subMask.IsFull() { 521 res.Paths = append(res.Paths, &NotificationStateNotificationState_FieldTerminalPath{selector: NotificationStateNotificationState_FieldPathSelectorProviderData}) 522 } else { 523 for _, subpath := range subMask.Paths { 524 res.Paths = append(res.Paths, &NotificationStateNotificationState_FieldSubPath{selector: NotificationStateNotificationState_FieldPathSelectorProviderData, subPath: subpath}) 525 } 526 } 527 } 528 if o.GetNotifyAttempts() != other.GetNotifyAttempts() { 529 res.Paths = append(res.Paths, &NotificationStateNotificationState_FieldTerminalPath{selector: NotificationStateNotificationState_FieldPathSelectorNotifyAttempts}) 530 } 531 return res 532 } 533 534 func (o *Notification_State_NotificationState) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 535 return o.MakeDiffFieldMask(other.(*Notification_State_NotificationState)) 536 } 537 538 func (o *Notification_State_NotificationState) Clone() *Notification_State_NotificationState { 539 if o == nil { 540 return nil 541 } 542 result := &Notification_State_NotificationState{} 543 if o.NotificationChannel == nil { 544 result.NotificationChannel = nil 545 } else if data, err := o.NotificationChannel.ProtoString(); err != nil { 546 panic(err) 547 } else { 548 result.NotificationChannel = ¬ification_channel.Name{} 549 if err := result.NotificationChannel.ParseProtoString(data); err != nil { 550 panic(err) 551 } 552 } 553 result.Status = o.Status 554 result.Error = o.Error 555 result.ProviderData = o.ProviderData.Clone() 556 result.NotifyAttempts = o.NotifyAttempts 557 return result 558 } 559 560 func (o *Notification_State_NotificationState) CloneRaw() gotenobject.GotenObjectExt { 561 return o.Clone() 562 } 563 564 func (o *Notification_State_NotificationState) Merge(source *Notification_State_NotificationState) { 565 if source.GetNotificationChannel() != nil { 566 if data, err := source.GetNotificationChannel().ProtoString(); err != nil { 567 panic(err) 568 } else { 569 o.NotificationChannel = ¬ification_channel.Name{} 570 if err := o.NotificationChannel.ParseProtoString(data); err != nil { 571 panic(err) 572 } 573 } 574 } else { 575 o.NotificationChannel = nil 576 } 577 o.Status = source.GetStatus() 578 o.Error = source.GetError() 579 if source.GetProviderData() != nil { 580 if o.ProviderData == nil { 581 o.ProviderData = new(Notification_State_NotificationState_ProviderData) 582 } 583 o.ProviderData.Merge(source.GetProviderData()) 584 } 585 o.NotifyAttempts = source.GetNotifyAttempts() 586 } 587 588 func (o *Notification_State_NotificationState) MergeRaw(source gotenobject.GotenObjectExt) { 589 o.Merge(source.(*Notification_State_NotificationState)) 590 } 591 592 func (o *Notification_State_NotificationState_ProviderData) GotenObjectExt() {} 593 594 func (o *Notification_State_NotificationState_ProviderData) MakeFullFieldMask() *Notification_State_NotificationState_ProviderData_FieldMask { 595 return FullNotification_State_NotificationState_ProviderData_FieldMask() 596 } 597 598 func (o *Notification_State_NotificationState_ProviderData) MakeRawFullFieldMask() gotenobject.FieldMask { 599 return FullNotification_State_NotificationState_ProviderData_FieldMask() 600 } 601 602 func (o *Notification_State_NotificationState_ProviderData) MakeDiffFieldMask(other *Notification_State_NotificationState_ProviderData) *Notification_State_NotificationState_ProviderData_FieldMask { 603 if o == nil && other == nil { 604 return &Notification_State_NotificationState_ProviderData_FieldMask{} 605 } 606 if o == nil || other == nil { 607 return FullNotification_State_NotificationState_ProviderData_FieldMask() 608 } 609 610 res := &Notification_State_NotificationState_ProviderData_FieldMask{} 611 { 612 subMask := o.GetSlack().MakeDiffFieldMask(other.GetSlack()) 613 if subMask.IsFull() { 614 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderData_FieldTerminalPath{selector: NotificationStateNotificationStateProviderData_FieldPathSelectorSlack}) 615 } else { 616 for _, subpath := range subMask.Paths { 617 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderData_FieldSubPath{selector: NotificationStateNotificationStateProviderData_FieldPathSelectorSlack, subPath: subpath}) 618 } 619 } 620 } 621 { 622 subMask := o.GetPagerDuty().MakeDiffFieldMask(other.GetPagerDuty()) 623 if subMask.IsFull() { 624 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderData_FieldTerminalPath{selector: NotificationStateNotificationStateProviderData_FieldPathSelectorPagerDuty}) 625 } else { 626 for _, subpath := range subMask.Paths { 627 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderData_FieldSubPath{selector: NotificationStateNotificationStateProviderData_FieldPathSelectorPagerDuty, subPath: subpath}) 628 } 629 } 630 } 631 { 632 subMask := o.GetWebhook().MakeDiffFieldMask(other.GetWebhook()) 633 if subMask.IsFull() { 634 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderData_FieldTerminalPath{selector: NotificationStateNotificationStateProviderData_FieldPathSelectorWebhook}) 635 } else { 636 for _, subpath := range subMask.Paths { 637 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderData_FieldSubPath{selector: NotificationStateNotificationStateProviderData_FieldPathSelectorWebhook, subPath: subpath}) 638 } 639 } 640 } 641 return res 642 } 643 644 func (o *Notification_State_NotificationState_ProviderData) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 645 return o.MakeDiffFieldMask(other.(*Notification_State_NotificationState_ProviderData)) 646 } 647 648 func (o *Notification_State_NotificationState_ProviderData) Clone() *Notification_State_NotificationState_ProviderData { 649 if o == nil { 650 return nil 651 } 652 result := &Notification_State_NotificationState_ProviderData{} 653 result.Slack = o.Slack.Clone() 654 result.PagerDuty = o.PagerDuty.Clone() 655 result.Webhook = o.Webhook.Clone() 656 return result 657 } 658 659 func (o *Notification_State_NotificationState_ProviderData) CloneRaw() gotenobject.GotenObjectExt { 660 return o.Clone() 661 } 662 663 func (o *Notification_State_NotificationState_ProviderData) Merge(source *Notification_State_NotificationState_ProviderData) { 664 if source.GetSlack() != nil { 665 if o.Slack == nil { 666 o.Slack = new(Notification_State_NotificationState_ProviderData_Slack) 667 } 668 o.Slack.Merge(source.GetSlack()) 669 } 670 if source.GetPagerDuty() != nil { 671 if o.PagerDuty == nil { 672 o.PagerDuty = new(Notification_State_NotificationState_ProviderData_PagerDuty) 673 } 674 o.PagerDuty.Merge(source.GetPagerDuty()) 675 } 676 if source.GetWebhook() != nil { 677 if o.Webhook == nil { 678 o.Webhook = new(Notification_State_NotificationState_ProviderData_WebHook) 679 } 680 o.Webhook.Merge(source.GetWebhook()) 681 } 682 } 683 684 func (o *Notification_State_NotificationState_ProviderData) MergeRaw(source gotenobject.GotenObjectExt) { 685 o.Merge(source.(*Notification_State_NotificationState_ProviderData)) 686 } 687 688 func (o *Notification_State_NotificationState_ProviderData_Slack) GotenObjectExt() {} 689 690 func (o *Notification_State_NotificationState_ProviderData_Slack) MakeFullFieldMask() *Notification_State_NotificationState_ProviderData_Slack_FieldMask { 691 return FullNotification_State_NotificationState_ProviderData_Slack_FieldMask() 692 } 693 694 func (o *Notification_State_NotificationState_ProviderData_Slack) MakeRawFullFieldMask() gotenobject.FieldMask { 695 return FullNotification_State_NotificationState_ProviderData_Slack_FieldMask() 696 } 697 698 func (o *Notification_State_NotificationState_ProviderData_Slack) MakeDiffFieldMask(other *Notification_State_NotificationState_ProviderData_Slack) *Notification_State_NotificationState_ProviderData_Slack_FieldMask { 699 if o == nil && other == nil { 700 return &Notification_State_NotificationState_ProviderData_Slack_FieldMask{} 701 } 702 if o == nil || other == nil { 703 return FullNotification_State_NotificationState_ProviderData_Slack_FieldMask() 704 } 705 706 res := &Notification_State_NotificationState_ProviderData_Slack_FieldMask{} 707 if o.GetTs() != other.GetTs() { 708 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataSlack_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataSlack_FieldPathSelectorTs}) 709 } 710 return res 711 } 712 713 func (o *Notification_State_NotificationState_ProviderData_Slack) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 714 return o.MakeDiffFieldMask(other.(*Notification_State_NotificationState_ProviderData_Slack)) 715 } 716 717 func (o *Notification_State_NotificationState_ProviderData_Slack) Clone() *Notification_State_NotificationState_ProviderData_Slack { 718 if o == nil { 719 return nil 720 } 721 result := &Notification_State_NotificationState_ProviderData_Slack{} 722 result.Ts = o.Ts 723 return result 724 } 725 726 func (o *Notification_State_NotificationState_ProviderData_Slack) CloneRaw() gotenobject.GotenObjectExt { 727 return o.Clone() 728 } 729 730 func (o *Notification_State_NotificationState_ProviderData_Slack) Merge(source *Notification_State_NotificationState_ProviderData_Slack) { 731 o.Ts = source.GetTs() 732 } 733 734 func (o *Notification_State_NotificationState_ProviderData_Slack) MergeRaw(source gotenobject.GotenObjectExt) { 735 o.Merge(source.(*Notification_State_NotificationState_ProviderData_Slack)) 736 } 737 738 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) GotenObjectExt() {} 739 740 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) MakeFullFieldMask() *Notification_State_NotificationState_ProviderData_PagerDuty_FieldMask { 741 return FullNotification_State_NotificationState_ProviderData_PagerDuty_FieldMask() 742 } 743 744 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) MakeRawFullFieldMask() gotenobject.FieldMask { 745 return FullNotification_State_NotificationState_ProviderData_PagerDuty_FieldMask() 746 } 747 748 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) MakeDiffFieldMask(other *Notification_State_NotificationState_ProviderData_PagerDuty) *Notification_State_NotificationState_ProviderData_PagerDuty_FieldMask { 749 if o == nil && other == nil { 750 return &Notification_State_NotificationState_ProviderData_PagerDuty_FieldMask{} 751 } 752 if o == nil || other == nil { 753 return FullNotification_State_NotificationState_ProviderData_PagerDuty_FieldMask() 754 } 755 756 res := &Notification_State_NotificationState_ProviderData_PagerDuty_FieldMask{} 757 if o.GetIncidentKey() != other.GetIncidentKey() { 758 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataPagerDuty_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataPagerDuty_FieldPathSelectorIncidentKey}) 759 } 760 return res 761 } 762 763 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 764 return o.MakeDiffFieldMask(other.(*Notification_State_NotificationState_ProviderData_PagerDuty)) 765 } 766 767 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) Clone() *Notification_State_NotificationState_ProviderData_PagerDuty { 768 if o == nil { 769 return nil 770 } 771 result := &Notification_State_NotificationState_ProviderData_PagerDuty{} 772 result.IncidentKey = o.IncidentKey 773 return result 774 } 775 776 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) CloneRaw() gotenobject.GotenObjectExt { 777 return o.Clone() 778 } 779 780 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) Merge(source *Notification_State_NotificationState_ProviderData_PagerDuty) { 781 o.IncidentKey = source.GetIncidentKey() 782 } 783 784 func (o *Notification_State_NotificationState_ProviderData_PagerDuty) MergeRaw(source gotenobject.GotenObjectExt) { 785 o.Merge(source.(*Notification_State_NotificationState_ProviderData_PagerDuty)) 786 } 787 788 func (o *Notification_State_NotificationState_ProviderData_WebHook) GotenObjectExt() {} 789 790 func (o *Notification_State_NotificationState_ProviderData_WebHook) MakeFullFieldMask() *Notification_State_NotificationState_ProviderData_WebHook_FieldMask { 791 return FullNotification_State_NotificationState_ProviderData_WebHook_FieldMask() 792 } 793 794 func (o *Notification_State_NotificationState_ProviderData_WebHook) MakeRawFullFieldMask() gotenobject.FieldMask { 795 return FullNotification_State_NotificationState_ProviderData_WebHook_FieldMask() 796 } 797 798 func (o *Notification_State_NotificationState_ProviderData_WebHook) MakeDiffFieldMask(other *Notification_State_NotificationState_ProviderData_WebHook) *Notification_State_NotificationState_ProviderData_WebHook_FieldMask { 799 if o == nil && other == nil { 800 return &Notification_State_NotificationState_ProviderData_WebHook_FieldMask{} 801 } 802 if o == nil || other == nil { 803 return FullNotification_State_NotificationState_ProviderData_WebHook_FieldMask() 804 } 805 806 res := &Notification_State_NotificationState_ProviderData_WebHook_FieldMask{} 807 if o.GetTotalChunks() != other.GetTotalChunks() { 808 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataWebHook_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataWebHook_FieldPathSelectorTotalChunks}) 809 } 810 811 if len(o.GetFailedChunks()) == len(other.GetFailedChunks()) { 812 for i, lValue := range o.GetFailedChunks() { 813 rValue := other.GetFailedChunks()[i] 814 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 815 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataWebHook_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataWebHook_FieldPathSelectorFailedChunks}) 816 break 817 } 818 } 819 } else { 820 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataWebHook_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataWebHook_FieldPathSelectorFailedChunks}) 821 } 822 return res 823 } 824 825 func (o *Notification_State_NotificationState_ProviderData_WebHook) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 826 return o.MakeDiffFieldMask(other.(*Notification_State_NotificationState_ProviderData_WebHook)) 827 } 828 829 func (o *Notification_State_NotificationState_ProviderData_WebHook) Clone() *Notification_State_NotificationState_ProviderData_WebHook { 830 if o == nil { 831 return nil 832 } 833 result := &Notification_State_NotificationState_ProviderData_WebHook{} 834 result.TotalChunks = o.TotalChunks 835 result.FailedChunks = make([]*Notification_State_NotificationState_ProviderData_WebHook_FailedChunks, len(o.FailedChunks)) 836 for i, sourceValue := range o.FailedChunks { 837 result.FailedChunks[i] = sourceValue.Clone() 838 } 839 return result 840 } 841 842 func (o *Notification_State_NotificationState_ProviderData_WebHook) CloneRaw() gotenobject.GotenObjectExt { 843 return o.Clone() 844 } 845 846 func (o *Notification_State_NotificationState_ProviderData_WebHook) Merge(source *Notification_State_NotificationState_ProviderData_WebHook) { 847 o.TotalChunks = source.GetTotalChunks() 848 for _, sourceValue := range source.GetFailedChunks() { 849 exists := false 850 for _, currentValue := range o.FailedChunks { 851 if proto.Equal(sourceValue, currentValue) { 852 exists = true 853 break 854 } 855 } 856 if !exists { 857 var newDstElement *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks 858 if sourceValue != nil { 859 newDstElement = new(Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) 860 newDstElement.Merge(sourceValue) 861 } 862 o.FailedChunks = append(o.FailedChunks, newDstElement) 863 } 864 } 865 866 } 867 868 func (o *Notification_State_NotificationState_ProviderData_WebHook) MergeRaw(source gotenobject.GotenObjectExt) { 869 o.Merge(source.(*Notification_State_NotificationState_ProviderData_WebHook)) 870 } 871 872 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) GotenObjectExt() {} 873 874 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) MakeFullFieldMask() *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask { 875 return FullNotification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask() 876 } 877 878 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) MakeRawFullFieldMask() gotenobject.FieldMask { 879 return FullNotification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask() 880 } 881 882 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) MakeDiffFieldMask(other *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask { 883 if o == nil && other == nil { 884 return &Notification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask{} 885 } 886 if o == nil || other == nil { 887 return FullNotification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask() 888 } 889 890 res := &Notification_State_NotificationState_ProviderData_WebHook_FailedChunks_FieldMask{} 891 if o.GetAlertOffset() != other.GetAlertOffset() { 892 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataWebHookFailedChunks_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataWebHookFailedChunks_FieldPathSelectorAlertOffset}) 893 } 894 if o.GetError() != other.GetError() { 895 res.Paths = append(res.Paths, &NotificationStateNotificationStateProviderDataWebHookFailedChunks_FieldTerminalPath{selector: NotificationStateNotificationStateProviderDataWebHookFailedChunks_FieldPathSelectorError}) 896 } 897 return res 898 } 899 900 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 901 return o.MakeDiffFieldMask(other.(*Notification_State_NotificationState_ProviderData_WebHook_FailedChunks)) 902 } 903 904 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) Clone() *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks { 905 if o == nil { 906 return nil 907 } 908 result := &Notification_State_NotificationState_ProviderData_WebHook_FailedChunks{} 909 result.AlertOffset = o.AlertOffset 910 result.Error = o.Error 911 return result 912 } 913 914 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) CloneRaw() gotenobject.GotenObjectExt { 915 return o.Clone() 916 } 917 918 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) Merge(source *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) { 919 o.AlertOffset = source.GetAlertOffset() 920 o.Error = source.GetError() 921 } 922 923 func (o *Notification_State_NotificationState_ProviderData_WebHook_FailedChunks) MergeRaw(source gotenobject.GotenObjectExt) { 924 o.Merge(source.(*Notification_State_NotificationState_ProviderData_WebHook_FailedChunks)) 925 }