github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/common/common.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/monitoring/proto/v4/common.proto 3 // DO NOT EDIT!!! 4 5 package common 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 durationpb "google.golang.org/protobuf/types/known/durationpb" 20 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 21 ) 22 23 // ensure the imports are used 24 var ( 25 _ = new(fmt.Stringer) 26 _ = new(sort.Interface) 27 28 _ = new(proto.Message) 29 _ = googlefieldmaskpb.FieldMask{} 30 31 _ = new(gotenobject.FieldPath) 32 ) 33 34 // make sure we're using proto imports 35 var ( 36 _ = &durationpb.Duration{} 37 _ = ×tamppb.Timestamp{} 38 ) 39 40 func (o *LabelDescriptor) GotenObjectExt() {} 41 42 func (o *LabelDescriptor) MakeFullFieldMask() *LabelDescriptor_FieldMask { 43 return FullLabelDescriptor_FieldMask() 44 } 45 46 func (o *LabelDescriptor) MakeRawFullFieldMask() gotenobject.FieldMask { 47 return FullLabelDescriptor_FieldMask() 48 } 49 50 func (o *LabelDescriptor) MakeDiffFieldMask(other *LabelDescriptor) *LabelDescriptor_FieldMask { 51 if o == nil && other == nil { 52 return &LabelDescriptor_FieldMask{} 53 } 54 if o == nil || other == nil { 55 return FullLabelDescriptor_FieldMask() 56 } 57 58 res := &LabelDescriptor_FieldMask{} 59 if o.GetKey() != other.GetKey() { 60 res.Paths = append(res.Paths, &LabelDescriptor_FieldTerminalPath{selector: LabelDescriptor_FieldPathSelectorKey}) 61 } 62 if o.GetValueType() != other.GetValueType() { 63 res.Paths = append(res.Paths, &LabelDescriptor_FieldTerminalPath{selector: LabelDescriptor_FieldPathSelectorValueType}) 64 } 65 if o.GetDescription() != other.GetDescription() { 66 res.Paths = append(res.Paths, &LabelDescriptor_FieldTerminalPath{selector: LabelDescriptor_FieldPathSelectorDescription}) 67 } 68 if o.GetDefaultValue() != other.GetDefaultValue() { 69 res.Paths = append(res.Paths, &LabelDescriptor_FieldTerminalPath{selector: LabelDescriptor_FieldPathSelectorDefaultValue}) 70 } 71 if o.GetDisabled() != other.GetDisabled() { 72 res.Paths = append(res.Paths, &LabelDescriptor_FieldTerminalPath{selector: LabelDescriptor_FieldPathSelectorDisabled}) 73 } 74 return res 75 } 76 77 func (o *LabelDescriptor) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 78 return o.MakeDiffFieldMask(other.(*LabelDescriptor)) 79 } 80 81 func (o *LabelDescriptor) Clone() *LabelDescriptor { 82 if o == nil { 83 return nil 84 } 85 result := &LabelDescriptor{} 86 result.Key = o.Key 87 result.ValueType = o.ValueType 88 result.Description = o.Description 89 result.DefaultValue = o.DefaultValue 90 result.Disabled = o.Disabled 91 return result 92 } 93 94 func (o *LabelDescriptor) CloneRaw() gotenobject.GotenObjectExt { 95 return o.Clone() 96 } 97 98 func (o *LabelDescriptor) Merge(source *LabelDescriptor) { 99 o.Key = source.GetKey() 100 o.ValueType = source.GetValueType() 101 o.Description = source.GetDescription() 102 o.DefaultValue = source.GetDefaultValue() 103 o.Disabled = source.GetDisabled() 104 } 105 106 func (o *LabelDescriptor) MergeRaw(source gotenobject.GotenObjectExt) { 107 o.Merge(source.(*LabelDescriptor)) 108 } 109 110 func (o *LabelKeySet) GotenObjectExt() {} 111 112 func (o *LabelKeySet) MakeFullFieldMask() *LabelKeySet_FieldMask { 113 return FullLabelKeySet_FieldMask() 114 } 115 116 func (o *LabelKeySet) MakeRawFullFieldMask() gotenobject.FieldMask { 117 return FullLabelKeySet_FieldMask() 118 } 119 120 func (o *LabelKeySet) MakeDiffFieldMask(other *LabelKeySet) *LabelKeySet_FieldMask { 121 if o == nil && other == nil { 122 return &LabelKeySet_FieldMask{} 123 } 124 if o == nil || other == nil { 125 return FullLabelKeySet_FieldMask() 126 } 127 128 res := &LabelKeySet_FieldMask{} 129 130 if len(o.GetLabelKeys()) == len(other.GetLabelKeys()) { 131 for i, lValue := range o.GetLabelKeys() { 132 rValue := other.GetLabelKeys()[i] 133 if lValue != rValue { 134 res.Paths = append(res.Paths, &LabelKeySet_FieldTerminalPath{selector: LabelKeySet_FieldPathSelectorLabelKeys}) 135 break 136 } 137 } 138 } else { 139 res.Paths = append(res.Paths, &LabelKeySet_FieldTerminalPath{selector: LabelKeySet_FieldPathSelectorLabelKeys}) 140 } 141 return res 142 } 143 144 func (o *LabelKeySet) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 145 return o.MakeDiffFieldMask(other.(*LabelKeySet)) 146 } 147 148 func (o *LabelKeySet) Clone() *LabelKeySet { 149 if o == nil { 150 return nil 151 } 152 result := &LabelKeySet{} 153 result.LabelKeys = make([]string, len(o.LabelKeys)) 154 for i, sourceValue := range o.LabelKeys { 155 result.LabelKeys[i] = sourceValue 156 } 157 return result 158 } 159 160 func (o *LabelKeySet) CloneRaw() gotenobject.GotenObjectExt { 161 return o.Clone() 162 } 163 164 func (o *LabelKeySet) Merge(source *LabelKeySet) { 165 for _, sourceValue := range source.GetLabelKeys() { 166 exists := false 167 for _, currentValue := range o.LabelKeys { 168 if currentValue == sourceValue { 169 exists = true 170 break 171 } 172 } 173 if !exists { 174 var newDstElement string 175 newDstElement = sourceValue 176 o.LabelKeys = append(o.LabelKeys, newDstElement) 177 } 178 } 179 180 } 181 182 func (o *LabelKeySet) MergeRaw(source gotenobject.GotenObjectExt) { 183 o.Merge(source.(*LabelKeySet)) 184 } 185 186 func (o *Distribution) GotenObjectExt() {} 187 188 func (o *Distribution) MakeFullFieldMask() *Distribution_FieldMask { 189 return FullDistribution_FieldMask() 190 } 191 192 func (o *Distribution) MakeRawFullFieldMask() gotenobject.FieldMask { 193 return FullDistribution_FieldMask() 194 } 195 196 func (o *Distribution) MakeDiffFieldMask(other *Distribution) *Distribution_FieldMask { 197 if o == nil && other == nil { 198 return &Distribution_FieldMask{} 199 } 200 if o == nil || other == nil { 201 return FullDistribution_FieldMask() 202 } 203 204 res := &Distribution_FieldMask{} 205 if o.GetCount() != other.GetCount() { 206 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorCount}) 207 } 208 if o.GetMean() != other.GetMean() { 209 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorMean}) 210 } 211 if o.GetSumOfSquaredDeviation() != other.GetSumOfSquaredDeviation() { 212 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorSumOfSquaredDeviation}) 213 } 214 { 215 subMask := o.GetRange().MakeDiffFieldMask(other.GetRange()) 216 if subMask.IsFull() { 217 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorRange}) 218 } else { 219 for _, subpath := range subMask.Paths { 220 res.Paths = append(res.Paths, &Distribution_FieldSubPath{selector: Distribution_FieldPathSelectorRange, subPath: subpath}) 221 } 222 } 223 } 224 { 225 subMask := o.GetBucketOptions().MakeDiffFieldMask(other.GetBucketOptions()) 226 if subMask.IsFull() { 227 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorBucketOptions}) 228 } else { 229 for _, subpath := range subMask.Paths { 230 res.Paths = append(res.Paths, &Distribution_FieldSubPath{selector: Distribution_FieldPathSelectorBucketOptions, subPath: subpath}) 231 } 232 } 233 } 234 235 if len(o.GetBucketCounts()) == len(other.GetBucketCounts()) { 236 for i, lValue := range o.GetBucketCounts() { 237 rValue := other.GetBucketCounts()[i] 238 if lValue != rValue { 239 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorBucketCounts}) 240 break 241 } 242 } 243 } else { 244 res.Paths = append(res.Paths, &Distribution_FieldTerminalPath{selector: Distribution_FieldPathSelectorBucketCounts}) 245 } 246 return res 247 } 248 249 func (o *Distribution) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 250 return o.MakeDiffFieldMask(other.(*Distribution)) 251 } 252 253 func (o *Distribution) Clone() *Distribution { 254 if o == nil { 255 return nil 256 } 257 result := &Distribution{} 258 result.Count = o.Count 259 result.Mean = o.Mean 260 result.SumOfSquaredDeviation = o.SumOfSquaredDeviation 261 result.Range = o.Range.Clone() 262 result.BucketOptions = o.BucketOptions.Clone() 263 result.BucketCounts = make([]int64, len(o.BucketCounts)) 264 for i, sourceValue := range o.BucketCounts { 265 result.BucketCounts[i] = sourceValue 266 } 267 return result 268 } 269 270 func (o *Distribution) CloneRaw() gotenobject.GotenObjectExt { 271 return o.Clone() 272 } 273 274 func (o *Distribution) Merge(source *Distribution) { 275 o.Count = source.GetCount() 276 o.Mean = source.GetMean() 277 o.SumOfSquaredDeviation = source.GetSumOfSquaredDeviation() 278 if source.GetRange() != nil { 279 if o.Range == nil { 280 o.Range = new(Distribution_Range) 281 } 282 o.Range.Merge(source.GetRange()) 283 } 284 if source.GetBucketOptions() != nil { 285 if o.BucketOptions == nil { 286 o.BucketOptions = new(Distribution_BucketOptions) 287 } 288 o.BucketOptions.Merge(source.GetBucketOptions()) 289 } 290 for _, sourceValue := range source.GetBucketCounts() { 291 exists := false 292 for _, currentValue := range o.BucketCounts { 293 if currentValue == sourceValue { 294 exists = true 295 break 296 } 297 } 298 if !exists { 299 var newDstElement int64 300 newDstElement = sourceValue 301 o.BucketCounts = append(o.BucketCounts, newDstElement) 302 } 303 } 304 305 } 306 307 func (o *Distribution) MergeRaw(source gotenobject.GotenObjectExt) { 308 o.Merge(source.(*Distribution)) 309 } 310 311 func (o *Distribution_Range) GotenObjectExt() {} 312 313 func (o *Distribution_Range) MakeFullFieldMask() *Distribution_Range_FieldMask { 314 return FullDistribution_Range_FieldMask() 315 } 316 317 func (o *Distribution_Range) MakeRawFullFieldMask() gotenobject.FieldMask { 318 return FullDistribution_Range_FieldMask() 319 } 320 321 func (o *Distribution_Range) MakeDiffFieldMask(other *Distribution_Range) *Distribution_Range_FieldMask { 322 if o == nil && other == nil { 323 return &Distribution_Range_FieldMask{} 324 } 325 if o == nil || other == nil { 326 return FullDistribution_Range_FieldMask() 327 } 328 329 res := &Distribution_Range_FieldMask{} 330 if o.GetMin() != other.GetMin() { 331 res.Paths = append(res.Paths, &DistributionRange_FieldTerminalPath{selector: DistributionRange_FieldPathSelectorMin}) 332 } 333 if o.GetMax() != other.GetMax() { 334 res.Paths = append(res.Paths, &DistributionRange_FieldTerminalPath{selector: DistributionRange_FieldPathSelectorMax}) 335 } 336 return res 337 } 338 339 func (o *Distribution_Range) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 340 return o.MakeDiffFieldMask(other.(*Distribution_Range)) 341 } 342 343 func (o *Distribution_Range) Clone() *Distribution_Range { 344 if o == nil { 345 return nil 346 } 347 result := &Distribution_Range{} 348 result.Min = o.Min 349 result.Max = o.Max 350 return result 351 } 352 353 func (o *Distribution_Range) CloneRaw() gotenobject.GotenObjectExt { 354 return o.Clone() 355 } 356 357 func (o *Distribution_Range) Merge(source *Distribution_Range) { 358 o.Min = source.GetMin() 359 o.Max = source.GetMax() 360 } 361 362 func (o *Distribution_Range) MergeRaw(source gotenobject.GotenObjectExt) { 363 o.Merge(source.(*Distribution_Range)) 364 } 365 366 func (o *Distribution_BucketOptions) GotenObjectExt() {} 367 368 func (o *Distribution_BucketOptions) MakeFullFieldMask() *Distribution_BucketOptions_FieldMask { 369 return FullDistribution_BucketOptions_FieldMask() 370 } 371 372 func (o *Distribution_BucketOptions) MakeRawFullFieldMask() gotenobject.FieldMask { 373 return FullDistribution_BucketOptions_FieldMask() 374 } 375 376 func (o *Distribution_BucketOptions) MakeDiffFieldMask(other *Distribution_BucketOptions) *Distribution_BucketOptions_FieldMask { 377 if o == nil && other == nil { 378 return &Distribution_BucketOptions_FieldMask{} 379 } 380 if o == nil || other == nil { 381 return FullDistribution_BucketOptions_FieldMask() 382 } 383 384 res := &Distribution_BucketOptions_FieldMask{} 385 { 386 _, leftSelected := o.Options.(*Distribution_BucketOptions_LinearBuckets) 387 _, rightSelected := other.Options.(*Distribution_BucketOptions_LinearBuckets) 388 if leftSelected == rightSelected { 389 subMask := o.GetLinearBuckets().MakeDiffFieldMask(other.GetLinearBuckets()) 390 if subMask.IsFull() { 391 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorLinearBuckets}) 392 } else { 393 for _, subpath := range subMask.Paths { 394 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldSubPath{selector: DistributionBucketOptions_FieldPathSelectorLinearBuckets, subPath: subpath}) 395 } 396 } 397 } else { 398 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorLinearBuckets}) 399 } 400 } 401 { 402 _, leftSelected := o.Options.(*Distribution_BucketOptions_ExponentialBuckets) 403 _, rightSelected := other.Options.(*Distribution_BucketOptions_ExponentialBuckets) 404 if leftSelected == rightSelected { 405 subMask := o.GetExponentialBuckets().MakeDiffFieldMask(other.GetExponentialBuckets()) 406 if subMask.IsFull() { 407 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorExponentialBuckets}) 408 } else { 409 for _, subpath := range subMask.Paths { 410 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldSubPath{selector: DistributionBucketOptions_FieldPathSelectorExponentialBuckets, subPath: subpath}) 411 } 412 } 413 } else { 414 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorExponentialBuckets}) 415 } 416 } 417 { 418 _, leftSelected := o.Options.(*Distribution_BucketOptions_ExplicitBuckets) 419 _, rightSelected := other.Options.(*Distribution_BucketOptions_ExplicitBuckets) 420 if leftSelected == rightSelected { 421 subMask := o.GetExplicitBuckets().MakeDiffFieldMask(other.GetExplicitBuckets()) 422 if subMask.IsFull() { 423 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorExplicitBuckets}) 424 } else { 425 for _, subpath := range subMask.Paths { 426 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldSubPath{selector: DistributionBucketOptions_FieldPathSelectorExplicitBuckets, subPath: subpath}) 427 } 428 } 429 } else { 430 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorExplicitBuckets}) 431 } 432 } 433 { 434 _, leftSelected := o.Options.(*Distribution_BucketOptions_DynamicBuckets) 435 _, rightSelected := other.Options.(*Distribution_BucketOptions_DynamicBuckets) 436 if leftSelected == rightSelected { 437 subMask := o.GetDynamicBuckets().MakeDiffFieldMask(other.GetDynamicBuckets()) 438 if subMask.IsFull() { 439 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorDynamicBuckets}) 440 } else { 441 for _, subpath := range subMask.Paths { 442 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldSubPath{selector: DistributionBucketOptions_FieldPathSelectorDynamicBuckets, subPath: subpath}) 443 } 444 } 445 } else { 446 res.Paths = append(res.Paths, &DistributionBucketOptions_FieldTerminalPath{selector: DistributionBucketOptions_FieldPathSelectorDynamicBuckets}) 447 } 448 } 449 return res 450 } 451 452 func (o *Distribution_BucketOptions) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 453 return o.MakeDiffFieldMask(other.(*Distribution_BucketOptions)) 454 } 455 456 func (o *Distribution_BucketOptions) Clone() *Distribution_BucketOptions { 457 if o == nil { 458 return nil 459 } 460 result := &Distribution_BucketOptions{} 461 if o, ok := o.Options.(*Distribution_BucketOptions_LinearBuckets); ok { 462 result.Options = (*Distribution_BucketOptions_LinearBuckets)(nil) 463 if o != nil { 464 result.Options = &Distribution_BucketOptions_LinearBuckets{} 465 result := result.Options.(*Distribution_BucketOptions_LinearBuckets) 466 result.LinearBuckets = o.LinearBuckets.Clone() 467 } 468 } 469 if o, ok := o.Options.(*Distribution_BucketOptions_ExponentialBuckets); ok { 470 result.Options = (*Distribution_BucketOptions_ExponentialBuckets)(nil) 471 if o != nil { 472 result.Options = &Distribution_BucketOptions_ExponentialBuckets{} 473 result := result.Options.(*Distribution_BucketOptions_ExponentialBuckets) 474 result.ExponentialBuckets = o.ExponentialBuckets.Clone() 475 } 476 } 477 if o, ok := o.Options.(*Distribution_BucketOptions_ExplicitBuckets); ok { 478 result.Options = (*Distribution_BucketOptions_ExplicitBuckets)(nil) 479 if o != nil { 480 result.Options = &Distribution_BucketOptions_ExplicitBuckets{} 481 result := result.Options.(*Distribution_BucketOptions_ExplicitBuckets) 482 result.ExplicitBuckets = o.ExplicitBuckets.Clone() 483 } 484 } 485 if o, ok := o.Options.(*Distribution_BucketOptions_DynamicBuckets); ok { 486 result.Options = (*Distribution_BucketOptions_DynamicBuckets)(nil) 487 if o != nil { 488 result.Options = &Distribution_BucketOptions_DynamicBuckets{} 489 result := result.Options.(*Distribution_BucketOptions_DynamicBuckets) 490 result.DynamicBuckets = o.DynamicBuckets.Clone() 491 } 492 } 493 return result 494 } 495 496 func (o *Distribution_BucketOptions) CloneRaw() gotenobject.GotenObjectExt { 497 return o.Clone() 498 } 499 500 func (o *Distribution_BucketOptions) Merge(source *Distribution_BucketOptions) { 501 if source, ok := source.GetOptions().(*Distribution_BucketOptions_LinearBuckets); ok { 502 if dstOneOf, ok := o.Options.(*Distribution_BucketOptions_LinearBuckets); !ok || dstOneOf == nil { 503 o.Options = &Distribution_BucketOptions_LinearBuckets{} 504 } 505 if source != nil { 506 o := o.Options.(*Distribution_BucketOptions_LinearBuckets) 507 if source.LinearBuckets != nil { 508 if o.LinearBuckets == nil { 509 o.LinearBuckets = new(Distribution_BucketOptions_Linear) 510 } 511 o.LinearBuckets.Merge(source.LinearBuckets) 512 } 513 } 514 } 515 if source, ok := source.GetOptions().(*Distribution_BucketOptions_ExponentialBuckets); ok { 516 if dstOneOf, ok := o.Options.(*Distribution_BucketOptions_ExponentialBuckets); !ok || dstOneOf == nil { 517 o.Options = &Distribution_BucketOptions_ExponentialBuckets{} 518 } 519 if source != nil { 520 o := o.Options.(*Distribution_BucketOptions_ExponentialBuckets) 521 if source.ExponentialBuckets != nil { 522 if o.ExponentialBuckets == nil { 523 o.ExponentialBuckets = new(Distribution_BucketOptions_Exponential) 524 } 525 o.ExponentialBuckets.Merge(source.ExponentialBuckets) 526 } 527 } 528 } 529 if source, ok := source.GetOptions().(*Distribution_BucketOptions_ExplicitBuckets); ok { 530 if dstOneOf, ok := o.Options.(*Distribution_BucketOptions_ExplicitBuckets); !ok || dstOneOf == nil { 531 o.Options = &Distribution_BucketOptions_ExplicitBuckets{} 532 } 533 if source != nil { 534 o := o.Options.(*Distribution_BucketOptions_ExplicitBuckets) 535 if source.ExplicitBuckets != nil { 536 if o.ExplicitBuckets == nil { 537 o.ExplicitBuckets = new(Distribution_BucketOptions_Explicit) 538 } 539 o.ExplicitBuckets.Merge(source.ExplicitBuckets) 540 } 541 } 542 } 543 if source, ok := source.GetOptions().(*Distribution_BucketOptions_DynamicBuckets); ok { 544 if dstOneOf, ok := o.Options.(*Distribution_BucketOptions_DynamicBuckets); !ok || dstOneOf == nil { 545 o.Options = &Distribution_BucketOptions_DynamicBuckets{} 546 } 547 if source != nil { 548 o := o.Options.(*Distribution_BucketOptions_DynamicBuckets) 549 if source.DynamicBuckets != nil { 550 if o.DynamicBuckets == nil { 551 o.DynamicBuckets = new(Distribution_BucketOptions_Dynamic) 552 } 553 o.DynamicBuckets.Merge(source.DynamicBuckets) 554 } 555 } 556 } 557 } 558 559 func (o *Distribution_BucketOptions) MergeRaw(source gotenobject.GotenObjectExt) { 560 o.Merge(source.(*Distribution_BucketOptions)) 561 } 562 563 func (o *Distribution_BucketOptions_Linear) GotenObjectExt() {} 564 565 func (o *Distribution_BucketOptions_Linear) MakeFullFieldMask() *Distribution_BucketOptions_Linear_FieldMask { 566 return FullDistribution_BucketOptions_Linear_FieldMask() 567 } 568 569 func (o *Distribution_BucketOptions_Linear) MakeRawFullFieldMask() gotenobject.FieldMask { 570 return FullDistribution_BucketOptions_Linear_FieldMask() 571 } 572 573 func (o *Distribution_BucketOptions_Linear) MakeDiffFieldMask(other *Distribution_BucketOptions_Linear) *Distribution_BucketOptions_Linear_FieldMask { 574 if o == nil && other == nil { 575 return &Distribution_BucketOptions_Linear_FieldMask{} 576 } 577 if o == nil || other == nil { 578 return FullDistribution_BucketOptions_Linear_FieldMask() 579 } 580 581 res := &Distribution_BucketOptions_Linear_FieldMask{} 582 if o.GetNumFiniteBuckets() != other.GetNumFiniteBuckets() { 583 res.Paths = append(res.Paths, &DistributionBucketOptionsLinear_FieldTerminalPath{selector: DistributionBucketOptionsLinear_FieldPathSelectorNumFiniteBuckets}) 584 } 585 if o.GetWidth() != other.GetWidth() { 586 res.Paths = append(res.Paths, &DistributionBucketOptionsLinear_FieldTerminalPath{selector: DistributionBucketOptionsLinear_FieldPathSelectorWidth}) 587 } 588 if o.GetOffset() != other.GetOffset() { 589 res.Paths = append(res.Paths, &DistributionBucketOptionsLinear_FieldTerminalPath{selector: DistributionBucketOptionsLinear_FieldPathSelectorOffset}) 590 } 591 return res 592 } 593 594 func (o *Distribution_BucketOptions_Linear) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 595 return o.MakeDiffFieldMask(other.(*Distribution_BucketOptions_Linear)) 596 } 597 598 func (o *Distribution_BucketOptions_Linear) Clone() *Distribution_BucketOptions_Linear { 599 if o == nil { 600 return nil 601 } 602 result := &Distribution_BucketOptions_Linear{} 603 result.NumFiniteBuckets = o.NumFiniteBuckets 604 result.Width = o.Width 605 result.Offset = o.Offset 606 return result 607 } 608 609 func (o *Distribution_BucketOptions_Linear) CloneRaw() gotenobject.GotenObjectExt { 610 return o.Clone() 611 } 612 613 func (o *Distribution_BucketOptions_Linear) Merge(source *Distribution_BucketOptions_Linear) { 614 o.NumFiniteBuckets = source.GetNumFiniteBuckets() 615 o.Width = source.GetWidth() 616 o.Offset = source.GetOffset() 617 } 618 619 func (o *Distribution_BucketOptions_Linear) MergeRaw(source gotenobject.GotenObjectExt) { 620 o.Merge(source.(*Distribution_BucketOptions_Linear)) 621 } 622 623 func (o *Distribution_BucketOptions_Exponential) GotenObjectExt() {} 624 625 func (o *Distribution_BucketOptions_Exponential) MakeFullFieldMask() *Distribution_BucketOptions_Exponential_FieldMask { 626 return FullDistribution_BucketOptions_Exponential_FieldMask() 627 } 628 629 func (o *Distribution_BucketOptions_Exponential) MakeRawFullFieldMask() gotenobject.FieldMask { 630 return FullDistribution_BucketOptions_Exponential_FieldMask() 631 } 632 633 func (o *Distribution_BucketOptions_Exponential) MakeDiffFieldMask(other *Distribution_BucketOptions_Exponential) *Distribution_BucketOptions_Exponential_FieldMask { 634 if o == nil && other == nil { 635 return &Distribution_BucketOptions_Exponential_FieldMask{} 636 } 637 if o == nil || other == nil { 638 return FullDistribution_BucketOptions_Exponential_FieldMask() 639 } 640 641 res := &Distribution_BucketOptions_Exponential_FieldMask{} 642 if o.GetNumFiniteBuckets() != other.GetNumFiniteBuckets() { 643 res.Paths = append(res.Paths, &DistributionBucketOptionsExponential_FieldTerminalPath{selector: DistributionBucketOptionsExponential_FieldPathSelectorNumFiniteBuckets}) 644 } 645 if o.GetGrowthFactor() != other.GetGrowthFactor() { 646 res.Paths = append(res.Paths, &DistributionBucketOptionsExponential_FieldTerminalPath{selector: DistributionBucketOptionsExponential_FieldPathSelectorGrowthFactor}) 647 } 648 if o.GetScale() != other.GetScale() { 649 res.Paths = append(res.Paths, &DistributionBucketOptionsExponential_FieldTerminalPath{selector: DistributionBucketOptionsExponential_FieldPathSelectorScale}) 650 } 651 return res 652 } 653 654 func (o *Distribution_BucketOptions_Exponential) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 655 return o.MakeDiffFieldMask(other.(*Distribution_BucketOptions_Exponential)) 656 } 657 658 func (o *Distribution_BucketOptions_Exponential) Clone() *Distribution_BucketOptions_Exponential { 659 if o == nil { 660 return nil 661 } 662 result := &Distribution_BucketOptions_Exponential{} 663 result.NumFiniteBuckets = o.NumFiniteBuckets 664 result.GrowthFactor = o.GrowthFactor 665 result.Scale = o.Scale 666 return result 667 } 668 669 func (o *Distribution_BucketOptions_Exponential) CloneRaw() gotenobject.GotenObjectExt { 670 return o.Clone() 671 } 672 673 func (o *Distribution_BucketOptions_Exponential) Merge(source *Distribution_BucketOptions_Exponential) { 674 o.NumFiniteBuckets = source.GetNumFiniteBuckets() 675 o.GrowthFactor = source.GetGrowthFactor() 676 o.Scale = source.GetScale() 677 } 678 679 func (o *Distribution_BucketOptions_Exponential) MergeRaw(source gotenobject.GotenObjectExt) { 680 o.Merge(source.(*Distribution_BucketOptions_Exponential)) 681 } 682 683 func (o *Distribution_BucketOptions_Explicit) GotenObjectExt() {} 684 685 func (o *Distribution_BucketOptions_Explicit) MakeFullFieldMask() *Distribution_BucketOptions_Explicit_FieldMask { 686 return FullDistribution_BucketOptions_Explicit_FieldMask() 687 } 688 689 func (o *Distribution_BucketOptions_Explicit) MakeRawFullFieldMask() gotenobject.FieldMask { 690 return FullDistribution_BucketOptions_Explicit_FieldMask() 691 } 692 693 func (o *Distribution_BucketOptions_Explicit) MakeDiffFieldMask(other *Distribution_BucketOptions_Explicit) *Distribution_BucketOptions_Explicit_FieldMask { 694 if o == nil && other == nil { 695 return &Distribution_BucketOptions_Explicit_FieldMask{} 696 } 697 if o == nil || other == nil { 698 return FullDistribution_BucketOptions_Explicit_FieldMask() 699 } 700 701 res := &Distribution_BucketOptions_Explicit_FieldMask{} 702 703 if len(o.GetBounds()) == len(other.GetBounds()) { 704 for i, lValue := range o.GetBounds() { 705 rValue := other.GetBounds()[i] 706 if lValue != rValue { 707 res.Paths = append(res.Paths, &DistributionBucketOptionsExplicit_FieldTerminalPath{selector: DistributionBucketOptionsExplicit_FieldPathSelectorBounds}) 708 break 709 } 710 } 711 } else { 712 res.Paths = append(res.Paths, &DistributionBucketOptionsExplicit_FieldTerminalPath{selector: DistributionBucketOptionsExplicit_FieldPathSelectorBounds}) 713 } 714 return res 715 } 716 717 func (o *Distribution_BucketOptions_Explicit) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 718 return o.MakeDiffFieldMask(other.(*Distribution_BucketOptions_Explicit)) 719 } 720 721 func (o *Distribution_BucketOptions_Explicit) Clone() *Distribution_BucketOptions_Explicit { 722 if o == nil { 723 return nil 724 } 725 result := &Distribution_BucketOptions_Explicit{} 726 result.Bounds = make([]float64, len(o.Bounds)) 727 for i, sourceValue := range o.Bounds { 728 result.Bounds[i] = sourceValue 729 } 730 return result 731 } 732 733 func (o *Distribution_BucketOptions_Explicit) CloneRaw() gotenobject.GotenObjectExt { 734 return o.Clone() 735 } 736 737 func (o *Distribution_BucketOptions_Explicit) Merge(source *Distribution_BucketOptions_Explicit) { 738 for _, sourceValue := range source.GetBounds() { 739 exists := false 740 for _, currentValue := range o.Bounds { 741 if currentValue == sourceValue { 742 exists = true 743 break 744 } 745 } 746 if !exists { 747 var newDstElement float64 748 newDstElement = sourceValue 749 o.Bounds = append(o.Bounds, newDstElement) 750 } 751 } 752 753 } 754 755 func (o *Distribution_BucketOptions_Explicit) MergeRaw(source gotenobject.GotenObjectExt) { 756 o.Merge(source.(*Distribution_BucketOptions_Explicit)) 757 } 758 759 func (o *Distribution_BucketOptions_Dynamic) GotenObjectExt() {} 760 761 func (o *Distribution_BucketOptions_Dynamic) MakeFullFieldMask() *Distribution_BucketOptions_Dynamic_FieldMask { 762 return FullDistribution_BucketOptions_Dynamic_FieldMask() 763 } 764 765 func (o *Distribution_BucketOptions_Dynamic) MakeRawFullFieldMask() gotenobject.FieldMask { 766 return FullDistribution_BucketOptions_Dynamic_FieldMask() 767 } 768 769 func (o *Distribution_BucketOptions_Dynamic) MakeDiffFieldMask(other *Distribution_BucketOptions_Dynamic) *Distribution_BucketOptions_Dynamic_FieldMask { 770 if o == nil && other == nil { 771 return &Distribution_BucketOptions_Dynamic_FieldMask{} 772 } 773 if o == nil || other == nil { 774 return FullDistribution_BucketOptions_Dynamic_FieldMask() 775 } 776 777 res := &Distribution_BucketOptions_Dynamic_FieldMask{} 778 if o.GetCompression() != other.GetCompression() { 779 res.Paths = append(res.Paths, &DistributionBucketOptionsDynamic_FieldTerminalPath{selector: DistributionBucketOptionsDynamic_FieldPathSelectorCompression}) 780 } 781 782 if len(o.GetMeans()) == len(other.GetMeans()) { 783 for i, lValue := range o.GetMeans() { 784 rValue := other.GetMeans()[i] 785 if lValue != rValue { 786 res.Paths = append(res.Paths, &DistributionBucketOptionsDynamic_FieldTerminalPath{selector: DistributionBucketOptionsDynamic_FieldPathSelectorMeans}) 787 break 788 } 789 } 790 } else { 791 res.Paths = append(res.Paths, &DistributionBucketOptionsDynamic_FieldTerminalPath{selector: DistributionBucketOptionsDynamic_FieldPathSelectorMeans}) 792 } 793 return res 794 } 795 796 func (o *Distribution_BucketOptions_Dynamic) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 797 return o.MakeDiffFieldMask(other.(*Distribution_BucketOptions_Dynamic)) 798 } 799 800 func (o *Distribution_BucketOptions_Dynamic) Clone() *Distribution_BucketOptions_Dynamic { 801 if o == nil { 802 return nil 803 } 804 result := &Distribution_BucketOptions_Dynamic{} 805 result.Compression = o.Compression 806 result.Means = make([]float64, len(o.Means)) 807 for i, sourceValue := range o.Means { 808 result.Means[i] = sourceValue 809 } 810 return result 811 } 812 813 func (o *Distribution_BucketOptions_Dynamic) CloneRaw() gotenobject.GotenObjectExt { 814 return o.Clone() 815 } 816 817 func (o *Distribution_BucketOptions_Dynamic) Merge(source *Distribution_BucketOptions_Dynamic) { 818 o.Compression = source.GetCompression() 819 for _, sourceValue := range source.GetMeans() { 820 exists := false 821 for _, currentValue := range o.Means { 822 if currentValue == sourceValue { 823 exists = true 824 break 825 } 826 } 827 if !exists { 828 var newDstElement float64 829 newDstElement = sourceValue 830 o.Means = append(o.Means, newDstElement) 831 } 832 } 833 834 } 835 836 func (o *Distribution_BucketOptions_Dynamic) MergeRaw(source gotenobject.GotenObjectExt) { 837 o.Merge(source.(*Distribution_BucketOptions_Dynamic)) 838 } 839 840 func (o *TypedValue) GotenObjectExt() {} 841 842 func (o *TypedValue) MakeFullFieldMask() *TypedValue_FieldMask { 843 return FullTypedValue_FieldMask() 844 } 845 846 func (o *TypedValue) MakeRawFullFieldMask() gotenobject.FieldMask { 847 return FullTypedValue_FieldMask() 848 } 849 850 func (o *TypedValue) MakeDiffFieldMask(other *TypedValue) *TypedValue_FieldMask { 851 if o == nil && other == nil { 852 return &TypedValue_FieldMask{} 853 } 854 if o == nil || other == nil { 855 return FullTypedValue_FieldMask() 856 } 857 858 res := &TypedValue_FieldMask{} 859 { 860 _, leftSelected := o.Value.(*TypedValue_BoolValue) 861 _, rightSelected := other.Value.(*TypedValue_BoolValue) 862 if leftSelected == rightSelected { 863 if o.GetBoolValue() != other.GetBoolValue() { 864 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorBoolValue}) 865 } 866 } else { 867 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorBoolValue}) 868 } 869 } 870 { 871 _, leftSelected := o.Value.(*TypedValue_Int64Value) 872 _, rightSelected := other.Value.(*TypedValue_Int64Value) 873 if leftSelected == rightSelected { 874 if o.GetInt64Value() != other.GetInt64Value() { 875 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorInt64Value}) 876 } 877 } else { 878 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorInt64Value}) 879 } 880 } 881 { 882 _, leftSelected := o.Value.(*TypedValue_DoubleValue) 883 _, rightSelected := other.Value.(*TypedValue_DoubleValue) 884 if leftSelected == rightSelected { 885 if o.GetDoubleValue() != other.GetDoubleValue() { 886 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorDoubleValue}) 887 } 888 } else { 889 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorDoubleValue}) 890 } 891 } 892 { 893 _, leftSelected := o.Value.(*TypedValue_StringValue) 894 _, rightSelected := other.Value.(*TypedValue_StringValue) 895 if leftSelected == rightSelected { 896 if o.GetStringValue() != other.GetStringValue() { 897 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorStringValue}) 898 } 899 } else { 900 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorStringValue}) 901 } 902 } 903 { 904 _, leftSelected := o.Value.(*TypedValue_DistributionValue) 905 _, rightSelected := other.Value.(*TypedValue_DistributionValue) 906 if leftSelected == rightSelected { 907 subMask := o.GetDistributionValue().MakeDiffFieldMask(other.GetDistributionValue()) 908 if subMask.IsFull() { 909 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorDistributionValue}) 910 } else { 911 for _, subpath := range subMask.Paths { 912 res.Paths = append(res.Paths, &TypedValue_FieldSubPath{selector: TypedValue_FieldPathSelectorDistributionValue, subPath: subpath}) 913 } 914 } 915 } else { 916 res.Paths = append(res.Paths, &TypedValue_FieldTerminalPath{selector: TypedValue_FieldPathSelectorDistributionValue}) 917 } 918 } 919 return res 920 } 921 922 func (o *TypedValue) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 923 return o.MakeDiffFieldMask(other.(*TypedValue)) 924 } 925 926 func (o *TypedValue) Clone() *TypedValue { 927 if o == nil { 928 return nil 929 } 930 result := &TypedValue{} 931 if o, ok := o.Value.(*TypedValue_BoolValue); ok { 932 result.Value = (*TypedValue_BoolValue)(nil) 933 if o != nil { 934 result.Value = &TypedValue_BoolValue{} 935 result := result.Value.(*TypedValue_BoolValue) 936 result.BoolValue = o.BoolValue 937 } 938 } 939 if o, ok := o.Value.(*TypedValue_Int64Value); ok { 940 result.Value = (*TypedValue_Int64Value)(nil) 941 if o != nil { 942 result.Value = &TypedValue_Int64Value{} 943 result := result.Value.(*TypedValue_Int64Value) 944 result.Int64Value = o.Int64Value 945 } 946 } 947 if o, ok := o.Value.(*TypedValue_DoubleValue); ok { 948 result.Value = (*TypedValue_DoubleValue)(nil) 949 if o != nil { 950 result.Value = &TypedValue_DoubleValue{} 951 result := result.Value.(*TypedValue_DoubleValue) 952 result.DoubleValue = o.DoubleValue 953 } 954 } 955 if o, ok := o.Value.(*TypedValue_StringValue); ok { 956 result.Value = (*TypedValue_StringValue)(nil) 957 if o != nil { 958 result.Value = &TypedValue_StringValue{} 959 result := result.Value.(*TypedValue_StringValue) 960 result.StringValue = o.StringValue 961 } 962 } 963 if o, ok := o.Value.(*TypedValue_DistributionValue); ok { 964 result.Value = (*TypedValue_DistributionValue)(nil) 965 if o != nil { 966 result.Value = &TypedValue_DistributionValue{} 967 result := result.Value.(*TypedValue_DistributionValue) 968 result.DistributionValue = o.DistributionValue.Clone() 969 } 970 } 971 return result 972 } 973 974 func (o *TypedValue) CloneRaw() gotenobject.GotenObjectExt { 975 return o.Clone() 976 } 977 978 func (o *TypedValue) Merge(source *TypedValue) { 979 if source, ok := source.GetValue().(*TypedValue_BoolValue); ok { 980 if dstOneOf, ok := o.Value.(*TypedValue_BoolValue); !ok || dstOneOf == nil { 981 o.Value = &TypedValue_BoolValue{} 982 } 983 if source != nil { 984 o := o.Value.(*TypedValue_BoolValue) 985 o.BoolValue = source.BoolValue 986 } 987 } 988 if source, ok := source.GetValue().(*TypedValue_Int64Value); ok { 989 if dstOneOf, ok := o.Value.(*TypedValue_Int64Value); !ok || dstOneOf == nil { 990 o.Value = &TypedValue_Int64Value{} 991 } 992 if source != nil { 993 o := o.Value.(*TypedValue_Int64Value) 994 o.Int64Value = source.Int64Value 995 } 996 } 997 if source, ok := source.GetValue().(*TypedValue_DoubleValue); ok { 998 if dstOneOf, ok := o.Value.(*TypedValue_DoubleValue); !ok || dstOneOf == nil { 999 o.Value = &TypedValue_DoubleValue{} 1000 } 1001 if source != nil { 1002 o := o.Value.(*TypedValue_DoubleValue) 1003 o.DoubleValue = source.DoubleValue 1004 } 1005 } 1006 if source, ok := source.GetValue().(*TypedValue_StringValue); ok { 1007 if dstOneOf, ok := o.Value.(*TypedValue_StringValue); !ok || dstOneOf == nil { 1008 o.Value = &TypedValue_StringValue{} 1009 } 1010 if source != nil { 1011 o := o.Value.(*TypedValue_StringValue) 1012 o.StringValue = source.StringValue 1013 } 1014 } 1015 if source, ok := source.GetValue().(*TypedValue_DistributionValue); ok { 1016 if dstOneOf, ok := o.Value.(*TypedValue_DistributionValue); !ok || dstOneOf == nil { 1017 o.Value = &TypedValue_DistributionValue{} 1018 } 1019 if source != nil { 1020 o := o.Value.(*TypedValue_DistributionValue) 1021 if source.DistributionValue != nil { 1022 if o.DistributionValue == nil { 1023 o.DistributionValue = new(Distribution) 1024 } 1025 o.DistributionValue.Merge(source.DistributionValue) 1026 } 1027 } 1028 } 1029 } 1030 1031 func (o *TypedValue) MergeRaw(source gotenobject.GotenObjectExt) { 1032 o.Merge(source.(*TypedValue)) 1033 } 1034 1035 func (o *TimeInterval) GotenObjectExt() {} 1036 1037 func (o *TimeInterval) MakeFullFieldMask() *TimeInterval_FieldMask { 1038 return FullTimeInterval_FieldMask() 1039 } 1040 1041 func (o *TimeInterval) MakeRawFullFieldMask() gotenobject.FieldMask { 1042 return FullTimeInterval_FieldMask() 1043 } 1044 1045 func (o *TimeInterval) MakeDiffFieldMask(other *TimeInterval) *TimeInterval_FieldMask { 1046 if o == nil && other == nil { 1047 return &TimeInterval_FieldMask{} 1048 } 1049 if o == nil || other == nil { 1050 return FullTimeInterval_FieldMask() 1051 } 1052 1053 res := &TimeInterval_FieldMask{} 1054 if !proto.Equal(o.GetEndTime(), other.GetEndTime()) { 1055 res.Paths = append(res.Paths, &TimeInterval_FieldTerminalPath{selector: TimeInterval_FieldPathSelectorEndTime}) 1056 } 1057 if !proto.Equal(o.GetStartTime(), other.GetStartTime()) { 1058 res.Paths = append(res.Paths, &TimeInterval_FieldTerminalPath{selector: TimeInterval_FieldPathSelectorStartTime}) 1059 } 1060 return res 1061 } 1062 1063 func (o *TimeInterval) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1064 return o.MakeDiffFieldMask(other.(*TimeInterval)) 1065 } 1066 1067 func (o *TimeInterval) Clone() *TimeInterval { 1068 if o == nil { 1069 return nil 1070 } 1071 result := &TimeInterval{} 1072 result.EndTime = proto.Clone(o.EndTime).(*timestamppb.Timestamp) 1073 result.StartTime = proto.Clone(o.StartTime).(*timestamppb.Timestamp) 1074 return result 1075 } 1076 1077 func (o *TimeInterval) CloneRaw() gotenobject.GotenObjectExt { 1078 return o.Clone() 1079 } 1080 1081 func (o *TimeInterval) Merge(source *TimeInterval) { 1082 if source.GetEndTime() != nil { 1083 if o.EndTime == nil { 1084 o.EndTime = new(timestamppb.Timestamp) 1085 } 1086 proto.Merge(o.EndTime, source.GetEndTime()) 1087 } 1088 if source.GetStartTime() != nil { 1089 if o.StartTime == nil { 1090 o.StartTime = new(timestamppb.Timestamp) 1091 } 1092 proto.Merge(o.StartTime, source.GetStartTime()) 1093 } 1094 } 1095 1096 func (o *TimeInterval) MergeRaw(source gotenobject.GotenObjectExt) { 1097 o.Merge(source.(*TimeInterval)) 1098 } 1099 1100 func (o *TimeRange) GotenObjectExt() {} 1101 1102 func (o *TimeRange) MakeFullFieldMask() *TimeRange_FieldMask { 1103 return FullTimeRange_FieldMask() 1104 } 1105 1106 func (o *TimeRange) MakeRawFullFieldMask() gotenobject.FieldMask { 1107 return FullTimeRange_FieldMask() 1108 } 1109 1110 func (o *TimeRange) MakeDiffFieldMask(other *TimeRange) *TimeRange_FieldMask { 1111 if o == nil && other == nil { 1112 return &TimeRange_FieldMask{} 1113 } 1114 if o == nil || other == nil { 1115 return FullTimeRange_FieldMask() 1116 } 1117 1118 res := &TimeRange_FieldMask{} 1119 if !proto.Equal(o.GetStartTime(), other.GetStartTime()) { 1120 res.Paths = append(res.Paths, &TimeRange_FieldTerminalPath{selector: TimeRange_FieldPathSelectorStartTime}) 1121 } 1122 if !proto.Equal(o.GetEndTime(), other.GetEndTime()) { 1123 res.Paths = append(res.Paths, &TimeRange_FieldTerminalPath{selector: TimeRange_FieldPathSelectorEndTime}) 1124 } 1125 return res 1126 } 1127 1128 func (o *TimeRange) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1129 return o.MakeDiffFieldMask(other.(*TimeRange)) 1130 } 1131 1132 func (o *TimeRange) Clone() *TimeRange { 1133 if o == nil { 1134 return nil 1135 } 1136 result := &TimeRange{} 1137 result.StartTime = proto.Clone(o.StartTime).(*timestamppb.Timestamp) 1138 result.EndTime = proto.Clone(o.EndTime).(*timestamppb.Timestamp) 1139 return result 1140 } 1141 1142 func (o *TimeRange) CloneRaw() gotenobject.GotenObjectExt { 1143 return o.Clone() 1144 } 1145 1146 func (o *TimeRange) Merge(source *TimeRange) { 1147 if source.GetStartTime() != nil { 1148 if o.StartTime == nil { 1149 o.StartTime = new(timestamppb.Timestamp) 1150 } 1151 proto.Merge(o.StartTime, source.GetStartTime()) 1152 } 1153 if source.GetEndTime() != nil { 1154 if o.EndTime == nil { 1155 o.EndTime = new(timestamppb.Timestamp) 1156 } 1157 proto.Merge(o.EndTime, source.GetEndTime()) 1158 } 1159 } 1160 1161 func (o *TimeRange) MergeRaw(source gotenobject.GotenObjectExt) { 1162 o.Merge(source.(*TimeRange)) 1163 } 1164 1165 func (o *Aggregation) GotenObjectExt() {} 1166 1167 func (o *Aggregation) MakeFullFieldMask() *Aggregation_FieldMask { 1168 return FullAggregation_FieldMask() 1169 } 1170 1171 func (o *Aggregation) MakeRawFullFieldMask() gotenobject.FieldMask { 1172 return FullAggregation_FieldMask() 1173 } 1174 1175 func (o *Aggregation) MakeDiffFieldMask(other *Aggregation) *Aggregation_FieldMask { 1176 if o == nil && other == nil { 1177 return &Aggregation_FieldMask{} 1178 } 1179 if o == nil || other == nil { 1180 return FullAggregation_FieldMask() 1181 } 1182 1183 res := &Aggregation_FieldMask{} 1184 if !proto.Equal(o.GetAlignmentPeriod(), other.GetAlignmentPeriod()) { 1185 res.Paths = append(res.Paths, &Aggregation_FieldTerminalPath{selector: Aggregation_FieldPathSelectorAlignmentPeriod}) 1186 } 1187 if o.GetPerSeriesAligner() != other.GetPerSeriesAligner() { 1188 res.Paths = append(res.Paths, &Aggregation_FieldTerminalPath{selector: Aggregation_FieldPathSelectorPerSeriesAligner}) 1189 } 1190 if o.GetCrossSeriesReducer() != other.GetCrossSeriesReducer() { 1191 res.Paths = append(res.Paths, &Aggregation_FieldTerminalPath{selector: Aggregation_FieldPathSelectorCrossSeriesReducer}) 1192 } 1193 1194 if len(o.GetGroupByFields()) == len(other.GetGroupByFields()) { 1195 for i, lValue := range o.GetGroupByFields() { 1196 rValue := other.GetGroupByFields()[i] 1197 if lValue != rValue { 1198 res.Paths = append(res.Paths, &Aggregation_FieldTerminalPath{selector: Aggregation_FieldPathSelectorGroupByFields}) 1199 break 1200 } 1201 } 1202 } else { 1203 res.Paths = append(res.Paths, &Aggregation_FieldTerminalPath{selector: Aggregation_FieldPathSelectorGroupByFields}) 1204 } 1205 return res 1206 } 1207 1208 func (o *Aggregation) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1209 return o.MakeDiffFieldMask(other.(*Aggregation)) 1210 } 1211 1212 func (o *Aggregation) Clone() *Aggregation { 1213 if o == nil { 1214 return nil 1215 } 1216 result := &Aggregation{} 1217 result.AlignmentPeriod = proto.Clone(o.AlignmentPeriod).(*durationpb.Duration) 1218 result.PerSeriesAligner = o.PerSeriesAligner 1219 result.CrossSeriesReducer = o.CrossSeriesReducer 1220 result.GroupByFields = make([]string, len(o.GroupByFields)) 1221 for i, sourceValue := range o.GroupByFields { 1222 result.GroupByFields[i] = sourceValue 1223 } 1224 return result 1225 } 1226 1227 func (o *Aggregation) CloneRaw() gotenobject.GotenObjectExt { 1228 return o.Clone() 1229 } 1230 1231 func (o *Aggregation) Merge(source *Aggregation) { 1232 if source.GetAlignmentPeriod() != nil { 1233 if o.AlignmentPeriod == nil { 1234 o.AlignmentPeriod = new(durationpb.Duration) 1235 } 1236 proto.Merge(o.AlignmentPeriod, source.GetAlignmentPeriod()) 1237 } 1238 o.PerSeriesAligner = source.GetPerSeriesAligner() 1239 o.CrossSeriesReducer = source.GetCrossSeriesReducer() 1240 for _, sourceValue := range source.GetGroupByFields() { 1241 exists := false 1242 for _, currentValue := range o.GroupByFields { 1243 if currentValue == sourceValue { 1244 exists = true 1245 break 1246 } 1247 } 1248 if !exists { 1249 var newDstElement string 1250 newDstElement = sourceValue 1251 o.GroupByFields = append(o.GroupByFields, newDstElement) 1252 } 1253 } 1254 1255 } 1256 1257 func (o *Aggregation) MergeRaw(source gotenobject.GotenObjectExt) { 1258 o.Merge(source.(*Aggregation)) 1259 } 1260 1261 func (o *Pagination) GotenObjectExt() {} 1262 1263 func (o *Pagination) MakeFullFieldMask() *Pagination_FieldMask { 1264 return FullPagination_FieldMask() 1265 } 1266 1267 func (o *Pagination) MakeRawFullFieldMask() gotenobject.FieldMask { 1268 return FullPagination_FieldMask() 1269 } 1270 1271 func (o *Pagination) MakeDiffFieldMask(other *Pagination) *Pagination_FieldMask { 1272 if o == nil && other == nil { 1273 return &Pagination_FieldMask{} 1274 } 1275 if o == nil || other == nil { 1276 return FullPagination_FieldMask() 1277 } 1278 1279 res := &Pagination_FieldMask{} 1280 if o.GetView() != other.GetView() { 1281 res.Paths = append(res.Paths, &Pagination_FieldTerminalPath{selector: Pagination_FieldPathSelectorView}) 1282 } 1283 if o.GetFunction() != other.GetFunction() { 1284 res.Paths = append(res.Paths, &Pagination_FieldTerminalPath{selector: Pagination_FieldPathSelectorFunction}) 1285 } 1286 if !proto.Equal(o.GetAlignmentPeriod(), other.GetAlignmentPeriod()) { 1287 res.Paths = append(res.Paths, &Pagination_FieldTerminalPath{selector: Pagination_FieldPathSelectorAlignmentPeriod}) 1288 } 1289 if o.GetLimit() != other.GetLimit() { 1290 res.Paths = append(res.Paths, &Pagination_FieldTerminalPath{selector: Pagination_FieldPathSelectorLimit}) 1291 } 1292 if o.GetOffset() != other.GetOffset() { 1293 res.Paths = append(res.Paths, &Pagination_FieldTerminalPath{selector: Pagination_FieldPathSelectorOffset}) 1294 } 1295 return res 1296 } 1297 1298 func (o *Pagination) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1299 return o.MakeDiffFieldMask(other.(*Pagination)) 1300 } 1301 1302 func (o *Pagination) Clone() *Pagination { 1303 if o == nil { 1304 return nil 1305 } 1306 result := &Pagination{} 1307 result.View = o.View 1308 result.Function = o.Function 1309 result.AlignmentPeriod = proto.Clone(o.AlignmentPeriod).(*durationpb.Duration) 1310 result.Limit = o.Limit 1311 result.Offset = o.Offset 1312 return result 1313 } 1314 1315 func (o *Pagination) CloneRaw() gotenobject.GotenObjectExt { 1316 return o.Clone() 1317 } 1318 1319 func (o *Pagination) Merge(source *Pagination) { 1320 o.View = source.GetView() 1321 o.Function = source.GetFunction() 1322 if source.GetAlignmentPeriod() != nil { 1323 if o.AlignmentPeriod == nil { 1324 o.AlignmentPeriod = new(durationpb.Duration) 1325 } 1326 proto.Merge(o.AlignmentPeriod, source.GetAlignmentPeriod()) 1327 } 1328 o.Limit = source.GetLimit() 1329 o.Offset = source.GetOffset() 1330 } 1331 1332 func (o *Pagination) MergeRaw(source gotenobject.GotenObjectExt) { 1333 o.Merge(source.(*Pagination)) 1334 } 1335 1336 func (o *Metric) GotenObjectExt() {} 1337 1338 func (o *Metric) MakeFullFieldMask() *Metric_FieldMask { 1339 return FullMetric_FieldMask() 1340 } 1341 1342 func (o *Metric) MakeRawFullFieldMask() gotenobject.FieldMask { 1343 return FullMetric_FieldMask() 1344 } 1345 1346 func (o *Metric) MakeDiffFieldMask(other *Metric) *Metric_FieldMask { 1347 if o == nil && other == nil { 1348 return &Metric_FieldMask{} 1349 } 1350 if o == nil || other == nil { 1351 return FullMetric_FieldMask() 1352 } 1353 1354 res := &Metric_FieldMask{} 1355 if o.GetType() != other.GetType() { 1356 res.Paths = append(res.Paths, &Metric_FieldTerminalPath{selector: Metric_FieldPathSelectorType}) 1357 } 1358 1359 if len(o.GetLabels()) == len(other.GetLabels()) { 1360 for i, lValue := range o.GetLabels() { 1361 rValue := other.GetLabels()[i] 1362 if lValue != rValue { 1363 res.Paths = append(res.Paths, &Metric_FieldTerminalPath{selector: Metric_FieldPathSelectorLabels}) 1364 break 1365 } 1366 } 1367 } else { 1368 res.Paths = append(res.Paths, &Metric_FieldTerminalPath{selector: Metric_FieldPathSelectorLabels}) 1369 } 1370 1371 if len(o.GetReducedLabels()) == len(other.GetReducedLabels()) { 1372 for i, lValue := range o.GetReducedLabels() { 1373 rValue := other.GetReducedLabels()[i] 1374 if lValue != rValue { 1375 res.Paths = append(res.Paths, &Metric_FieldTerminalPath{selector: Metric_FieldPathSelectorReducedLabels}) 1376 break 1377 } 1378 } 1379 } else { 1380 res.Paths = append(res.Paths, &Metric_FieldTerminalPath{selector: Metric_FieldPathSelectorReducedLabels}) 1381 } 1382 return res 1383 } 1384 1385 func (o *Metric) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1386 return o.MakeDiffFieldMask(other.(*Metric)) 1387 } 1388 1389 func (o *Metric) Clone() *Metric { 1390 if o == nil { 1391 return nil 1392 } 1393 result := &Metric{} 1394 result.Type = o.Type 1395 result.Labels = map[string]string{} 1396 for key, sourceValue := range o.Labels { 1397 result.Labels[key] = sourceValue 1398 } 1399 result.ReducedLabels = make([]string, len(o.ReducedLabels)) 1400 for i, sourceValue := range o.ReducedLabels { 1401 result.ReducedLabels[i] = sourceValue 1402 } 1403 return result 1404 } 1405 1406 func (o *Metric) CloneRaw() gotenobject.GotenObjectExt { 1407 return o.Clone() 1408 } 1409 1410 func (o *Metric) Merge(source *Metric) { 1411 o.Type = source.GetType() 1412 if source.GetLabels() != nil { 1413 if o.Labels == nil { 1414 o.Labels = make(map[string]string, len(source.GetLabels())) 1415 } 1416 for key, sourceValue := range source.GetLabels() { 1417 o.Labels[key] = sourceValue 1418 } 1419 } 1420 for _, sourceValue := range source.GetReducedLabels() { 1421 exists := false 1422 for _, currentValue := range o.ReducedLabels { 1423 if currentValue == sourceValue { 1424 exists = true 1425 break 1426 } 1427 } 1428 if !exists { 1429 var newDstElement string 1430 newDstElement = sourceValue 1431 o.ReducedLabels = append(o.ReducedLabels, newDstElement) 1432 } 1433 } 1434 1435 } 1436 1437 func (o *Metric) MergeRaw(source gotenobject.GotenObjectExt) { 1438 o.Merge(source.(*Metric)) 1439 } 1440 1441 func (o *MonitoredResource) GotenObjectExt() {} 1442 1443 func (o *MonitoredResource) MakeFullFieldMask() *MonitoredResource_FieldMask { 1444 return FullMonitoredResource_FieldMask() 1445 } 1446 1447 func (o *MonitoredResource) MakeRawFullFieldMask() gotenobject.FieldMask { 1448 return FullMonitoredResource_FieldMask() 1449 } 1450 1451 func (o *MonitoredResource) MakeDiffFieldMask(other *MonitoredResource) *MonitoredResource_FieldMask { 1452 if o == nil && other == nil { 1453 return &MonitoredResource_FieldMask{} 1454 } 1455 if o == nil || other == nil { 1456 return FullMonitoredResource_FieldMask() 1457 } 1458 1459 res := &MonitoredResource_FieldMask{} 1460 if o.GetType() != other.GetType() { 1461 res.Paths = append(res.Paths, &MonitoredResource_FieldTerminalPath{selector: MonitoredResource_FieldPathSelectorType}) 1462 } 1463 1464 if len(o.GetLabels()) == len(other.GetLabels()) { 1465 for i, lValue := range o.GetLabels() { 1466 rValue := other.GetLabels()[i] 1467 if lValue != rValue { 1468 res.Paths = append(res.Paths, &MonitoredResource_FieldTerminalPath{selector: MonitoredResource_FieldPathSelectorLabels}) 1469 break 1470 } 1471 } 1472 } else { 1473 res.Paths = append(res.Paths, &MonitoredResource_FieldTerminalPath{selector: MonitoredResource_FieldPathSelectorLabels}) 1474 } 1475 1476 if len(o.GetReducedLabels()) == len(other.GetReducedLabels()) { 1477 for i, lValue := range o.GetReducedLabels() { 1478 rValue := other.GetReducedLabels()[i] 1479 if lValue != rValue { 1480 res.Paths = append(res.Paths, &MonitoredResource_FieldTerminalPath{selector: MonitoredResource_FieldPathSelectorReducedLabels}) 1481 break 1482 } 1483 } 1484 } else { 1485 res.Paths = append(res.Paths, &MonitoredResource_FieldTerminalPath{selector: MonitoredResource_FieldPathSelectorReducedLabels}) 1486 } 1487 return res 1488 } 1489 1490 func (o *MonitoredResource) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1491 return o.MakeDiffFieldMask(other.(*MonitoredResource)) 1492 } 1493 1494 func (o *MonitoredResource) Clone() *MonitoredResource { 1495 if o == nil { 1496 return nil 1497 } 1498 result := &MonitoredResource{} 1499 result.Type = o.Type 1500 result.Labels = map[string]string{} 1501 for key, sourceValue := range o.Labels { 1502 result.Labels[key] = sourceValue 1503 } 1504 result.ReducedLabels = make([]string, len(o.ReducedLabels)) 1505 for i, sourceValue := range o.ReducedLabels { 1506 result.ReducedLabels[i] = sourceValue 1507 } 1508 return result 1509 } 1510 1511 func (o *MonitoredResource) CloneRaw() gotenobject.GotenObjectExt { 1512 return o.Clone() 1513 } 1514 1515 func (o *MonitoredResource) Merge(source *MonitoredResource) { 1516 o.Type = source.GetType() 1517 if source.GetLabels() != nil { 1518 if o.Labels == nil { 1519 o.Labels = make(map[string]string, len(source.GetLabels())) 1520 } 1521 for key, sourceValue := range source.GetLabels() { 1522 o.Labels[key] = sourceValue 1523 } 1524 } 1525 for _, sourceValue := range source.GetReducedLabels() { 1526 exists := false 1527 for _, currentValue := range o.ReducedLabels { 1528 if currentValue == sourceValue { 1529 exists = true 1530 break 1531 } 1532 } 1533 if !exists { 1534 var newDstElement string 1535 newDstElement = sourceValue 1536 o.ReducedLabels = append(o.ReducedLabels, newDstElement) 1537 } 1538 } 1539 1540 } 1541 1542 func (o *MonitoredResource) MergeRaw(source gotenobject.GotenObjectExt) { 1543 o.Merge(source.(*MonitoredResource)) 1544 } 1545 1546 func (o *Strings) GotenObjectExt() {} 1547 1548 func (o *Strings) MakeFullFieldMask() *Strings_FieldMask { 1549 return FullStrings_FieldMask() 1550 } 1551 1552 func (o *Strings) MakeRawFullFieldMask() gotenobject.FieldMask { 1553 return FullStrings_FieldMask() 1554 } 1555 1556 func (o *Strings) MakeDiffFieldMask(other *Strings) *Strings_FieldMask { 1557 if o == nil && other == nil { 1558 return &Strings_FieldMask{} 1559 } 1560 if o == nil || other == nil { 1561 return FullStrings_FieldMask() 1562 } 1563 1564 res := &Strings_FieldMask{} 1565 1566 if len(o.GetValues()) == len(other.GetValues()) { 1567 for i, lValue := range o.GetValues() { 1568 rValue := other.GetValues()[i] 1569 if lValue != rValue { 1570 res.Paths = append(res.Paths, &Strings_FieldTerminalPath{selector: Strings_FieldPathSelectorValues}) 1571 break 1572 } 1573 } 1574 } else { 1575 res.Paths = append(res.Paths, &Strings_FieldTerminalPath{selector: Strings_FieldPathSelectorValues}) 1576 } 1577 return res 1578 } 1579 1580 func (o *Strings) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1581 return o.MakeDiffFieldMask(other.(*Strings)) 1582 } 1583 1584 func (o *Strings) Clone() *Strings { 1585 if o == nil { 1586 return nil 1587 } 1588 result := &Strings{} 1589 result.Values = make([]string, len(o.Values)) 1590 for i, sourceValue := range o.Values { 1591 result.Values[i] = sourceValue 1592 } 1593 return result 1594 } 1595 1596 func (o *Strings) CloneRaw() gotenobject.GotenObjectExt { 1597 return o.Clone() 1598 } 1599 1600 func (o *Strings) Merge(source *Strings) { 1601 for _, sourceValue := range source.GetValues() { 1602 exists := false 1603 for _, currentValue := range o.Values { 1604 if currentValue == sourceValue { 1605 exists = true 1606 break 1607 } 1608 } 1609 if !exists { 1610 var newDstElement string 1611 newDstElement = sourceValue 1612 o.Values = append(o.Values, newDstElement) 1613 } 1614 } 1615 1616 } 1617 1618 func (o *Strings) MergeRaw(source gotenobject.GotenObjectExt) { 1619 o.Merge(source.(*Strings)) 1620 } 1621 1622 func (o *MonitoredResourceSelector) GotenObjectExt() {} 1623 1624 func (o *MonitoredResourceSelector) MakeFullFieldMask() *MonitoredResourceSelector_FieldMask { 1625 return FullMonitoredResourceSelector_FieldMask() 1626 } 1627 1628 func (o *MonitoredResourceSelector) MakeRawFullFieldMask() gotenobject.FieldMask { 1629 return FullMonitoredResourceSelector_FieldMask() 1630 } 1631 1632 func (o *MonitoredResourceSelector) MakeDiffFieldMask(other *MonitoredResourceSelector) *MonitoredResourceSelector_FieldMask { 1633 if o == nil && other == nil { 1634 return &MonitoredResourceSelector_FieldMask{} 1635 } 1636 if o == nil || other == nil { 1637 return FullMonitoredResourceSelector_FieldMask() 1638 } 1639 1640 res := &MonitoredResourceSelector_FieldMask{} 1641 1642 if len(o.GetTypes()) == len(other.GetTypes()) { 1643 for i, lValue := range o.GetTypes() { 1644 rValue := other.GetTypes()[i] 1645 if lValue != rValue { 1646 res.Paths = append(res.Paths, &MonitoredResourceSelector_FieldTerminalPath{selector: MonitoredResourceSelector_FieldPathSelectorTypes}) 1647 break 1648 } 1649 } 1650 } else { 1651 res.Paths = append(res.Paths, &MonitoredResourceSelector_FieldTerminalPath{selector: MonitoredResourceSelector_FieldPathSelectorTypes}) 1652 } 1653 1654 if len(o.GetLabels()) == len(other.GetLabels()) { 1655 for i, lValue := range o.GetLabels() { 1656 rValue := other.GetLabels()[i] 1657 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 1658 res.Paths = append(res.Paths, &MonitoredResourceSelector_FieldTerminalPath{selector: MonitoredResourceSelector_FieldPathSelectorLabels}) 1659 break 1660 } 1661 } 1662 } else { 1663 res.Paths = append(res.Paths, &MonitoredResourceSelector_FieldTerminalPath{selector: MonitoredResourceSelector_FieldPathSelectorLabels}) 1664 } 1665 return res 1666 } 1667 1668 func (o *MonitoredResourceSelector) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1669 return o.MakeDiffFieldMask(other.(*MonitoredResourceSelector)) 1670 } 1671 1672 func (o *MonitoredResourceSelector) Clone() *MonitoredResourceSelector { 1673 if o == nil { 1674 return nil 1675 } 1676 result := &MonitoredResourceSelector{} 1677 result.Types = make([]string, len(o.Types)) 1678 for i, sourceValue := range o.Types { 1679 result.Types[i] = sourceValue 1680 } 1681 result.Labels = map[string]*Strings{} 1682 for key, sourceValue := range o.Labels { 1683 result.Labels[key] = sourceValue.Clone() 1684 } 1685 return result 1686 } 1687 1688 func (o *MonitoredResourceSelector) CloneRaw() gotenobject.GotenObjectExt { 1689 return o.Clone() 1690 } 1691 1692 func (o *MonitoredResourceSelector) Merge(source *MonitoredResourceSelector) { 1693 for _, sourceValue := range source.GetTypes() { 1694 exists := false 1695 for _, currentValue := range o.Types { 1696 if currentValue == sourceValue { 1697 exists = true 1698 break 1699 } 1700 } 1701 if !exists { 1702 var newDstElement string 1703 newDstElement = sourceValue 1704 o.Types = append(o.Types, newDstElement) 1705 } 1706 } 1707 1708 if source.GetLabels() != nil { 1709 if o.Labels == nil { 1710 o.Labels = make(map[string]*Strings, len(source.GetLabels())) 1711 } 1712 for key, sourceValue := range source.GetLabels() { 1713 if sourceValue != nil { 1714 if o.Labels[key] == nil { 1715 o.Labels[key] = new(Strings) 1716 } 1717 o.Labels[key].Merge(sourceValue) 1718 } 1719 } 1720 } 1721 } 1722 1723 func (o *MonitoredResourceSelector) MergeRaw(source gotenobject.GotenObjectExt) { 1724 o.Merge(source.(*MonitoredResourceSelector)) 1725 } 1726 1727 func (o *MetricSelector) GotenObjectExt() {} 1728 1729 func (o *MetricSelector) MakeFullFieldMask() *MetricSelector_FieldMask { 1730 return FullMetricSelector_FieldMask() 1731 } 1732 1733 func (o *MetricSelector) MakeRawFullFieldMask() gotenobject.FieldMask { 1734 return FullMetricSelector_FieldMask() 1735 } 1736 1737 func (o *MetricSelector) MakeDiffFieldMask(other *MetricSelector) *MetricSelector_FieldMask { 1738 if o == nil && other == nil { 1739 return &MetricSelector_FieldMask{} 1740 } 1741 if o == nil || other == nil { 1742 return FullMetricSelector_FieldMask() 1743 } 1744 1745 res := &MetricSelector_FieldMask{} 1746 1747 if len(o.GetTypes()) == len(other.GetTypes()) { 1748 for i, lValue := range o.GetTypes() { 1749 rValue := other.GetTypes()[i] 1750 if lValue != rValue { 1751 res.Paths = append(res.Paths, &MetricSelector_FieldTerminalPath{selector: MetricSelector_FieldPathSelectorTypes}) 1752 break 1753 } 1754 } 1755 } else { 1756 res.Paths = append(res.Paths, &MetricSelector_FieldTerminalPath{selector: MetricSelector_FieldPathSelectorTypes}) 1757 } 1758 1759 if len(o.GetLabels()) == len(other.GetLabels()) { 1760 for i, lValue := range o.GetLabels() { 1761 rValue := other.GetLabels()[i] 1762 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 1763 res.Paths = append(res.Paths, &MetricSelector_FieldTerminalPath{selector: MetricSelector_FieldPathSelectorLabels}) 1764 break 1765 } 1766 } 1767 } else { 1768 res.Paths = append(res.Paths, &MetricSelector_FieldTerminalPath{selector: MetricSelector_FieldPathSelectorLabels}) 1769 } 1770 return res 1771 } 1772 1773 func (o *MetricSelector) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1774 return o.MakeDiffFieldMask(other.(*MetricSelector)) 1775 } 1776 1777 func (o *MetricSelector) Clone() *MetricSelector { 1778 if o == nil { 1779 return nil 1780 } 1781 result := &MetricSelector{} 1782 result.Types = make([]string, len(o.Types)) 1783 for i, sourceValue := range o.Types { 1784 result.Types[i] = sourceValue 1785 } 1786 result.Labels = map[string]*Strings{} 1787 for key, sourceValue := range o.Labels { 1788 result.Labels[key] = sourceValue.Clone() 1789 } 1790 return result 1791 } 1792 1793 func (o *MetricSelector) CloneRaw() gotenobject.GotenObjectExt { 1794 return o.Clone() 1795 } 1796 1797 func (o *MetricSelector) Merge(source *MetricSelector) { 1798 for _, sourceValue := range source.GetTypes() { 1799 exists := false 1800 for _, currentValue := range o.Types { 1801 if currentValue == sourceValue { 1802 exists = true 1803 break 1804 } 1805 } 1806 if !exists { 1807 var newDstElement string 1808 newDstElement = sourceValue 1809 o.Types = append(o.Types, newDstElement) 1810 } 1811 } 1812 1813 if source.GetLabels() != nil { 1814 if o.Labels == nil { 1815 o.Labels = make(map[string]*Strings, len(source.GetLabels())) 1816 } 1817 for key, sourceValue := range source.GetLabels() { 1818 if sourceValue != nil { 1819 if o.Labels[key] == nil { 1820 o.Labels[key] = new(Strings) 1821 } 1822 o.Labels[key].Merge(sourceValue) 1823 } 1824 } 1825 } 1826 } 1827 1828 func (o *MetricSelector) MergeRaw(source gotenobject.GotenObjectExt) { 1829 o.Merge(source.(*MetricSelector)) 1830 } 1831 1832 func (o *TimeSeriesSelector) GotenObjectExt() {} 1833 1834 func (o *TimeSeriesSelector) MakeFullFieldMask() *TimeSeriesSelector_FieldMask { 1835 return FullTimeSeriesSelector_FieldMask() 1836 } 1837 1838 func (o *TimeSeriesSelector) MakeRawFullFieldMask() gotenobject.FieldMask { 1839 return FullTimeSeriesSelector_FieldMask() 1840 } 1841 1842 func (o *TimeSeriesSelector) MakeDiffFieldMask(other *TimeSeriesSelector) *TimeSeriesSelector_FieldMask { 1843 if o == nil && other == nil { 1844 return &TimeSeriesSelector_FieldMask{} 1845 } 1846 if o == nil || other == nil { 1847 return FullTimeSeriesSelector_FieldMask() 1848 } 1849 1850 res := &TimeSeriesSelector_FieldMask{} 1851 { 1852 subMask := o.GetMetric().MakeDiffFieldMask(other.GetMetric()) 1853 if subMask.IsFull() { 1854 res.Paths = append(res.Paths, &TimeSeriesSelector_FieldTerminalPath{selector: TimeSeriesSelector_FieldPathSelectorMetric}) 1855 } else { 1856 for _, subpath := range subMask.Paths { 1857 res.Paths = append(res.Paths, &TimeSeriesSelector_FieldSubPath{selector: TimeSeriesSelector_FieldPathSelectorMetric, subPath: subpath}) 1858 } 1859 } 1860 } 1861 { 1862 subMask := o.GetResource().MakeDiffFieldMask(other.GetResource()) 1863 if subMask.IsFull() { 1864 res.Paths = append(res.Paths, &TimeSeriesSelector_FieldTerminalPath{selector: TimeSeriesSelector_FieldPathSelectorResource}) 1865 } else { 1866 for _, subpath := range subMask.Paths { 1867 res.Paths = append(res.Paths, &TimeSeriesSelector_FieldSubPath{selector: TimeSeriesSelector_FieldPathSelectorResource, subPath: subpath}) 1868 } 1869 } 1870 } 1871 return res 1872 } 1873 1874 func (o *TimeSeriesSelector) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1875 return o.MakeDiffFieldMask(other.(*TimeSeriesSelector)) 1876 } 1877 1878 func (o *TimeSeriesSelector) Clone() *TimeSeriesSelector { 1879 if o == nil { 1880 return nil 1881 } 1882 result := &TimeSeriesSelector{} 1883 result.Metric = o.Metric.Clone() 1884 result.Resource = o.Resource.Clone() 1885 return result 1886 } 1887 1888 func (o *TimeSeriesSelector) CloneRaw() gotenobject.GotenObjectExt { 1889 return o.Clone() 1890 } 1891 1892 func (o *TimeSeriesSelector) Merge(source *TimeSeriesSelector) { 1893 if source.GetMetric() != nil { 1894 if o.Metric == nil { 1895 o.Metric = new(MetricSelector) 1896 } 1897 o.Metric.Merge(source.GetMetric()) 1898 } 1899 if source.GetResource() != nil { 1900 if o.Resource == nil { 1901 o.Resource = new(MonitoredResourceSelector) 1902 } 1903 o.Resource.Merge(source.GetResource()) 1904 } 1905 } 1906 1907 func (o *TimeSeriesSelector) MergeRaw(source gotenobject.GotenObjectExt) { 1908 o.Merge(source.(*TimeSeriesSelector)) 1909 }