github.com/cloudwan/edgelq-sdk@v1.15.4/iam/resources/v1/role/role.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/iam/proto/v1/role.proto 3 // DO NOT EDIT!!! 4 5 package role 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 condition "github.com/cloudwan/edgelq-sdk/iam/resources/v1/condition" 20 organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization" 21 permission "github.com/cloudwan/edgelq-sdk/iam/resources/v1/permission" 22 project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project" 23 meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service" 24 meta "github.com/cloudwan/goten-sdk/types/meta" 25 ) 26 27 // ensure the imports are used 28 var ( 29 _ = new(fmt.Stringer) 30 _ = new(sort.Interface) 31 32 _ = new(proto.Message) 33 _ = googlefieldmaskpb.FieldMask{} 34 35 _ = new(gotenobject.FieldPath) 36 ) 37 38 // make sure we're using proto imports 39 var ( 40 _ = &condition.Condition{} 41 _ = &organization.Organization{} 42 _ = &permission.Permission{} 43 _ = &project.Project{} 44 _ = &meta_service.Service{} 45 _ = &meta.Meta{} 46 ) 47 48 func (o *Role) GotenObjectExt() {} 49 50 func (o *Role) MakeFullFieldMask() *Role_FieldMask { 51 return FullRole_FieldMask() 52 } 53 54 func (o *Role) MakeRawFullFieldMask() gotenobject.FieldMask { 55 return FullRole_FieldMask() 56 } 57 58 func (o *Role) MakeDiffFieldMask(other *Role) *Role_FieldMask { 59 if o == nil && other == nil { 60 return &Role_FieldMask{} 61 } 62 if o == nil || other == nil { 63 return FullRole_FieldMask() 64 } 65 66 res := &Role_FieldMask{} 67 if o.GetName().String() != other.GetName().String() { 68 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorName}) 69 } 70 { 71 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 72 if subMask.IsFull() { 73 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorMetadata}) 74 } else { 75 for _, subpath := range subMask.Paths { 76 res.Paths = append(res.Paths, &Role_FieldSubPath{selector: Role_FieldPathSelectorMetadata, subPath: subpath}) 77 } 78 } 79 } 80 if o.GetDisplayName() != other.GetDisplayName() { 81 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorDisplayName}) 82 } 83 if o.GetDescription() != other.GetDescription() { 84 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorDescription}) 85 } 86 if o.GetCategory() != other.GetCategory() { 87 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorCategory}) 88 } 89 90 if len(o.GetScopeParams()) == len(other.GetScopeParams()) { 91 for i, lValue := range o.GetScopeParams() { 92 rValue := other.GetScopeParams()[i] 93 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 94 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorScopeParams}) 95 break 96 } 97 } 98 } else { 99 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorScopeParams}) 100 } 101 102 if len(o.GetConstValues()) == len(other.GetConstValues()) { 103 for i, lValue := range o.GetConstValues() { 104 rValue := other.GetConstValues()[i] 105 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 106 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorConstValues}) 107 break 108 } 109 } 110 } else { 111 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorConstValues}) 112 } 113 114 if len(o.GetDefaultValues()) == len(other.GetDefaultValues()) { 115 for i, lValue := range o.GetDefaultValues() { 116 rValue := other.GetDefaultValues()[i] 117 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 118 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorDefaultValues}) 119 break 120 } 121 } 122 } else { 123 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorDefaultValues}) 124 } 125 126 if len(o.GetGrants()) == len(other.GetGrants()) { 127 for i, lValue := range o.GetGrants() { 128 rValue := other.GetGrants()[i] 129 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 130 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorGrants}) 131 break 132 } 133 } 134 } else { 135 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorGrants}) 136 } 137 138 if len(o.GetOwnedObjects()) == len(other.GetOwnedObjects()) { 139 for i, lValue := range o.GetOwnedObjects() { 140 rValue := other.GetOwnedObjects()[i] 141 if lValue != rValue { 142 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorOwnedObjects}) 143 break 144 } 145 } 146 } else { 147 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorOwnedObjects}) 148 } 149 150 if len(o.GetServices()) == len(other.GetServices()) { 151 for i, lValue := range o.GetServices() { 152 rValue := other.GetServices()[i] 153 if lValue.String() != rValue.String() { 154 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorServices}) 155 break 156 } 157 } 158 } else { 159 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorServices}) 160 } 161 if o.GetRbSpecGeneration() != other.GetRbSpecGeneration() { 162 res.Paths = append(res.Paths, &Role_FieldTerminalPath{selector: Role_FieldPathSelectorRbSpecGeneration}) 163 } 164 return res 165 } 166 167 func (o *Role) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 168 return o.MakeDiffFieldMask(other.(*Role)) 169 } 170 171 func (o *Role) Clone() *Role { 172 if o == nil { 173 return nil 174 } 175 result := &Role{} 176 if o.Name == nil { 177 result.Name = nil 178 } else if data, err := o.Name.ProtoString(); err != nil { 179 panic(err) 180 } else { 181 result.Name = &Name{} 182 if err := result.Name.ParseProtoString(data); err != nil { 183 panic(err) 184 } 185 } 186 result.Metadata = o.Metadata.Clone() 187 result.DisplayName = o.DisplayName 188 result.Description = o.Description 189 result.Category = o.Category 190 result.ScopeParams = make([]*Role_ScopeParamType, len(o.ScopeParams)) 191 for i, sourceValue := range o.ScopeParams { 192 result.ScopeParams[i] = sourceValue.Clone() 193 } 194 result.ConstValues = make([]*ScopeParam, len(o.ConstValues)) 195 for i, sourceValue := range o.ConstValues { 196 result.ConstValues[i] = sourceValue.Clone() 197 } 198 result.DefaultValues = make([]*ScopeParam, len(o.DefaultValues)) 199 for i, sourceValue := range o.DefaultValues { 200 result.DefaultValues[i] = sourceValue.Clone() 201 } 202 result.Grants = make([]*Role_Grant, len(o.Grants)) 203 for i, sourceValue := range o.Grants { 204 result.Grants[i] = sourceValue.Clone() 205 } 206 result.OwnedObjects = make([]string, len(o.OwnedObjects)) 207 for i, sourceValue := range o.OwnedObjects { 208 result.OwnedObjects[i] = sourceValue 209 } 210 result.Services = make([]*meta_service.Reference, len(o.Services)) 211 for i, sourceValue := range o.Services { 212 if sourceValue == nil { 213 result.Services[i] = nil 214 } else if data, err := sourceValue.ProtoString(); err != nil { 215 panic(err) 216 } else { 217 result.Services[i] = &meta_service.Reference{} 218 if err := result.Services[i].ParseProtoString(data); err != nil { 219 panic(err) 220 } 221 } 222 } 223 result.RbSpecGeneration = o.RbSpecGeneration 224 return result 225 } 226 227 func (o *Role) CloneRaw() gotenobject.GotenObjectExt { 228 return o.Clone() 229 } 230 231 func (o *Role) Merge(source *Role) { 232 if source.GetName() != nil { 233 if data, err := source.GetName().ProtoString(); err != nil { 234 panic(err) 235 } else { 236 o.Name = &Name{} 237 if err := o.Name.ParseProtoString(data); err != nil { 238 panic(err) 239 } 240 } 241 } else { 242 o.Name = nil 243 } 244 if source.GetMetadata() != nil { 245 if o.Metadata == nil { 246 o.Metadata = new(meta.Meta) 247 } 248 o.Metadata.Merge(source.GetMetadata()) 249 } 250 o.DisplayName = source.GetDisplayName() 251 o.Description = source.GetDescription() 252 o.Category = source.GetCategory() 253 for _, sourceValue := range source.GetScopeParams() { 254 exists := false 255 for _, currentValue := range o.ScopeParams { 256 if proto.Equal(sourceValue, currentValue) { 257 exists = true 258 break 259 } 260 } 261 if !exists { 262 var newDstElement *Role_ScopeParamType 263 if sourceValue != nil { 264 newDstElement = new(Role_ScopeParamType) 265 newDstElement.Merge(sourceValue) 266 } 267 o.ScopeParams = append(o.ScopeParams, newDstElement) 268 } 269 } 270 271 for _, sourceValue := range source.GetConstValues() { 272 exists := false 273 for _, currentValue := range o.ConstValues { 274 if proto.Equal(sourceValue, currentValue) { 275 exists = true 276 break 277 } 278 } 279 if !exists { 280 var newDstElement *ScopeParam 281 if sourceValue != nil { 282 newDstElement = new(ScopeParam) 283 newDstElement.Merge(sourceValue) 284 } 285 o.ConstValues = append(o.ConstValues, newDstElement) 286 } 287 } 288 289 for _, sourceValue := range source.GetDefaultValues() { 290 exists := false 291 for _, currentValue := range o.DefaultValues { 292 if proto.Equal(sourceValue, currentValue) { 293 exists = true 294 break 295 } 296 } 297 if !exists { 298 var newDstElement *ScopeParam 299 if sourceValue != nil { 300 newDstElement = new(ScopeParam) 301 newDstElement.Merge(sourceValue) 302 } 303 o.DefaultValues = append(o.DefaultValues, newDstElement) 304 } 305 } 306 307 for _, sourceValue := range source.GetGrants() { 308 exists := false 309 for _, currentValue := range o.Grants { 310 if proto.Equal(sourceValue, currentValue) { 311 exists = true 312 break 313 } 314 } 315 if !exists { 316 var newDstElement *Role_Grant 317 if sourceValue != nil { 318 newDstElement = new(Role_Grant) 319 newDstElement.Merge(sourceValue) 320 } 321 o.Grants = append(o.Grants, newDstElement) 322 } 323 } 324 325 for _, sourceValue := range source.GetOwnedObjects() { 326 exists := false 327 for _, currentValue := range o.OwnedObjects { 328 if currentValue == sourceValue { 329 exists = true 330 break 331 } 332 } 333 if !exists { 334 var newDstElement string 335 newDstElement = sourceValue 336 o.OwnedObjects = append(o.OwnedObjects, newDstElement) 337 } 338 } 339 340 for _, sourceValue := range source.GetServices() { 341 exists := false 342 for _, currentValue := range o.Services { 343 leftProtoStr, _ := currentValue.ProtoString() 344 rightProtoStr, _ := sourceValue.ProtoString() 345 if leftProtoStr == rightProtoStr { 346 exists = true 347 break 348 } 349 } 350 if !exists { 351 var newDstElement *meta_service.Reference 352 if sourceValue != nil { 353 if data, err := sourceValue.ProtoString(); err != nil { 354 panic(err) 355 } else { 356 newDstElement = &meta_service.Reference{} 357 if err := newDstElement.ParseProtoString(data); err != nil { 358 panic(err) 359 } 360 } 361 } 362 o.Services = append(o.Services, newDstElement) 363 } 364 } 365 366 o.RbSpecGeneration = source.GetRbSpecGeneration() 367 } 368 369 func (o *Role) MergeRaw(source gotenobject.GotenObjectExt) { 370 o.Merge(source.(*Role)) 371 } 372 373 func (o *Role_ScopeParamType) GotenObjectExt() {} 374 375 func (o *Role_ScopeParamType) MakeFullFieldMask() *Role_ScopeParamType_FieldMask { 376 return FullRole_ScopeParamType_FieldMask() 377 } 378 379 func (o *Role_ScopeParamType) MakeRawFullFieldMask() gotenobject.FieldMask { 380 return FullRole_ScopeParamType_FieldMask() 381 } 382 383 func (o *Role_ScopeParamType) MakeDiffFieldMask(other *Role_ScopeParamType) *Role_ScopeParamType_FieldMask { 384 if o == nil && other == nil { 385 return &Role_ScopeParamType_FieldMask{} 386 } 387 if o == nil || other == nil { 388 return FullRole_ScopeParamType_FieldMask() 389 } 390 391 res := &Role_ScopeParamType_FieldMask{} 392 if o.GetName() != other.GetName() { 393 res.Paths = append(res.Paths, &RoleScopeParamType_FieldTerminalPath{selector: RoleScopeParamType_FieldPathSelectorName}) 394 } 395 if o.GetType() != other.GetType() { 396 res.Paths = append(res.Paths, &RoleScopeParamType_FieldTerminalPath{selector: RoleScopeParamType_FieldPathSelectorType}) 397 } 398 return res 399 } 400 401 func (o *Role_ScopeParamType) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 402 return o.MakeDiffFieldMask(other.(*Role_ScopeParamType)) 403 } 404 405 func (o *Role_ScopeParamType) Clone() *Role_ScopeParamType { 406 if o == nil { 407 return nil 408 } 409 result := &Role_ScopeParamType{} 410 result.Name = o.Name 411 result.Type = o.Type 412 return result 413 } 414 415 func (o *Role_ScopeParamType) CloneRaw() gotenobject.GotenObjectExt { 416 return o.Clone() 417 } 418 419 func (o *Role_ScopeParamType) Merge(source *Role_ScopeParamType) { 420 o.Name = source.GetName() 421 o.Type = source.GetType() 422 } 423 424 func (o *Role_ScopeParamType) MergeRaw(source gotenobject.GotenObjectExt) { 425 o.Merge(source.(*Role_ScopeParamType)) 426 } 427 428 func (o *Role_Grant) GotenObjectExt() {} 429 430 func (o *Role_Grant) MakeFullFieldMask() *Role_Grant_FieldMask { 431 return FullRole_Grant_FieldMask() 432 } 433 434 func (o *Role_Grant) MakeRawFullFieldMask() gotenobject.FieldMask { 435 return FullRole_Grant_FieldMask() 436 } 437 438 func (o *Role_Grant) MakeDiffFieldMask(other *Role_Grant) *Role_Grant_FieldMask { 439 if o == nil && other == nil { 440 return &Role_Grant_FieldMask{} 441 } 442 if o == nil || other == nil { 443 return FullRole_Grant_FieldMask() 444 } 445 446 res := &Role_Grant_FieldMask{} 447 if o.GetSubScope() != other.GetSubScope() { 448 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorSubScope}) 449 } 450 451 if len(o.GetPermissions()) == len(other.GetPermissions()) { 452 for i, lValue := range o.GetPermissions() { 453 rValue := other.GetPermissions()[i] 454 if lValue.String() != rValue.String() { 455 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorPermissions}) 456 break 457 } 458 } 459 } else { 460 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorPermissions}) 461 } 462 463 if len(o.GetResourceFieldConditions()) == len(other.GetResourceFieldConditions()) { 464 for i, lValue := range o.GetResourceFieldConditions() { 465 rValue := other.GetResourceFieldConditions()[i] 466 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 467 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorResourceFieldConditions}) 468 break 469 } 470 } 471 } else { 472 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorResourceFieldConditions}) 473 } 474 475 if len(o.GetRequestFieldConditions()) == len(other.GetRequestFieldConditions()) { 476 for i, lValue := range o.GetRequestFieldConditions() { 477 rValue := other.GetRequestFieldConditions()[i] 478 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 479 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorRequestFieldConditions}) 480 break 481 } 482 } 483 } else { 484 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorRequestFieldConditions}) 485 } 486 487 if len(o.GetExecutableConditions()) == len(other.GetExecutableConditions()) { 488 for i, lValue := range o.GetExecutableConditions() { 489 rValue := other.GetExecutableConditions()[i] 490 if len(lValue.MakeDiffFieldMask(rValue).Paths) > 0 { 491 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorExecutableConditions}) 492 break 493 } 494 } 495 } else { 496 res.Paths = append(res.Paths, &RoleGrant_FieldTerminalPath{selector: RoleGrant_FieldPathSelectorExecutableConditions}) 497 } 498 return res 499 } 500 501 func (o *Role_Grant) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 502 return o.MakeDiffFieldMask(other.(*Role_Grant)) 503 } 504 505 func (o *Role_Grant) Clone() *Role_Grant { 506 if o == nil { 507 return nil 508 } 509 result := &Role_Grant{} 510 result.SubScope = o.SubScope 511 result.Permissions = make([]*permission.Reference, len(o.Permissions)) 512 for i, sourceValue := range o.Permissions { 513 if sourceValue == nil { 514 result.Permissions[i] = nil 515 } else if data, err := sourceValue.ProtoString(); err != nil { 516 panic(err) 517 } else { 518 result.Permissions[i] = &permission.Reference{} 519 if err := result.Permissions[i].ParseProtoString(data); err != nil { 520 panic(err) 521 } 522 } 523 } 524 result.ResourceFieldConditions = make([]*Role_Grant_FieldCondition, len(o.ResourceFieldConditions)) 525 for i, sourceValue := range o.ResourceFieldConditions { 526 result.ResourceFieldConditions[i] = sourceValue.Clone() 527 } 528 result.RequestFieldConditions = make([]*Role_Grant_FieldCondition, len(o.RequestFieldConditions)) 529 for i, sourceValue := range o.RequestFieldConditions { 530 result.RequestFieldConditions[i] = sourceValue.Clone() 531 } 532 result.ExecutableConditions = make([]*condition.ExecutableCondition, len(o.ExecutableConditions)) 533 for i, sourceValue := range o.ExecutableConditions { 534 result.ExecutableConditions[i] = sourceValue.Clone() 535 } 536 return result 537 } 538 539 func (o *Role_Grant) CloneRaw() gotenobject.GotenObjectExt { 540 return o.Clone() 541 } 542 543 func (o *Role_Grant) Merge(source *Role_Grant) { 544 o.SubScope = source.GetSubScope() 545 for _, sourceValue := range source.GetPermissions() { 546 exists := false 547 for _, currentValue := range o.Permissions { 548 leftProtoStr, _ := currentValue.ProtoString() 549 rightProtoStr, _ := sourceValue.ProtoString() 550 if leftProtoStr == rightProtoStr { 551 exists = true 552 break 553 } 554 } 555 if !exists { 556 var newDstElement *permission.Reference 557 if sourceValue != nil { 558 if data, err := sourceValue.ProtoString(); err != nil { 559 panic(err) 560 } else { 561 newDstElement = &permission.Reference{} 562 if err := newDstElement.ParseProtoString(data); err != nil { 563 panic(err) 564 } 565 } 566 } 567 o.Permissions = append(o.Permissions, newDstElement) 568 } 569 } 570 571 for _, sourceValue := range source.GetResourceFieldConditions() { 572 exists := false 573 for _, currentValue := range o.ResourceFieldConditions { 574 if proto.Equal(sourceValue, currentValue) { 575 exists = true 576 break 577 } 578 } 579 if !exists { 580 var newDstElement *Role_Grant_FieldCondition 581 if sourceValue != nil { 582 newDstElement = new(Role_Grant_FieldCondition) 583 newDstElement.Merge(sourceValue) 584 } 585 o.ResourceFieldConditions = append(o.ResourceFieldConditions, newDstElement) 586 } 587 } 588 589 for _, sourceValue := range source.GetRequestFieldConditions() { 590 exists := false 591 for _, currentValue := range o.RequestFieldConditions { 592 if proto.Equal(sourceValue, currentValue) { 593 exists = true 594 break 595 } 596 } 597 if !exists { 598 var newDstElement *Role_Grant_FieldCondition 599 if sourceValue != nil { 600 newDstElement = new(Role_Grant_FieldCondition) 601 newDstElement.Merge(sourceValue) 602 } 603 o.RequestFieldConditions = append(o.RequestFieldConditions, newDstElement) 604 } 605 } 606 607 for _, sourceValue := range source.GetExecutableConditions() { 608 exists := false 609 for _, currentValue := range o.ExecutableConditions { 610 if proto.Equal(sourceValue, currentValue) { 611 exists = true 612 break 613 } 614 } 615 if !exists { 616 var newDstElement *condition.ExecutableCondition 617 if sourceValue != nil { 618 newDstElement = new(condition.ExecutableCondition) 619 newDstElement.Merge(sourceValue) 620 } 621 o.ExecutableConditions = append(o.ExecutableConditions, newDstElement) 622 } 623 } 624 625 } 626 627 func (o *Role_Grant) MergeRaw(source gotenobject.GotenObjectExt) { 628 o.Merge(source.(*Role_Grant)) 629 } 630 631 func (o *Role_Grant_FieldCondition) GotenObjectExt() {} 632 633 func (o *Role_Grant_FieldCondition) MakeFullFieldMask() *Role_Grant_FieldCondition_FieldMask { 634 return FullRole_Grant_FieldCondition_FieldMask() 635 } 636 637 func (o *Role_Grant_FieldCondition) MakeRawFullFieldMask() gotenobject.FieldMask { 638 return FullRole_Grant_FieldCondition_FieldMask() 639 } 640 641 func (o *Role_Grant_FieldCondition) MakeDiffFieldMask(other *Role_Grant_FieldCondition) *Role_Grant_FieldCondition_FieldMask { 642 if o == nil && other == nil { 643 return &Role_Grant_FieldCondition_FieldMask{} 644 } 645 if o == nil || other == nil { 646 return FullRole_Grant_FieldCondition_FieldMask() 647 } 648 649 res := &Role_Grant_FieldCondition_FieldMask{} 650 if o.GetPath() != other.GetPath() { 651 res.Paths = append(res.Paths, &RoleGrantFieldCondition_FieldTerminalPath{selector: RoleGrantFieldCondition_FieldPathSelectorPath}) 652 } 653 if o.GetValue() != other.GetValue() { 654 res.Paths = append(res.Paths, &RoleGrantFieldCondition_FieldTerminalPath{selector: RoleGrantFieldCondition_FieldPathSelectorValue}) 655 } 656 return res 657 } 658 659 func (o *Role_Grant_FieldCondition) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 660 return o.MakeDiffFieldMask(other.(*Role_Grant_FieldCondition)) 661 } 662 663 func (o *Role_Grant_FieldCondition) Clone() *Role_Grant_FieldCondition { 664 if o == nil { 665 return nil 666 } 667 result := &Role_Grant_FieldCondition{} 668 result.Path = o.Path 669 result.Value = o.Value 670 return result 671 } 672 673 func (o *Role_Grant_FieldCondition) CloneRaw() gotenobject.GotenObjectExt { 674 return o.Clone() 675 } 676 677 func (o *Role_Grant_FieldCondition) Merge(source *Role_Grant_FieldCondition) { 678 o.Path = source.GetPath() 679 o.Value = source.GetValue() 680 } 681 682 func (o *Role_Grant_FieldCondition) MergeRaw(source gotenobject.GotenObjectExt) { 683 o.Merge(source.(*Role_Grant_FieldCondition)) 684 } 685 686 func (o *ScopeParam) GotenObjectExt() {} 687 688 func (o *ScopeParam) MakeFullFieldMask() *ScopeParam_FieldMask { 689 return FullScopeParam_FieldMask() 690 } 691 692 func (o *ScopeParam) MakeRawFullFieldMask() gotenobject.FieldMask { 693 return FullScopeParam_FieldMask() 694 } 695 696 func (o *ScopeParam) MakeDiffFieldMask(other *ScopeParam) *ScopeParam_FieldMask { 697 if o == nil && other == nil { 698 return &ScopeParam_FieldMask{} 699 } 700 if o == nil || other == nil { 701 return FullScopeParam_FieldMask() 702 } 703 704 res := &ScopeParam_FieldMask{} 705 if o.GetName() != other.GetName() { 706 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorName}) 707 } 708 { 709 _, leftSelected := o.Value.(*ScopeParam_String_) 710 _, rightSelected := other.Value.(*ScopeParam_String_) 711 if leftSelected == rightSelected { 712 subMask := o.GetString_().MakeDiffFieldMask(other.GetString_()) 713 if subMask.IsFull() { 714 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorString}) 715 } else { 716 for _, subpath := range subMask.Paths { 717 res.Paths = append(res.Paths, &ScopeParam_FieldSubPath{selector: ScopeParam_FieldPathSelectorString, subPath: subpath}) 718 } 719 } 720 } else { 721 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorString}) 722 } 723 } 724 { 725 _, leftSelected := o.Value.(*ScopeParam_Strings) 726 _, rightSelected := other.Value.(*ScopeParam_Strings) 727 if leftSelected == rightSelected { 728 subMask := o.GetStrings().MakeDiffFieldMask(other.GetStrings()) 729 if subMask.IsFull() { 730 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorStrings}) 731 } else { 732 for _, subpath := range subMask.Paths { 733 res.Paths = append(res.Paths, &ScopeParam_FieldSubPath{selector: ScopeParam_FieldPathSelectorStrings, subPath: subpath}) 734 } 735 } 736 } else { 737 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorStrings}) 738 } 739 } 740 { 741 _, leftSelected := o.Value.(*ScopeParam_ValueFrom) 742 _, rightSelected := other.Value.(*ScopeParam_ValueFrom) 743 if leftSelected == rightSelected { 744 subMask := o.GetValueFrom().MakeDiffFieldMask(other.GetValueFrom()) 745 if subMask.IsFull() { 746 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorValueFrom}) 747 } else { 748 for _, subpath := range subMask.Paths { 749 res.Paths = append(res.Paths, &ScopeParam_FieldSubPath{selector: ScopeParam_FieldPathSelectorValueFrom, subPath: subpath}) 750 } 751 } 752 } else { 753 res.Paths = append(res.Paths, &ScopeParam_FieldTerminalPath{selector: ScopeParam_FieldPathSelectorValueFrom}) 754 } 755 } 756 return res 757 } 758 759 func (o *ScopeParam) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 760 return o.MakeDiffFieldMask(other.(*ScopeParam)) 761 } 762 763 func (o *ScopeParam) Clone() *ScopeParam { 764 if o == nil { 765 return nil 766 } 767 result := &ScopeParam{} 768 result.Name = o.Name 769 if o, ok := o.Value.(*ScopeParam_String_); ok { 770 result.Value = (*ScopeParam_String_)(nil) 771 if o != nil { 772 result.Value = &ScopeParam_String_{} 773 result := result.Value.(*ScopeParam_String_) 774 result.String_ = o.String_.Clone() 775 } 776 } 777 if o, ok := o.Value.(*ScopeParam_Strings); ok { 778 result.Value = (*ScopeParam_Strings)(nil) 779 if o != nil { 780 result.Value = &ScopeParam_Strings{} 781 result := result.Value.(*ScopeParam_Strings) 782 result.Strings = o.Strings.Clone() 783 } 784 } 785 if o, ok := o.Value.(*ScopeParam_ValueFrom); ok { 786 result.Value = (*ScopeParam_ValueFrom)(nil) 787 if o != nil { 788 result.Value = &ScopeParam_ValueFrom{} 789 result := result.Value.(*ScopeParam_ValueFrom) 790 result.ValueFrom = o.ValueFrom.Clone() 791 } 792 } 793 return result 794 } 795 796 func (o *ScopeParam) CloneRaw() gotenobject.GotenObjectExt { 797 return o.Clone() 798 } 799 800 func (o *ScopeParam) Merge(source *ScopeParam) { 801 o.Name = source.GetName() 802 if source, ok := source.GetValue().(*ScopeParam_String_); ok { 803 if dstOneOf, ok := o.Value.(*ScopeParam_String_); !ok || dstOneOf == nil { 804 o.Value = &ScopeParam_String_{} 805 } 806 if source != nil { 807 o := o.Value.(*ScopeParam_String_) 808 if source.String_ != nil { 809 if o.String_ == nil { 810 o.String_ = new(ScopeParam_StringValue) 811 } 812 o.String_.Merge(source.String_) 813 } 814 } 815 } 816 if source, ok := source.GetValue().(*ScopeParam_Strings); ok { 817 if dstOneOf, ok := o.Value.(*ScopeParam_Strings); !ok || dstOneOf == nil { 818 o.Value = &ScopeParam_Strings{} 819 } 820 if source != nil { 821 o := o.Value.(*ScopeParam_Strings) 822 if source.Strings != nil { 823 if o.Strings == nil { 824 o.Strings = new(ScopeParam_ArrayOfStringsValue) 825 } 826 o.Strings.Merge(source.Strings) 827 } 828 } 829 } 830 if source, ok := source.GetValue().(*ScopeParam_ValueFrom); ok { 831 if dstOneOf, ok := o.Value.(*ScopeParam_ValueFrom); !ok || dstOneOf == nil { 832 o.Value = &ScopeParam_ValueFrom{} 833 } 834 if source != nil { 835 o := o.Value.(*ScopeParam_ValueFrom) 836 if source.ValueFrom != nil { 837 if o.ValueFrom == nil { 838 o.ValueFrom = new(ScopeParam_FromValue) 839 } 840 o.ValueFrom.Merge(source.ValueFrom) 841 } 842 } 843 } 844 } 845 846 func (o *ScopeParam) MergeRaw(source gotenobject.GotenObjectExt) { 847 o.Merge(source.(*ScopeParam)) 848 } 849 850 func (o *ScopeParam_StringValue) GotenObjectExt() {} 851 852 func (o *ScopeParam_StringValue) MakeFullFieldMask() *ScopeParam_StringValue_FieldMask { 853 return FullScopeParam_StringValue_FieldMask() 854 } 855 856 func (o *ScopeParam_StringValue) MakeRawFullFieldMask() gotenobject.FieldMask { 857 return FullScopeParam_StringValue_FieldMask() 858 } 859 860 func (o *ScopeParam_StringValue) MakeDiffFieldMask(other *ScopeParam_StringValue) *ScopeParam_StringValue_FieldMask { 861 if o == nil && other == nil { 862 return &ScopeParam_StringValue_FieldMask{} 863 } 864 if o == nil || other == nil { 865 return FullScopeParam_StringValue_FieldMask() 866 } 867 868 res := &ScopeParam_StringValue_FieldMask{} 869 if o.GetValue() != other.GetValue() { 870 res.Paths = append(res.Paths, &ScopeParamStringValue_FieldTerminalPath{selector: ScopeParamStringValue_FieldPathSelectorValue}) 871 } 872 return res 873 } 874 875 func (o *ScopeParam_StringValue) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 876 return o.MakeDiffFieldMask(other.(*ScopeParam_StringValue)) 877 } 878 879 func (o *ScopeParam_StringValue) Clone() *ScopeParam_StringValue { 880 if o == nil { 881 return nil 882 } 883 result := &ScopeParam_StringValue{} 884 result.Value = o.Value 885 return result 886 } 887 888 func (o *ScopeParam_StringValue) CloneRaw() gotenobject.GotenObjectExt { 889 return o.Clone() 890 } 891 892 func (o *ScopeParam_StringValue) Merge(source *ScopeParam_StringValue) { 893 o.Value = source.GetValue() 894 } 895 896 func (o *ScopeParam_StringValue) MergeRaw(source gotenobject.GotenObjectExt) { 897 o.Merge(source.(*ScopeParam_StringValue)) 898 } 899 900 func (o *ScopeParam_ArrayOfStringsValue) GotenObjectExt() {} 901 902 func (o *ScopeParam_ArrayOfStringsValue) MakeFullFieldMask() *ScopeParam_ArrayOfStringsValue_FieldMask { 903 return FullScopeParam_ArrayOfStringsValue_FieldMask() 904 } 905 906 func (o *ScopeParam_ArrayOfStringsValue) MakeRawFullFieldMask() gotenobject.FieldMask { 907 return FullScopeParam_ArrayOfStringsValue_FieldMask() 908 } 909 910 func (o *ScopeParam_ArrayOfStringsValue) MakeDiffFieldMask(other *ScopeParam_ArrayOfStringsValue) *ScopeParam_ArrayOfStringsValue_FieldMask { 911 if o == nil && other == nil { 912 return &ScopeParam_ArrayOfStringsValue_FieldMask{} 913 } 914 if o == nil || other == nil { 915 return FullScopeParam_ArrayOfStringsValue_FieldMask() 916 } 917 918 res := &ScopeParam_ArrayOfStringsValue_FieldMask{} 919 920 if len(o.GetValues()) == len(other.GetValues()) { 921 for i, lValue := range o.GetValues() { 922 rValue := other.GetValues()[i] 923 if lValue != rValue { 924 res.Paths = append(res.Paths, &ScopeParamArrayOfStringsValue_FieldTerminalPath{selector: ScopeParamArrayOfStringsValue_FieldPathSelectorValues}) 925 break 926 } 927 } 928 } else { 929 res.Paths = append(res.Paths, &ScopeParamArrayOfStringsValue_FieldTerminalPath{selector: ScopeParamArrayOfStringsValue_FieldPathSelectorValues}) 930 } 931 return res 932 } 933 934 func (o *ScopeParam_ArrayOfStringsValue) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 935 return o.MakeDiffFieldMask(other.(*ScopeParam_ArrayOfStringsValue)) 936 } 937 938 func (o *ScopeParam_ArrayOfStringsValue) Clone() *ScopeParam_ArrayOfStringsValue { 939 if o == nil { 940 return nil 941 } 942 result := &ScopeParam_ArrayOfStringsValue{} 943 result.Values = make([]string, len(o.Values)) 944 for i, sourceValue := range o.Values { 945 result.Values[i] = sourceValue 946 } 947 return result 948 } 949 950 func (o *ScopeParam_ArrayOfStringsValue) CloneRaw() gotenobject.GotenObjectExt { 951 return o.Clone() 952 } 953 954 func (o *ScopeParam_ArrayOfStringsValue) Merge(source *ScopeParam_ArrayOfStringsValue) { 955 for _, sourceValue := range source.GetValues() { 956 exists := false 957 for _, currentValue := range o.Values { 958 if currentValue == sourceValue { 959 exists = true 960 break 961 } 962 } 963 if !exists { 964 var newDstElement string 965 newDstElement = sourceValue 966 o.Values = append(o.Values, newDstElement) 967 } 968 } 969 970 } 971 972 func (o *ScopeParam_ArrayOfStringsValue) MergeRaw(source gotenobject.GotenObjectExt) { 973 o.Merge(source.(*ScopeParam_ArrayOfStringsValue)) 974 } 975 976 func (o *ScopeParam_FromValue) GotenObjectExt() {} 977 978 func (o *ScopeParam_FromValue) MakeFullFieldMask() *ScopeParam_FromValue_FieldMask { 979 return FullScopeParam_FromValue_FieldMask() 980 } 981 982 func (o *ScopeParam_FromValue) MakeRawFullFieldMask() gotenobject.FieldMask { 983 return FullScopeParam_FromValue_FieldMask() 984 } 985 986 func (o *ScopeParam_FromValue) MakeDiffFieldMask(other *ScopeParam_FromValue) *ScopeParam_FromValue_FieldMask { 987 if o == nil && other == nil { 988 return &ScopeParam_FromValue_FieldMask{} 989 } 990 if o == nil || other == nil { 991 return FullScopeParam_FromValue_FieldMask() 992 } 993 994 res := &ScopeParam_FromValue_FieldMask{} 995 if o.GetSource() != other.GetSource() { 996 res.Paths = append(res.Paths, &ScopeParamFromValue_FieldTerminalPath{selector: ScopeParamFromValue_FieldPathSelectorSource}) 997 } 998 if o.GetPath() != other.GetPath() { 999 res.Paths = append(res.Paths, &ScopeParamFromValue_FieldTerminalPath{selector: ScopeParamFromValue_FieldPathSelectorPath}) 1000 } 1001 return res 1002 } 1003 1004 func (o *ScopeParam_FromValue) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 1005 return o.MakeDiffFieldMask(other.(*ScopeParam_FromValue)) 1006 } 1007 1008 func (o *ScopeParam_FromValue) Clone() *ScopeParam_FromValue { 1009 if o == nil { 1010 return nil 1011 } 1012 result := &ScopeParam_FromValue{} 1013 result.Source = o.Source 1014 result.Path = o.Path 1015 return result 1016 } 1017 1018 func (o *ScopeParam_FromValue) CloneRaw() gotenobject.GotenObjectExt { 1019 return o.Clone() 1020 } 1021 1022 func (o *ScopeParam_FromValue) Merge(source *ScopeParam_FromValue) { 1023 o.Source = source.GetSource() 1024 o.Path = source.GetPath() 1025 } 1026 1027 func (o *ScopeParam_FromValue) MergeRaw(source gotenobject.GotenObjectExt) { 1028 o.Merge(source.(*ScopeParam_FromValue)) 1029 }