github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1alpha2/device/device.pb.fieldmask.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/devices/proto/v1alpha2/device.proto 3 // DO NOT EDIT!!! 4 5 package device 6 7 import ( 8 "encoding/json" 9 "strings" 10 11 "google.golang.org/grpc/codes" 12 "google.golang.org/grpc/status" 13 "google.golang.org/protobuf/proto" 14 preflect "google.golang.org/protobuf/reflect/protoreflect" 15 googlefieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 16 17 gotenobject "github.com/cloudwan/goten-sdk/runtime/object" 18 ) 19 20 // proto imports 21 import ( 22 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1alpha2/project" 23 iam_attestation_domain "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/attestation_domain" 24 iam_iam_common "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/common" 25 iam_service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/service_account" 26 meta "github.com/cloudwan/goten-sdk/types/meta" 27 latlng "google.golang.org/genproto/googleapis/type/latlng" 28 durationpb "google.golang.org/protobuf/types/known/durationpb" 29 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 30 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 31 ) 32 33 // ensure the imports are used 34 var ( 35 _ = new(json.Marshaler) 36 _ = strings.Builder{} 37 38 _ = codes.NotFound 39 _ = status.Status{} 40 _ = new(proto.Message) 41 _ = new(preflect.Message) 42 _ = googlefieldmaskpb.FieldMask{} 43 44 _ = new(gotenobject.FieldMask) 45 ) 46 47 // make sure we're using proto imports 48 var ( 49 _ = &project.Project{} 50 _ = &iam_attestation_domain.AttestationDomain{} 51 _ = &iam_iam_common.PCR{} 52 _ = &iam_service_account.ServiceAccount{} 53 _ = &durationpb.Duration{} 54 _ = &fieldmaskpb.FieldMask{} 55 _ = ×tamppb.Timestamp{} 56 _ = &latlng.LatLng{} 57 _ = &meta.Meta{} 58 ) 59 60 type Device_FieldMask struct { 61 Paths []Device_FieldPath 62 } 63 64 func FullDevice_FieldMask() *Device_FieldMask { 65 res := &Device_FieldMask{} 66 res.Paths = append(res.Paths, &Device_FieldTerminalPath{selector: Device_FieldPathSelectorName}) 67 res.Paths = append(res.Paths, &Device_FieldTerminalPath{selector: Device_FieldPathSelectorMetadata}) 68 res.Paths = append(res.Paths, &Device_FieldTerminalPath{selector: Device_FieldPathSelectorSpec}) 69 res.Paths = append(res.Paths, &Device_FieldTerminalPath{selector: Device_FieldPathSelectorStatus}) 70 res.Paths = append(res.Paths, &Device_FieldTerminalPath{selector: Device_FieldPathSelectorPublicListingSpec}) 71 res.Paths = append(res.Paths, &Device_FieldTerminalPath{selector: Device_FieldPathSelectorDisplayName}) 72 return res 73 } 74 75 func (fieldMask *Device_FieldMask) String() string { 76 if fieldMask == nil { 77 return "<nil>" 78 } 79 pathsStr := make([]string, 0, len(fieldMask.Paths)) 80 for _, path := range fieldMask.Paths { 81 pathsStr = append(pathsStr, path.String()) 82 } 83 return strings.Join(pathsStr, ", ") 84 } 85 86 func (fieldMask *Device_FieldMask) IsFull() bool { 87 if fieldMask == nil { 88 return false 89 } 90 presentSelectors := make([]bool, 6) 91 for _, path := range fieldMask.Paths { 92 if asFinal, ok := path.(*Device_FieldTerminalPath); ok { 93 presentSelectors[int(asFinal.selector)] = true 94 } 95 } 96 for _, flag := range presentSelectors { 97 if !flag { 98 return false 99 } 100 } 101 return true 102 } 103 104 func (fieldMask *Device_FieldMask) ProtoReflect() preflect.Message { 105 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 106 return ParseDevice_FieldPath(raw) 107 }) 108 } 109 110 func (fieldMask *Device_FieldMask) ProtoMessage() {} 111 112 func (fieldMask *Device_FieldMask) Reset() { 113 if fieldMask != nil { 114 fieldMask.Paths = nil 115 } 116 } 117 118 func (fieldMask *Device_FieldMask) Subtract(other *Device_FieldMask) *Device_FieldMask { 119 result := &Device_FieldMask{} 120 removedSelectors := make([]bool, 6) 121 otherSubMasks := map[Device_FieldPathSelector]gotenobject.FieldMask{ 122 Device_FieldPathSelectorMetadata: &meta.Meta_FieldMask{}, 123 Device_FieldPathSelectorSpec: &Device_Spec_FieldMask{}, 124 Device_FieldPathSelectorStatus: &Device_Status_FieldMask{}, 125 Device_FieldPathSelectorPublicListingSpec: &Device_PublicListingSpec_FieldMask{}, 126 } 127 mySubMasks := map[Device_FieldPathSelector]gotenobject.FieldMask{ 128 Device_FieldPathSelectorMetadata: &meta.Meta_FieldMask{}, 129 Device_FieldPathSelectorSpec: &Device_Spec_FieldMask{}, 130 Device_FieldPathSelectorStatus: &Device_Status_FieldMask{}, 131 Device_FieldPathSelectorPublicListingSpec: &Device_PublicListingSpec_FieldMask{}, 132 } 133 134 for _, path := range other.GetPaths() { 135 switch tp := path.(type) { 136 case *Device_FieldTerminalPath: 137 removedSelectors[int(tp.selector)] = true 138 case *Device_FieldSubPath: 139 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 140 } 141 } 142 for _, path := range fieldMask.GetPaths() { 143 if !removedSelectors[int(path.Selector())] { 144 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 145 if tp, ok := path.(*Device_FieldTerminalPath); ok { 146 switch tp.selector { 147 case Device_FieldPathSelectorMetadata: 148 mySubMasks[Device_FieldPathSelectorMetadata] = meta.FullMeta_FieldMask() 149 case Device_FieldPathSelectorSpec: 150 mySubMasks[Device_FieldPathSelectorSpec] = FullDevice_Spec_FieldMask() 151 case Device_FieldPathSelectorStatus: 152 mySubMasks[Device_FieldPathSelectorStatus] = FullDevice_Status_FieldMask() 153 case Device_FieldPathSelectorPublicListingSpec: 154 mySubMasks[Device_FieldPathSelectorPublicListingSpec] = FullDevice_PublicListingSpec_FieldMask() 155 } 156 } else if tp, ok := path.(*Device_FieldSubPath); ok { 157 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 158 } 159 } else { 160 result.Paths = append(result.Paths, path) 161 } 162 } 163 } 164 for selector, mySubMask := range mySubMasks { 165 if mySubMask.PathsCount() > 0 { 166 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 167 result.Paths = append(result.Paths, &Device_FieldSubPath{selector: selector, subPath: allowedPath}) 168 } 169 } 170 } 171 172 if len(result.Paths) == 0 { 173 return nil 174 } 175 return result 176 } 177 178 func (fieldMask *Device_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 179 return fieldMask.Subtract(other.(*Device_FieldMask)) 180 } 181 182 // FilterInputFields generates copy of field paths with output_only field paths removed 183 func (fieldMask *Device_FieldMask) FilterInputFields() *Device_FieldMask { 184 result := &Device_FieldMask{} 185 for _, path := range fieldMask.Paths { 186 switch path.Selector() { 187 case Device_FieldPathSelectorMetadata: 188 if _, ok := path.(*Device_FieldTerminalPath); ok { 189 for _, subpath := range meta.FullMeta_FieldMask().FilterInputFields().Paths { 190 result.Paths = append(result.Paths, &Device_FieldSubPath{selector: path.Selector(), subPath: subpath}) 191 } 192 } else if sub, ok := path.(*Device_FieldSubPath); ok { 193 selectedMask := &meta.Meta_FieldMask{ 194 Paths: []meta.Meta_FieldPath{sub.subPath.(meta.Meta_FieldPath)}, 195 } 196 for _, allowedPath := range selectedMask.FilterInputFields().Paths { 197 result.Paths = append(result.Paths, &Device_FieldSubPath{selector: Device_FieldPathSelectorMetadata, subPath: allowedPath}) 198 } 199 } 200 default: 201 result.Paths = append(result.Paths, path) 202 } 203 } 204 return result 205 } 206 207 // ToFieldMask is used for proto conversions 208 func (fieldMask *Device_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 209 protoFieldMask := &googlefieldmaskpb.FieldMask{} 210 for _, path := range fieldMask.Paths { 211 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 212 } 213 return protoFieldMask 214 } 215 216 func (fieldMask *Device_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 217 if fieldMask == nil { 218 return status.Error(codes.Internal, "target field mask is nil") 219 } 220 fieldMask.Paths = make([]Device_FieldPath, 0, len(protoFieldMask.Paths)) 221 for _, strPath := range protoFieldMask.Paths { 222 path, err := ParseDevice_FieldPath(strPath) 223 if err != nil { 224 return err 225 } 226 fieldMask.Paths = append(fieldMask.Paths, path) 227 } 228 return nil 229 } 230 231 // implement methods required by customType 232 func (fieldMask Device_FieldMask) Marshal() ([]byte, error) { 233 protoFieldMask := fieldMask.ToProtoFieldMask() 234 return proto.Marshal(protoFieldMask) 235 } 236 237 func (fieldMask *Device_FieldMask) Unmarshal(data []byte) error { 238 protoFieldMask := &googlefieldmaskpb.FieldMask{} 239 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 240 return err 241 } 242 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 243 return err 244 } 245 return nil 246 } 247 248 func (fieldMask *Device_FieldMask) Size() int { 249 return proto.Size(fieldMask.ToProtoFieldMask()) 250 } 251 252 func (fieldMask Device_FieldMask) MarshalJSON() ([]byte, error) { 253 return json.Marshal(fieldMask.ToProtoFieldMask()) 254 } 255 256 func (fieldMask *Device_FieldMask) UnmarshalJSON(data []byte) error { 257 protoFieldMask := &googlefieldmaskpb.FieldMask{} 258 if err := json.Unmarshal(data, protoFieldMask); err != nil { 259 return err 260 } 261 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 262 return err 263 } 264 return nil 265 } 266 267 func (fieldMask *Device_FieldMask) AppendPath(path Device_FieldPath) { 268 fieldMask.Paths = append(fieldMask.Paths, path) 269 } 270 271 func (fieldMask *Device_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 272 fieldMask.Paths = append(fieldMask.Paths, path.(Device_FieldPath)) 273 } 274 275 func (fieldMask *Device_FieldMask) GetPaths() []Device_FieldPath { 276 if fieldMask == nil { 277 return nil 278 } 279 return fieldMask.Paths 280 } 281 282 func (fieldMask *Device_FieldMask) GetRawPaths() []gotenobject.FieldPath { 283 if fieldMask == nil { 284 return nil 285 } 286 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 287 for _, path := range fieldMask.Paths { 288 rawPaths = append(rawPaths, path) 289 } 290 return rawPaths 291 } 292 293 func (fieldMask *Device_FieldMask) SetFromCliFlag(raw string) error { 294 path, err := ParseDevice_FieldPath(raw) 295 if err != nil { 296 return err 297 } 298 fieldMask.Paths = append(fieldMask.Paths, path) 299 return nil 300 } 301 302 func (fieldMask *Device_FieldMask) Set(target, source *Device) { 303 for _, path := range fieldMask.Paths { 304 val, _ := path.GetSingle(source) 305 // if val is nil, then field does not exist in source, skip 306 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 307 if val != nil { 308 path.WithIValue(val).SetTo(&target) 309 } 310 } 311 } 312 313 func (fieldMask *Device_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 314 fieldMask.Set(target.(*Device), source.(*Device)) 315 } 316 317 func (fieldMask *Device_FieldMask) Project(source *Device) *Device { 318 if source == nil { 319 return nil 320 } 321 if fieldMask == nil { 322 return source 323 } 324 result := &Device{} 325 metadataMask := &meta.Meta_FieldMask{} 326 wholeMetadataAccepted := false 327 specMask := &Device_Spec_FieldMask{} 328 wholeSpecAccepted := false 329 statusMask := &Device_Status_FieldMask{} 330 wholeStatusAccepted := false 331 publicListingSpecMask := &Device_PublicListingSpec_FieldMask{} 332 wholePublicListingSpecAccepted := false 333 334 for _, p := range fieldMask.Paths { 335 switch tp := p.(type) { 336 case *Device_FieldTerminalPath: 337 switch tp.selector { 338 case Device_FieldPathSelectorName: 339 result.Name = source.Name 340 case Device_FieldPathSelectorMetadata: 341 result.Metadata = source.Metadata 342 wholeMetadataAccepted = true 343 case Device_FieldPathSelectorSpec: 344 result.Spec = source.Spec 345 wholeSpecAccepted = true 346 case Device_FieldPathSelectorStatus: 347 result.Status = source.Status 348 wholeStatusAccepted = true 349 case Device_FieldPathSelectorPublicListingSpec: 350 result.PublicListingSpec = source.PublicListingSpec 351 wholePublicListingSpecAccepted = true 352 case Device_FieldPathSelectorDisplayName: 353 result.DisplayName = source.DisplayName 354 } 355 case *Device_FieldSubPath: 356 switch tp.selector { 357 case Device_FieldPathSelectorMetadata: 358 metadataMask.AppendPath(tp.subPath.(meta.Meta_FieldPath)) 359 case Device_FieldPathSelectorSpec: 360 specMask.AppendPath(tp.subPath.(DeviceSpec_FieldPath)) 361 case Device_FieldPathSelectorStatus: 362 statusMask.AppendPath(tp.subPath.(DeviceStatus_FieldPath)) 363 case Device_FieldPathSelectorPublicListingSpec: 364 publicListingSpecMask.AppendPath(tp.subPath.(DevicePublicListingSpec_FieldPath)) 365 } 366 } 367 } 368 if wholeMetadataAccepted == false && len(metadataMask.Paths) > 0 { 369 result.Metadata = metadataMask.Project(source.GetMetadata()) 370 } 371 if wholeSpecAccepted == false && len(specMask.Paths) > 0 { 372 result.Spec = specMask.Project(source.GetSpec()) 373 } 374 if wholeStatusAccepted == false && len(statusMask.Paths) > 0 { 375 result.Status = statusMask.Project(source.GetStatus()) 376 } 377 if wholePublicListingSpecAccepted == false && len(publicListingSpecMask.Paths) > 0 { 378 result.PublicListingSpec = publicListingSpecMask.Project(source.GetPublicListingSpec()) 379 } 380 return result 381 } 382 383 func (fieldMask *Device_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 384 return fieldMask.Project(source.(*Device)) 385 } 386 387 func (fieldMask *Device_FieldMask) PathsCount() int { 388 if fieldMask == nil { 389 return 0 390 } 391 return len(fieldMask.Paths) 392 } 393 394 type Device_Spec_FieldMask struct { 395 Paths []DeviceSpec_FieldPath 396 } 397 398 func FullDevice_Spec_FieldMask() *Device_Spec_FieldMask { 399 res := &Device_Spec_FieldMask{} 400 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorServiceAccount}) 401 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorOsVersion}) 402 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorNetplanConfig}) 403 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorNetplanApiConfigMode}) 404 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorOsImageUrl}) 405 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorSshConfig}) 406 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorAttestationConfig}) 407 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorDisableDeviceDiscovery}) 408 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorLoggingConfig}) 409 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorProxyConfig}) 410 res.Paths = append(res.Paths, &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorLocation}) 411 return res 412 } 413 414 func (fieldMask *Device_Spec_FieldMask) String() string { 415 if fieldMask == nil { 416 return "<nil>" 417 } 418 pathsStr := make([]string, 0, len(fieldMask.Paths)) 419 for _, path := range fieldMask.Paths { 420 pathsStr = append(pathsStr, path.String()) 421 } 422 return strings.Join(pathsStr, ", ") 423 } 424 425 func (fieldMask *Device_Spec_FieldMask) IsFull() bool { 426 if fieldMask == nil { 427 return false 428 } 429 presentSelectors := make([]bool, 11) 430 for _, path := range fieldMask.Paths { 431 if asFinal, ok := path.(*DeviceSpec_FieldTerminalPath); ok { 432 presentSelectors[int(asFinal.selector)] = true 433 } 434 } 435 for _, flag := range presentSelectors { 436 if !flag { 437 return false 438 } 439 } 440 return true 441 } 442 443 func (fieldMask *Device_Spec_FieldMask) ProtoReflect() preflect.Message { 444 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 445 return ParseDeviceSpec_FieldPath(raw) 446 }) 447 } 448 449 func (fieldMask *Device_Spec_FieldMask) ProtoMessage() {} 450 451 func (fieldMask *Device_Spec_FieldMask) Reset() { 452 if fieldMask != nil { 453 fieldMask.Paths = nil 454 } 455 } 456 457 func (fieldMask *Device_Spec_FieldMask) Subtract(other *Device_Spec_FieldMask) *Device_Spec_FieldMask { 458 result := &Device_Spec_FieldMask{} 459 removedSelectors := make([]bool, 11) 460 otherSubMasks := map[DeviceSpec_FieldPathSelector]gotenobject.FieldMask{ 461 DeviceSpec_FieldPathSelectorNetplanConfig: &Device_Spec_NetplanConfig_FieldMask{}, 462 DeviceSpec_FieldPathSelectorSshConfig: &Device_Spec_SSHConfig_FieldMask{}, 463 DeviceSpec_FieldPathSelectorAttestationConfig: &Device_Spec_AttestationConfig_FieldMask{}, 464 DeviceSpec_FieldPathSelectorLoggingConfig: &Device_Spec_LoggingConfig_FieldMask{}, 465 DeviceSpec_FieldPathSelectorProxyConfig: &Device_Spec_ProxyConfig_FieldMask{}, 466 DeviceSpec_FieldPathSelectorLocation: &Device_Spec_Location_FieldMask{}, 467 } 468 mySubMasks := map[DeviceSpec_FieldPathSelector]gotenobject.FieldMask{ 469 DeviceSpec_FieldPathSelectorNetplanConfig: &Device_Spec_NetplanConfig_FieldMask{}, 470 DeviceSpec_FieldPathSelectorSshConfig: &Device_Spec_SSHConfig_FieldMask{}, 471 DeviceSpec_FieldPathSelectorAttestationConfig: &Device_Spec_AttestationConfig_FieldMask{}, 472 DeviceSpec_FieldPathSelectorLoggingConfig: &Device_Spec_LoggingConfig_FieldMask{}, 473 DeviceSpec_FieldPathSelectorProxyConfig: &Device_Spec_ProxyConfig_FieldMask{}, 474 DeviceSpec_FieldPathSelectorLocation: &Device_Spec_Location_FieldMask{}, 475 } 476 477 for _, path := range other.GetPaths() { 478 switch tp := path.(type) { 479 case *DeviceSpec_FieldTerminalPath: 480 removedSelectors[int(tp.selector)] = true 481 case *DeviceSpec_FieldSubPath: 482 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 483 } 484 } 485 for _, path := range fieldMask.GetPaths() { 486 if !removedSelectors[int(path.Selector())] { 487 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 488 if tp, ok := path.(*DeviceSpec_FieldTerminalPath); ok { 489 switch tp.selector { 490 case DeviceSpec_FieldPathSelectorNetplanConfig: 491 mySubMasks[DeviceSpec_FieldPathSelectorNetplanConfig] = FullDevice_Spec_NetplanConfig_FieldMask() 492 case DeviceSpec_FieldPathSelectorSshConfig: 493 mySubMasks[DeviceSpec_FieldPathSelectorSshConfig] = FullDevice_Spec_SSHConfig_FieldMask() 494 case DeviceSpec_FieldPathSelectorAttestationConfig: 495 mySubMasks[DeviceSpec_FieldPathSelectorAttestationConfig] = FullDevice_Spec_AttestationConfig_FieldMask() 496 case DeviceSpec_FieldPathSelectorLoggingConfig: 497 mySubMasks[DeviceSpec_FieldPathSelectorLoggingConfig] = FullDevice_Spec_LoggingConfig_FieldMask() 498 case DeviceSpec_FieldPathSelectorProxyConfig: 499 mySubMasks[DeviceSpec_FieldPathSelectorProxyConfig] = FullDevice_Spec_ProxyConfig_FieldMask() 500 case DeviceSpec_FieldPathSelectorLocation: 501 mySubMasks[DeviceSpec_FieldPathSelectorLocation] = FullDevice_Spec_Location_FieldMask() 502 } 503 } else if tp, ok := path.(*DeviceSpec_FieldSubPath); ok { 504 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 505 } 506 } else { 507 result.Paths = append(result.Paths, path) 508 } 509 } 510 } 511 for selector, mySubMask := range mySubMasks { 512 if mySubMask.PathsCount() > 0 { 513 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 514 result.Paths = append(result.Paths, &DeviceSpec_FieldSubPath{selector: selector, subPath: allowedPath}) 515 } 516 } 517 } 518 519 if len(result.Paths) == 0 { 520 return nil 521 } 522 return result 523 } 524 525 func (fieldMask *Device_Spec_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 526 return fieldMask.Subtract(other.(*Device_Spec_FieldMask)) 527 } 528 529 // FilterInputFields generates copy of field paths with output_only field paths removed 530 func (fieldMask *Device_Spec_FieldMask) FilterInputFields() *Device_Spec_FieldMask { 531 result := &Device_Spec_FieldMask{} 532 result.Paths = append(result.Paths, fieldMask.Paths...) 533 return result 534 } 535 536 // ToFieldMask is used for proto conversions 537 func (fieldMask *Device_Spec_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 538 protoFieldMask := &googlefieldmaskpb.FieldMask{} 539 for _, path := range fieldMask.Paths { 540 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 541 } 542 return protoFieldMask 543 } 544 545 func (fieldMask *Device_Spec_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 546 if fieldMask == nil { 547 return status.Error(codes.Internal, "target field mask is nil") 548 } 549 fieldMask.Paths = make([]DeviceSpec_FieldPath, 0, len(protoFieldMask.Paths)) 550 for _, strPath := range protoFieldMask.Paths { 551 path, err := ParseDeviceSpec_FieldPath(strPath) 552 if err != nil { 553 return err 554 } 555 fieldMask.Paths = append(fieldMask.Paths, path) 556 } 557 return nil 558 } 559 560 // implement methods required by customType 561 func (fieldMask Device_Spec_FieldMask) Marshal() ([]byte, error) { 562 protoFieldMask := fieldMask.ToProtoFieldMask() 563 return proto.Marshal(protoFieldMask) 564 } 565 566 func (fieldMask *Device_Spec_FieldMask) Unmarshal(data []byte) error { 567 protoFieldMask := &googlefieldmaskpb.FieldMask{} 568 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 569 return err 570 } 571 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 572 return err 573 } 574 return nil 575 } 576 577 func (fieldMask *Device_Spec_FieldMask) Size() int { 578 return proto.Size(fieldMask.ToProtoFieldMask()) 579 } 580 581 func (fieldMask Device_Spec_FieldMask) MarshalJSON() ([]byte, error) { 582 return json.Marshal(fieldMask.ToProtoFieldMask()) 583 } 584 585 func (fieldMask *Device_Spec_FieldMask) UnmarshalJSON(data []byte) error { 586 protoFieldMask := &googlefieldmaskpb.FieldMask{} 587 if err := json.Unmarshal(data, protoFieldMask); err != nil { 588 return err 589 } 590 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 591 return err 592 } 593 return nil 594 } 595 596 func (fieldMask *Device_Spec_FieldMask) AppendPath(path DeviceSpec_FieldPath) { 597 fieldMask.Paths = append(fieldMask.Paths, path) 598 } 599 600 func (fieldMask *Device_Spec_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 601 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpec_FieldPath)) 602 } 603 604 func (fieldMask *Device_Spec_FieldMask) GetPaths() []DeviceSpec_FieldPath { 605 if fieldMask == nil { 606 return nil 607 } 608 return fieldMask.Paths 609 } 610 611 func (fieldMask *Device_Spec_FieldMask) GetRawPaths() []gotenobject.FieldPath { 612 if fieldMask == nil { 613 return nil 614 } 615 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 616 for _, path := range fieldMask.Paths { 617 rawPaths = append(rawPaths, path) 618 } 619 return rawPaths 620 } 621 622 func (fieldMask *Device_Spec_FieldMask) SetFromCliFlag(raw string) error { 623 path, err := ParseDeviceSpec_FieldPath(raw) 624 if err != nil { 625 return err 626 } 627 fieldMask.Paths = append(fieldMask.Paths, path) 628 return nil 629 } 630 631 func (fieldMask *Device_Spec_FieldMask) Set(target, source *Device_Spec) { 632 for _, path := range fieldMask.Paths { 633 val, _ := path.GetSingle(source) 634 // if val is nil, then field does not exist in source, skip 635 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 636 if val != nil { 637 path.WithIValue(val).SetTo(&target) 638 } 639 } 640 } 641 642 func (fieldMask *Device_Spec_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 643 fieldMask.Set(target.(*Device_Spec), source.(*Device_Spec)) 644 } 645 646 func (fieldMask *Device_Spec_FieldMask) Project(source *Device_Spec) *Device_Spec { 647 if source == nil { 648 return nil 649 } 650 if fieldMask == nil { 651 return source 652 } 653 result := &Device_Spec{} 654 netplanConfigMask := &Device_Spec_NetplanConfig_FieldMask{} 655 wholeNetplanConfigAccepted := false 656 sshConfigMask := &Device_Spec_SSHConfig_FieldMask{} 657 wholeSshConfigAccepted := false 658 attestationConfigMask := &Device_Spec_AttestationConfig_FieldMask{} 659 wholeAttestationConfigAccepted := false 660 loggingConfigMask := &Device_Spec_LoggingConfig_FieldMask{} 661 wholeLoggingConfigAccepted := false 662 proxyConfigMask := &Device_Spec_ProxyConfig_FieldMask{} 663 wholeProxyConfigAccepted := false 664 locationMask := &Device_Spec_Location_FieldMask{} 665 wholeLocationAccepted := false 666 667 for _, p := range fieldMask.Paths { 668 switch tp := p.(type) { 669 case *DeviceSpec_FieldTerminalPath: 670 switch tp.selector { 671 case DeviceSpec_FieldPathSelectorServiceAccount: 672 result.ServiceAccount = source.ServiceAccount 673 case DeviceSpec_FieldPathSelectorOsVersion: 674 result.OsVersion = source.OsVersion 675 case DeviceSpec_FieldPathSelectorNetplanConfig: 676 result.NetplanConfig = source.NetplanConfig 677 wholeNetplanConfigAccepted = true 678 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 679 result.NetplanApiConfigMode = source.NetplanApiConfigMode 680 case DeviceSpec_FieldPathSelectorOsImageUrl: 681 result.OsImageUrl = source.OsImageUrl 682 case DeviceSpec_FieldPathSelectorSshConfig: 683 result.SshConfig = source.SshConfig 684 wholeSshConfigAccepted = true 685 case DeviceSpec_FieldPathSelectorAttestationConfig: 686 result.AttestationConfig = source.AttestationConfig 687 wholeAttestationConfigAccepted = true 688 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 689 result.DisableDeviceDiscovery = source.DisableDeviceDiscovery 690 case DeviceSpec_FieldPathSelectorLoggingConfig: 691 result.LoggingConfig = source.LoggingConfig 692 wholeLoggingConfigAccepted = true 693 case DeviceSpec_FieldPathSelectorProxyConfig: 694 result.ProxyConfig = source.ProxyConfig 695 wholeProxyConfigAccepted = true 696 case DeviceSpec_FieldPathSelectorLocation: 697 result.Location = source.Location 698 wholeLocationAccepted = true 699 } 700 case *DeviceSpec_FieldSubPath: 701 switch tp.selector { 702 case DeviceSpec_FieldPathSelectorNetplanConfig: 703 netplanConfigMask.AppendPath(tp.subPath.(DeviceSpecNetplanConfig_FieldPath)) 704 case DeviceSpec_FieldPathSelectorSshConfig: 705 sshConfigMask.AppendPath(tp.subPath.(DeviceSpecSSHConfig_FieldPath)) 706 case DeviceSpec_FieldPathSelectorAttestationConfig: 707 attestationConfigMask.AppendPath(tp.subPath.(DeviceSpecAttestationConfig_FieldPath)) 708 case DeviceSpec_FieldPathSelectorLoggingConfig: 709 loggingConfigMask.AppendPath(tp.subPath.(DeviceSpecLoggingConfig_FieldPath)) 710 case DeviceSpec_FieldPathSelectorProxyConfig: 711 proxyConfigMask.AppendPath(tp.subPath.(DeviceSpecProxyConfig_FieldPath)) 712 case DeviceSpec_FieldPathSelectorLocation: 713 locationMask.AppendPath(tp.subPath.(DeviceSpecLocation_FieldPath)) 714 } 715 } 716 } 717 if wholeNetplanConfigAccepted == false && len(netplanConfigMask.Paths) > 0 { 718 result.NetplanConfig = netplanConfigMask.Project(source.GetNetplanConfig()) 719 } 720 if wholeSshConfigAccepted == false && len(sshConfigMask.Paths) > 0 { 721 result.SshConfig = sshConfigMask.Project(source.GetSshConfig()) 722 } 723 if wholeAttestationConfigAccepted == false && len(attestationConfigMask.Paths) > 0 { 724 result.AttestationConfig = attestationConfigMask.Project(source.GetAttestationConfig()) 725 } 726 if wholeLoggingConfigAccepted == false && len(loggingConfigMask.Paths) > 0 { 727 result.LoggingConfig = loggingConfigMask.Project(source.GetLoggingConfig()) 728 } 729 if wholeProxyConfigAccepted == false && len(proxyConfigMask.Paths) > 0 { 730 result.ProxyConfig = proxyConfigMask.Project(source.GetProxyConfig()) 731 } 732 if wholeLocationAccepted == false && len(locationMask.Paths) > 0 { 733 result.Location = locationMask.Project(source.GetLocation()) 734 } 735 return result 736 } 737 738 func (fieldMask *Device_Spec_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 739 return fieldMask.Project(source.(*Device_Spec)) 740 } 741 742 func (fieldMask *Device_Spec_FieldMask) PathsCount() int { 743 if fieldMask == nil { 744 return 0 745 } 746 return len(fieldMask.Paths) 747 } 748 749 type Device_Status_FieldMask struct { 750 Paths []DeviceStatus_FieldPath 751 } 752 753 func FullDevice_Status_FieldMask() *Device_Status_FieldMask { 754 res := &Device_Status_FieldMask{} 755 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorAddresses}) 756 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorConditions}) 757 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorNetworkConfigState}) 758 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorProxyConfigStatus}) 759 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorDeviceInfo}) 760 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorAttestationStatus}) 761 res.Paths = append(res.Paths, &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorNormalizedAddress}) 762 return res 763 } 764 765 func (fieldMask *Device_Status_FieldMask) String() string { 766 if fieldMask == nil { 767 return "<nil>" 768 } 769 pathsStr := make([]string, 0, len(fieldMask.Paths)) 770 for _, path := range fieldMask.Paths { 771 pathsStr = append(pathsStr, path.String()) 772 } 773 return strings.Join(pathsStr, ", ") 774 } 775 776 func (fieldMask *Device_Status_FieldMask) IsFull() bool { 777 if fieldMask == nil { 778 return false 779 } 780 presentSelectors := make([]bool, 7) 781 for _, path := range fieldMask.Paths { 782 if asFinal, ok := path.(*DeviceStatus_FieldTerminalPath); ok { 783 presentSelectors[int(asFinal.selector)] = true 784 } 785 } 786 for _, flag := range presentSelectors { 787 if !flag { 788 return false 789 } 790 } 791 return true 792 } 793 794 func (fieldMask *Device_Status_FieldMask) ProtoReflect() preflect.Message { 795 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 796 return ParseDeviceStatus_FieldPath(raw) 797 }) 798 } 799 800 func (fieldMask *Device_Status_FieldMask) ProtoMessage() {} 801 802 func (fieldMask *Device_Status_FieldMask) Reset() { 803 if fieldMask != nil { 804 fieldMask.Paths = nil 805 } 806 } 807 808 func (fieldMask *Device_Status_FieldMask) Subtract(other *Device_Status_FieldMask) *Device_Status_FieldMask { 809 result := &Device_Status_FieldMask{} 810 removedSelectors := make([]bool, 7) 811 otherSubMasks := map[DeviceStatus_FieldPathSelector]gotenobject.FieldMask{ 812 DeviceStatus_FieldPathSelectorAddresses: &Device_Status_Address_FieldMask{}, 813 DeviceStatus_FieldPathSelectorConditions: &Device_Status_Condition_FieldMask{}, 814 DeviceStatus_FieldPathSelectorNetworkConfigState: &Device_Status_NetworkConfigState_FieldMask{}, 815 DeviceStatus_FieldPathSelectorProxyConfigStatus: &Device_Status_ProxyConfigStatus_FieldMask{}, 816 DeviceStatus_FieldPathSelectorDeviceInfo: &Device_Status_DeviceInfo_FieldMask{}, 817 DeviceStatus_FieldPathSelectorAttestationStatus: &iam_iam_common.PCR_FieldMask{}, 818 DeviceStatus_FieldPathSelectorNormalizedAddress: &Device_Status_NormalizedAddress_FieldMask{}, 819 } 820 mySubMasks := map[DeviceStatus_FieldPathSelector]gotenobject.FieldMask{ 821 DeviceStatus_FieldPathSelectorAddresses: &Device_Status_Address_FieldMask{}, 822 DeviceStatus_FieldPathSelectorConditions: &Device_Status_Condition_FieldMask{}, 823 DeviceStatus_FieldPathSelectorNetworkConfigState: &Device_Status_NetworkConfigState_FieldMask{}, 824 DeviceStatus_FieldPathSelectorProxyConfigStatus: &Device_Status_ProxyConfigStatus_FieldMask{}, 825 DeviceStatus_FieldPathSelectorDeviceInfo: &Device_Status_DeviceInfo_FieldMask{}, 826 DeviceStatus_FieldPathSelectorAttestationStatus: &iam_iam_common.PCR_FieldMask{}, 827 DeviceStatus_FieldPathSelectorNormalizedAddress: &Device_Status_NormalizedAddress_FieldMask{}, 828 } 829 830 for _, path := range other.GetPaths() { 831 switch tp := path.(type) { 832 case *DeviceStatus_FieldTerminalPath: 833 removedSelectors[int(tp.selector)] = true 834 case *DeviceStatus_FieldSubPath: 835 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 836 } 837 } 838 for _, path := range fieldMask.GetPaths() { 839 if !removedSelectors[int(path.Selector())] { 840 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 841 if tp, ok := path.(*DeviceStatus_FieldTerminalPath); ok { 842 switch tp.selector { 843 case DeviceStatus_FieldPathSelectorAddresses: 844 mySubMasks[DeviceStatus_FieldPathSelectorAddresses] = FullDevice_Status_Address_FieldMask() 845 case DeviceStatus_FieldPathSelectorConditions: 846 mySubMasks[DeviceStatus_FieldPathSelectorConditions] = FullDevice_Status_Condition_FieldMask() 847 case DeviceStatus_FieldPathSelectorNetworkConfigState: 848 mySubMasks[DeviceStatus_FieldPathSelectorNetworkConfigState] = FullDevice_Status_NetworkConfigState_FieldMask() 849 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 850 mySubMasks[DeviceStatus_FieldPathSelectorProxyConfigStatus] = FullDevice_Status_ProxyConfigStatus_FieldMask() 851 case DeviceStatus_FieldPathSelectorDeviceInfo: 852 mySubMasks[DeviceStatus_FieldPathSelectorDeviceInfo] = FullDevice_Status_DeviceInfo_FieldMask() 853 case DeviceStatus_FieldPathSelectorAttestationStatus: 854 mySubMasks[DeviceStatus_FieldPathSelectorAttestationStatus] = iam_iam_common.FullPCR_FieldMask() 855 case DeviceStatus_FieldPathSelectorNormalizedAddress: 856 mySubMasks[DeviceStatus_FieldPathSelectorNormalizedAddress] = FullDevice_Status_NormalizedAddress_FieldMask() 857 } 858 } else if tp, ok := path.(*DeviceStatus_FieldSubPath); ok { 859 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 860 } 861 } else { 862 result.Paths = append(result.Paths, path) 863 } 864 } 865 } 866 for selector, mySubMask := range mySubMasks { 867 if mySubMask.PathsCount() > 0 { 868 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 869 result.Paths = append(result.Paths, &DeviceStatus_FieldSubPath{selector: selector, subPath: allowedPath}) 870 } 871 } 872 } 873 874 if len(result.Paths) == 0 { 875 return nil 876 } 877 return result 878 } 879 880 func (fieldMask *Device_Status_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 881 return fieldMask.Subtract(other.(*Device_Status_FieldMask)) 882 } 883 884 // FilterInputFields generates copy of field paths with output_only field paths removed 885 func (fieldMask *Device_Status_FieldMask) FilterInputFields() *Device_Status_FieldMask { 886 result := &Device_Status_FieldMask{} 887 result.Paths = append(result.Paths, fieldMask.Paths...) 888 return result 889 } 890 891 // ToFieldMask is used for proto conversions 892 func (fieldMask *Device_Status_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 893 protoFieldMask := &googlefieldmaskpb.FieldMask{} 894 for _, path := range fieldMask.Paths { 895 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 896 } 897 return protoFieldMask 898 } 899 900 func (fieldMask *Device_Status_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 901 if fieldMask == nil { 902 return status.Error(codes.Internal, "target field mask is nil") 903 } 904 fieldMask.Paths = make([]DeviceStatus_FieldPath, 0, len(protoFieldMask.Paths)) 905 for _, strPath := range protoFieldMask.Paths { 906 path, err := ParseDeviceStatus_FieldPath(strPath) 907 if err != nil { 908 return err 909 } 910 fieldMask.Paths = append(fieldMask.Paths, path) 911 } 912 return nil 913 } 914 915 // implement methods required by customType 916 func (fieldMask Device_Status_FieldMask) Marshal() ([]byte, error) { 917 protoFieldMask := fieldMask.ToProtoFieldMask() 918 return proto.Marshal(protoFieldMask) 919 } 920 921 func (fieldMask *Device_Status_FieldMask) Unmarshal(data []byte) error { 922 protoFieldMask := &googlefieldmaskpb.FieldMask{} 923 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 924 return err 925 } 926 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 927 return err 928 } 929 return nil 930 } 931 932 func (fieldMask *Device_Status_FieldMask) Size() int { 933 return proto.Size(fieldMask.ToProtoFieldMask()) 934 } 935 936 func (fieldMask Device_Status_FieldMask) MarshalJSON() ([]byte, error) { 937 return json.Marshal(fieldMask.ToProtoFieldMask()) 938 } 939 940 func (fieldMask *Device_Status_FieldMask) UnmarshalJSON(data []byte) error { 941 protoFieldMask := &googlefieldmaskpb.FieldMask{} 942 if err := json.Unmarshal(data, protoFieldMask); err != nil { 943 return err 944 } 945 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 946 return err 947 } 948 return nil 949 } 950 951 func (fieldMask *Device_Status_FieldMask) AppendPath(path DeviceStatus_FieldPath) { 952 fieldMask.Paths = append(fieldMask.Paths, path) 953 } 954 955 func (fieldMask *Device_Status_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 956 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatus_FieldPath)) 957 } 958 959 func (fieldMask *Device_Status_FieldMask) GetPaths() []DeviceStatus_FieldPath { 960 if fieldMask == nil { 961 return nil 962 } 963 return fieldMask.Paths 964 } 965 966 func (fieldMask *Device_Status_FieldMask) GetRawPaths() []gotenobject.FieldPath { 967 if fieldMask == nil { 968 return nil 969 } 970 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 971 for _, path := range fieldMask.Paths { 972 rawPaths = append(rawPaths, path) 973 } 974 return rawPaths 975 } 976 977 func (fieldMask *Device_Status_FieldMask) SetFromCliFlag(raw string) error { 978 path, err := ParseDeviceStatus_FieldPath(raw) 979 if err != nil { 980 return err 981 } 982 fieldMask.Paths = append(fieldMask.Paths, path) 983 return nil 984 } 985 986 func (fieldMask *Device_Status_FieldMask) Set(target, source *Device_Status) { 987 for _, path := range fieldMask.Paths { 988 val, _ := path.GetSingle(source) 989 // if val is nil, then field does not exist in source, skip 990 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 991 if val != nil { 992 path.WithIValue(val).SetTo(&target) 993 } 994 } 995 } 996 997 func (fieldMask *Device_Status_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 998 fieldMask.Set(target.(*Device_Status), source.(*Device_Status)) 999 } 1000 1001 func (fieldMask *Device_Status_FieldMask) Project(source *Device_Status) *Device_Status { 1002 if source == nil { 1003 return nil 1004 } 1005 if fieldMask == nil { 1006 return source 1007 } 1008 result := &Device_Status{} 1009 addressesMask := &Device_Status_Address_FieldMask{} 1010 wholeAddressesAccepted := false 1011 conditionsMask := &Device_Status_Condition_FieldMask{} 1012 wholeConditionsAccepted := false 1013 networkConfigStateMask := &Device_Status_NetworkConfigState_FieldMask{} 1014 wholeNetworkConfigStateAccepted := false 1015 proxyConfigStatusMask := &Device_Status_ProxyConfigStatus_FieldMask{} 1016 wholeProxyConfigStatusAccepted := false 1017 deviceInfoMask := &Device_Status_DeviceInfo_FieldMask{} 1018 wholeDeviceInfoAccepted := false 1019 attestationStatusMask := &iam_iam_common.PCR_FieldMask{} 1020 wholeAttestationStatusAccepted := false 1021 normalizedAddressMask := &Device_Status_NormalizedAddress_FieldMask{} 1022 wholeNormalizedAddressAccepted := false 1023 1024 for _, p := range fieldMask.Paths { 1025 switch tp := p.(type) { 1026 case *DeviceStatus_FieldTerminalPath: 1027 switch tp.selector { 1028 case DeviceStatus_FieldPathSelectorAddresses: 1029 result.Addresses = source.Addresses 1030 wholeAddressesAccepted = true 1031 case DeviceStatus_FieldPathSelectorConditions: 1032 result.Conditions = source.Conditions 1033 wholeConditionsAccepted = true 1034 case DeviceStatus_FieldPathSelectorNetworkConfigState: 1035 result.NetworkConfigState = source.NetworkConfigState 1036 wholeNetworkConfigStateAccepted = true 1037 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 1038 result.ProxyConfigStatus = source.ProxyConfigStatus 1039 wholeProxyConfigStatusAccepted = true 1040 case DeviceStatus_FieldPathSelectorDeviceInfo: 1041 result.DeviceInfo = source.DeviceInfo 1042 wholeDeviceInfoAccepted = true 1043 case DeviceStatus_FieldPathSelectorAttestationStatus: 1044 result.AttestationStatus = source.AttestationStatus 1045 wholeAttestationStatusAccepted = true 1046 case DeviceStatus_FieldPathSelectorNormalizedAddress: 1047 result.NormalizedAddress = source.NormalizedAddress 1048 wholeNormalizedAddressAccepted = true 1049 } 1050 case *DeviceStatus_FieldSubPath: 1051 switch tp.selector { 1052 case DeviceStatus_FieldPathSelectorAddresses: 1053 addressesMask.AppendPath(tp.subPath.(DeviceStatusAddress_FieldPath)) 1054 case DeviceStatus_FieldPathSelectorConditions: 1055 conditionsMask.AppendPath(tp.subPath.(DeviceStatusCondition_FieldPath)) 1056 case DeviceStatus_FieldPathSelectorNetworkConfigState: 1057 networkConfigStateMask.AppendPath(tp.subPath.(DeviceStatusNetworkConfigState_FieldPath)) 1058 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 1059 proxyConfigStatusMask.AppendPath(tp.subPath.(DeviceStatusProxyConfigStatus_FieldPath)) 1060 case DeviceStatus_FieldPathSelectorDeviceInfo: 1061 deviceInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfo_FieldPath)) 1062 case DeviceStatus_FieldPathSelectorAttestationStatus: 1063 attestationStatusMask.AppendPath(tp.subPath.(iam_iam_common.PCR_FieldPath)) 1064 case DeviceStatus_FieldPathSelectorNormalizedAddress: 1065 normalizedAddressMask.AppendPath(tp.subPath.(DeviceStatusNormalizedAddress_FieldPath)) 1066 } 1067 } 1068 } 1069 if wholeAddressesAccepted == false && len(addressesMask.Paths) > 0 { 1070 for _, sourceItem := range source.GetAddresses() { 1071 result.Addresses = append(result.Addresses, addressesMask.Project(sourceItem)) 1072 } 1073 } 1074 if wholeConditionsAccepted == false && len(conditionsMask.Paths) > 0 { 1075 for _, sourceItem := range source.GetConditions() { 1076 result.Conditions = append(result.Conditions, conditionsMask.Project(sourceItem)) 1077 } 1078 } 1079 if wholeNetworkConfigStateAccepted == false && len(networkConfigStateMask.Paths) > 0 { 1080 result.NetworkConfigState = networkConfigStateMask.Project(source.GetNetworkConfigState()) 1081 } 1082 if wholeProxyConfigStatusAccepted == false && len(proxyConfigStatusMask.Paths) > 0 { 1083 result.ProxyConfigStatus = proxyConfigStatusMask.Project(source.GetProxyConfigStatus()) 1084 } 1085 if wholeDeviceInfoAccepted == false && len(deviceInfoMask.Paths) > 0 { 1086 result.DeviceInfo = deviceInfoMask.Project(source.GetDeviceInfo()) 1087 } 1088 if wholeAttestationStatusAccepted == false && len(attestationStatusMask.Paths) > 0 { 1089 for _, sourceItem := range source.GetAttestationStatus() { 1090 result.AttestationStatus = append(result.AttestationStatus, attestationStatusMask.Project(sourceItem)) 1091 } 1092 } 1093 if wholeNormalizedAddressAccepted == false && len(normalizedAddressMask.Paths) > 0 { 1094 result.NormalizedAddress = normalizedAddressMask.Project(source.GetNormalizedAddress()) 1095 } 1096 return result 1097 } 1098 1099 func (fieldMask *Device_Status_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 1100 return fieldMask.Project(source.(*Device_Status)) 1101 } 1102 1103 func (fieldMask *Device_Status_FieldMask) PathsCount() int { 1104 if fieldMask == nil { 1105 return 0 1106 } 1107 return len(fieldMask.Paths) 1108 } 1109 1110 type Device_PublicListingSpec_FieldMask struct { 1111 Paths []DevicePublicListingSpec_FieldPath 1112 } 1113 1114 func FullDevice_PublicListingSpec_FieldMask() *Device_PublicListingSpec_FieldMask { 1115 res := &Device_PublicListingSpec_FieldMask{} 1116 res.Paths = append(res.Paths, &DevicePublicListingSpec_FieldTerminalPath{selector: DevicePublicListingSpec_FieldPathSelectorEnabled}) 1117 res.Paths = append(res.Paths, &DevicePublicListingSpec_FieldTerminalPath{selector: DevicePublicListingSpec_FieldPathSelectorFieldMask}) 1118 return res 1119 } 1120 1121 func (fieldMask *Device_PublicListingSpec_FieldMask) String() string { 1122 if fieldMask == nil { 1123 return "<nil>" 1124 } 1125 pathsStr := make([]string, 0, len(fieldMask.Paths)) 1126 for _, path := range fieldMask.Paths { 1127 pathsStr = append(pathsStr, path.String()) 1128 } 1129 return strings.Join(pathsStr, ", ") 1130 } 1131 1132 func (fieldMask *Device_PublicListingSpec_FieldMask) IsFull() bool { 1133 if fieldMask == nil { 1134 return false 1135 } 1136 presentSelectors := make([]bool, 2) 1137 for _, path := range fieldMask.Paths { 1138 if asFinal, ok := path.(*DevicePublicListingSpec_FieldTerminalPath); ok { 1139 presentSelectors[int(asFinal.selector)] = true 1140 } 1141 } 1142 for _, flag := range presentSelectors { 1143 if !flag { 1144 return false 1145 } 1146 } 1147 return true 1148 } 1149 1150 func (fieldMask *Device_PublicListingSpec_FieldMask) ProtoReflect() preflect.Message { 1151 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 1152 return ParseDevicePublicListingSpec_FieldPath(raw) 1153 }) 1154 } 1155 1156 func (fieldMask *Device_PublicListingSpec_FieldMask) ProtoMessage() {} 1157 1158 func (fieldMask *Device_PublicListingSpec_FieldMask) Reset() { 1159 if fieldMask != nil { 1160 fieldMask.Paths = nil 1161 } 1162 } 1163 1164 func (fieldMask *Device_PublicListingSpec_FieldMask) Subtract(other *Device_PublicListingSpec_FieldMask) *Device_PublicListingSpec_FieldMask { 1165 result := &Device_PublicListingSpec_FieldMask{} 1166 removedSelectors := make([]bool, 2) 1167 1168 for _, path := range other.GetPaths() { 1169 switch tp := path.(type) { 1170 case *DevicePublicListingSpec_FieldTerminalPath: 1171 removedSelectors[int(tp.selector)] = true 1172 } 1173 } 1174 for _, path := range fieldMask.GetPaths() { 1175 if !removedSelectors[int(path.Selector())] { 1176 result.Paths = append(result.Paths, path) 1177 } 1178 } 1179 1180 if len(result.Paths) == 0 { 1181 return nil 1182 } 1183 return result 1184 } 1185 1186 func (fieldMask *Device_PublicListingSpec_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 1187 return fieldMask.Subtract(other.(*Device_PublicListingSpec_FieldMask)) 1188 } 1189 1190 // FilterInputFields generates copy of field paths with output_only field paths removed 1191 func (fieldMask *Device_PublicListingSpec_FieldMask) FilterInputFields() *Device_PublicListingSpec_FieldMask { 1192 result := &Device_PublicListingSpec_FieldMask{} 1193 result.Paths = append(result.Paths, fieldMask.Paths...) 1194 return result 1195 } 1196 1197 // ToFieldMask is used for proto conversions 1198 func (fieldMask *Device_PublicListingSpec_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 1199 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1200 for _, path := range fieldMask.Paths { 1201 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 1202 } 1203 return protoFieldMask 1204 } 1205 1206 func (fieldMask *Device_PublicListingSpec_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 1207 if fieldMask == nil { 1208 return status.Error(codes.Internal, "target field mask is nil") 1209 } 1210 fieldMask.Paths = make([]DevicePublicListingSpec_FieldPath, 0, len(protoFieldMask.Paths)) 1211 for _, strPath := range protoFieldMask.Paths { 1212 path, err := ParseDevicePublicListingSpec_FieldPath(strPath) 1213 if err != nil { 1214 return err 1215 } 1216 fieldMask.Paths = append(fieldMask.Paths, path) 1217 } 1218 return nil 1219 } 1220 1221 // implement methods required by customType 1222 func (fieldMask Device_PublicListingSpec_FieldMask) Marshal() ([]byte, error) { 1223 protoFieldMask := fieldMask.ToProtoFieldMask() 1224 return proto.Marshal(protoFieldMask) 1225 } 1226 1227 func (fieldMask *Device_PublicListingSpec_FieldMask) Unmarshal(data []byte) error { 1228 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1229 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 1230 return err 1231 } 1232 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 1233 return err 1234 } 1235 return nil 1236 } 1237 1238 func (fieldMask *Device_PublicListingSpec_FieldMask) Size() int { 1239 return proto.Size(fieldMask.ToProtoFieldMask()) 1240 } 1241 1242 func (fieldMask Device_PublicListingSpec_FieldMask) MarshalJSON() ([]byte, error) { 1243 return json.Marshal(fieldMask.ToProtoFieldMask()) 1244 } 1245 1246 func (fieldMask *Device_PublicListingSpec_FieldMask) UnmarshalJSON(data []byte) error { 1247 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1248 if err := json.Unmarshal(data, protoFieldMask); err != nil { 1249 return err 1250 } 1251 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 1252 return err 1253 } 1254 return nil 1255 } 1256 1257 func (fieldMask *Device_PublicListingSpec_FieldMask) AppendPath(path DevicePublicListingSpec_FieldPath) { 1258 fieldMask.Paths = append(fieldMask.Paths, path) 1259 } 1260 1261 func (fieldMask *Device_PublicListingSpec_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 1262 fieldMask.Paths = append(fieldMask.Paths, path.(DevicePublicListingSpec_FieldPath)) 1263 } 1264 1265 func (fieldMask *Device_PublicListingSpec_FieldMask) GetPaths() []DevicePublicListingSpec_FieldPath { 1266 if fieldMask == nil { 1267 return nil 1268 } 1269 return fieldMask.Paths 1270 } 1271 1272 func (fieldMask *Device_PublicListingSpec_FieldMask) GetRawPaths() []gotenobject.FieldPath { 1273 if fieldMask == nil { 1274 return nil 1275 } 1276 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 1277 for _, path := range fieldMask.Paths { 1278 rawPaths = append(rawPaths, path) 1279 } 1280 return rawPaths 1281 } 1282 1283 func (fieldMask *Device_PublicListingSpec_FieldMask) SetFromCliFlag(raw string) error { 1284 path, err := ParseDevicePublicListingSpec_FieldPath(raw) 1285 if err != nil { 1286 return err 1287 } 1288 fieldMask.Paths = append(fieldMask.Paths, path) 1289 return nil 1290 } 1291 1292 func (fieldMask *Device_PublicListingSpec_FieldMask) Set(target, source *Device_PublicListingSpec) { 1293 for _, path := range fieldMask.Paths { 1294 val, _ := path.GetSingle(source) 1295 // if val is nil, then field does not exist in source, skip 1296 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 1297 if val != nil { 1298 path.WithIValue(val).SetTo(&target) 1299 } 1300 } 1301 } 1302 1303 func (fieldMask *Device_PublicListingSpec_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 1304 fieldMask.Set(target.(*Device_PublicListingSpec), source.(*Device_PublicListingSpec)) 1305 } 1306 1307 func (fieldMask *Device_PublicListingSpec_FieldMask) Project(source *Device_PublicListingSpec) *Device_PublicListingSpec { 1308 if source == nil { 1309 return nil 1310 } 1311 if fieldMask == nil { 1312 return source 1313 } 1314 result := &Device_PublicListingSpec{} 1315 1316 for _, p := range fieldMask.Paths { 1317 switch tp := p.(type) { 1318 case *DevicePublicListingSpec_FieldTerminalPath: 1319 switch tp.selector { 1320 case DevicePublicListingSpec_FieldPathSelectorEnabled: 1321 result.Enabled = source.Enabled 1322 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 1323 result.FieldMask = source.FieldMask 1324 } 1325 } 1326 } 1327 return result 1328 } 1329 1330 func (fieldMask *Device_PublicListingSpec_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 1331 return fieldMask.Project(source.(*Device_PublicListingSpec)) 1332 } 1333 1334 func (fieldMask *Device_PublicListingSpec_FieldMask) PathsCount() int { 1335 if fieldMask == nil { 1336 return 0 1337 } 1338 return len(fieldMask.Paths) 1339 } 1340 1341 type Device_Spec_NetworkingConfig_FieldMask struct { 1342 Paths []DeviceSpecNetworkingConfig_FieldPath 1343 } 1344 1345 func FullDevice_Spec_NetworkingConfig_FieldMask() *Device_Spec_NetworkingConfig_FieldMask { 1346 res := &Device_Spec_NetworkingConfig_FieldMask{} 1347 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorVersion}) 1348 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorRenderer}) 1349 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorEthernets}) 1350 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorWifis}) 1351 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorBridges}) 1352 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorBonds}) 1353 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorTunnels}) 1354 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorVlans}) 1355 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfig_FieldTerminalPath{selector: DeviceSpecNetworkingConfig_FieldPathSelectorModems}) 1356 return res 1357 } 1358 1359 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) String() string { 1360 if fieldMask == nil { 1361 return "<nil>" 1362 } 1363 pathsStr := make([]string, 0, len(fieldMask.Paths)) 1364 for _, path := range fieldMask.Paths { 1365 pathsStr = append(pathsStr, path.String()) 1366 } 1367 return strings.Join(pathsStr, ", ") 1368 } 1369 1370 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) IsFull() bool { 1371 if fieldMask == nil { 1372 return false 1373 } 1374 presentSelectors := make([]bool, 9) 1375 for _, path := range fieldMask.Paths { 1376 if asFinal, ok := path.(*DeviceSpecNetworkingConfig_FieldTerminalPath); ok { 1377 presentSelectors[int(asFinal.selector)] = true 1378 } 1379 } 1380 for _, flag := range presentSelectors { 1381 if !flag { 1382 return false 1383 } 1384 } 1385 return true 1386 } 1387 1388 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) ProtoReflect() preflect.Message { 1389 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 1390 return ParseDeviceSpecNetworkingConfig_FieldPath(raw) 1391 }) 1392 } 1393 1394 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) ProtoMessage() {} 1395 1396 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) Reset() { 1397 if fieldMask != nil { 1398 fieldMask.Paths = nil 1399 } 1400 } 1401 1402 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_FieldMask) *Device_Spec_NetworkingConfig_FieldMask { 1403 result := &Device_Spec_NetworkingConfig_FieldMask{} 1404 removedSelectors := make([]bool, 9) 1405 1406 for _, path := range other.GetPaths() { 1407 switch tp := path.(type) { 1408 case *DeviceSpecNetworkingConfig_FieldTerminalPath: 1409 removedSelectors[int(tp.selector)] = true 1410 } 1411 } 1412 for _, path := range fieldMask.GetPaths() { 1413 if !removedSelectors[int(path.Selector())] { 1414 result.Paths = append(result.Paths, path) 1415 } 1416 } 1417 1418 if len(result.Paths) == 0 { 1419 return nil 1420 } 1421 return result 1422 } 1423 1424 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 1425 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_FieldMask)) 1426 } 1427 1428 // FilterInputFields generates copy of field paths with output_only field paths removed 1429 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_FieldMask { 1430 result := &Device_Spec_NetworkingConfig_FieldMask{} 1431 result.Paths = append(result.Paths, fieldMask.Paths...) 1432 return result 1433 } 1434 1435 // ToFieldMask is used for proto conversions 1436 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 1437 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1438 for _, path := range fieldMask.Paths { 1439 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 1440 } 1441 return protoFieldMask 1442 } 1443 1444 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 1445 if fieldMask == nil { 1446 return status.Error(codes.Internal, "target field mask is nil") 1447 } 1448 fieldMask.Paths = make([]DeviceSpecNetworkingConfig_FieldPath, 0, len(protoFieldMask.Paths)) 1449 for _, strPath := range protoFieldMask.Paths { 1450 path, err := ParseDeviceSpecNetworkingConfig_FieldPath(strPath) 1451 if err != nil { 1452 return err 1453 } 1454 fieldMask.Paths = append(fieldMask.Paths, path) 1455 } 1456 return nil 1457 } 1458 1459 // implement methods required by customType 1460 func (fieldMask Device_Spec_NetworkingConfig_FieldMask) Marshal() ([]byte, error) { 1461 protoFieldMask := fieldMask.ToProtoFieldMask() 1462 return proto.Marshal(protoFieldMask) 1463 } 1464 1465 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) Unmarshal(data []byte) error { 1466 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1467 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 1468 return err 1469 } 1470 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 1471 return err 1472 } 1473 return nil 1474 } 1475 1476 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) Size() int { 1477 return proto.Size(fieldMask.ToProtoFieldMask()) 1478 } 1479 1480 func (fieldMask Device_Spec_NetworkingConfig_FieldMask) MarshalJSON() ([]byte, error) { 1481 return json.Marshal(fieldMask.ToProtoFieldMask()) 1482 } 1483 1484 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) UnmarshalJSON(data []byte) error { 1485 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1486 if err := json.Unmarshal(data, protoFieldMask); err != nil { 1487 return err 1488 } 1489 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 1490 return err 1491 } 1492 return nil 1493 } 1494 1495 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) AppendPath(path DeviceSpecNetworkingConfig_FieldPath) { 1496 fieldMask.Paths = append(fieldMask.Paths, path) 1497 } 1498 1499 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 1500 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfig_FieldPath)) 1501 } 1502 1503 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) GetPaths() []DeviceSpecNetworkingConfig_FieldPath { 1504 if fieldMask == nil { 1505 return nil 1506 } 1507 return fieldMask.Paths 1508 } 1509 1510 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) GetRawPaths() []gotenobject.FieldPath { 1511 if fieldMask == nil { 1512 return nil 1513 } 1514 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 1515 for _, path := range fieldMask.Paths { 1516 rawPaths = append(rawPaths, path) 1517 } 1518 return rawPaths 1519 } 1520 1521 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) SetFromCliFlag(raw string) error { 1522 path, err := ParseDeviceSpecNetworkingConfig_FieldPath(raw) 1523 if err != nil { 1524 return err 1525 } 1526 fieldMask.Paths = append(fieldMask.Paths, path) 1527 return nil 1528 } 1529 1530 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) Set(target, source *Device_Spec_NetworkingConfig) { 1531 for _, path := range fieldMask.Paths { 1532 val, _ := path.GetSingle(source) 1533 // if val is nil, then field does not exist in source, skip 1534 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 1535 if val != nil { 1536 path.WithIValue(val).SetTo(&target) 1537 } 1538 } 1539 } 1540 1541 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 1542 fieldMask.Set(target.(*Device_Spec_NetworkingConfig), source.(*Device_Spec_NetworkingConfig)) 1543 } 1544 1545 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) Project(source *Device_Spec_NetworkingConfig) *Device_Spec_NetworkingConfig { 1546 if source == nil { 1547 return nil 1548 } 1549 if fieldMask == nil { 1550 return source 1551 } 1552 result := &Device_Spec_NetworkingConfig{} 1553 var ethernetsMapKeys []string 1554 wholeEthernetsAccepted := false 1555 var wifisMapKeys []string 1556 wholeWifisAccepted := false 1557 var bridgesMapKeys []string 1558 wholeBridgesAccepted := false 1559 var bondsMapKeys []string 1560 wholeBondsAccepted := false 1561 var tunnelsMapKeys []string 1562 wholeTunnelsAccepted := false 1563 var vlansMapKeys []string 1564 wholeVlansAccepted := false 1565 var modemsMapKeys []string 1566 wholeModemsAccepted := false 1567 1568 for _, p := range fieldMask.Paths { 1569 switch tp := p.(type) { 1570 case *DeviceSpecNetworkingConfig_FieldTerminalPath: 1571 switch tp.selector { 1572 case DeviceSpecNetworkingConfig_FieldPathSelectorVersion: 1573 result.Version = source.Version 1574 case DeviceSpecNetworkingConfig_FieldPathSelectorRenderer: 1575 result.Renderer = source.Renderer 1576 case DeviceSpecNetworkingConfig_FieldPathSelectorEthernets: 1577 result.Ethernets = source.Ethernets 1578 wholeEthernetsAccepted = true 1579 case DeviceSpecNetworkingConfig_FieldPathSelectorWifis: 1580 result.Wifis = source.Wifis 1581 wholeWifisAccepted = true 1582 case DeviceSpecNetworkingConfig_FieldPathSelectorBridges: 1583 result.Bridges = source.Bridges 1584 wholeBridgesAccepted = true 1585 case DeviceSpecNetworkingConfig_FieldPathSelectorBonds: 1586 result.Bonds = source.Bonds 1587 wholeBondsAccepted = true 1588 case DeviceSpecNetworkingConfig_FieldPathSelectorTunnels: 1589 result.Tunnels = source.Tunnels 1590 wholeTunnelsAccepted = true 1591 case DeviceSpecNetworkingConfig_FieldPathSelectorVlans: 1592 result.Vlans = source.Vlans 1593 wholeVlansAccepted = true 1594 case DeviceSpecNetworkingConfig_FieldPathSelectorModems: 1595 result.Modems = source.Modems 1596 wholeModemsAccepted = true 1597 } 1598 case *DeviceSpecNetworkingConfig_FieldPathMap: 1599 switch tp.selector { 1600 case DeviceSpecNetworkingConfig_FieldPathSelectorEthernets: 1601 ethernetsMapKeys = append(ethernetsMapKeys, tp.key) 1602 case DeviceSpecNetworkingConfig_FieldPathSelectorWifis: 1603 wifisMapKeys = append(wifisMapKeys, tp.key) 1604 case DeviceSpecNetworkingConfig_FieldPathSelectorBridges: 1605 bridgesMapKeys = append(bridgesMapKeys, tp.key) 1606 case DeviceSpecNetworkingConfig_FieldPathSelectorBonds: 1607 bondsMapKeys = append(bondsMapKeys, tp.key) 1608 case DeviceSpecNetworkingConfig_FieldPathSelectorTunnels: 1609 tunnelsMapKeys = append(tunnelsMapKeys, tp.key) 1610 case DeviceSpecNetworkingConfig_FieldPathSelectorVlans: 1611 vlansMapKeys = append(vlansMapKeys, tp.key) 1612 case DeviceSpecNetworkingConfig_FieldPathSelectorModems: 1613 modemsMapKeys = append(modemsMapKeys, tp.key) 1614 } 1615 } 1616 } 1617 if wholeEthernetsAccepted == false && len(ethernetsMapKeys) > 0 && source.GetEthernets() != nil { 1618 copiedMap := map[string]*Device_Spec_NetworkingConfig_EthOpts{} 1619 sourceMap := source.GetEthernets() 1620 for _, key := range ethernetsMapKeys { 1621 copiedMap[key] = sourceMap[key] 1622 } 1623 result.Ethernets = copiedMap 1624 } 1625 if wholeWifisAccepted == false && len(wifisMapKeys) > 0 && source.GetWifis() != nil { 1626 copiedMap := map[string]*Device_Spec_NetworkingConfig_WifiOpts{} 1627 sourceMap := source.GetWifis() 1628 for _, key := range wifisMapKeys { 1629 copiedMap[key] = sourceMap[key] 1630 } 1631 result.Wifis = copiedMap 1632 } 1633 if wholeBridgesAccepted == false && len(bridgesMapKeys) > 0 && source.GetBridges() != nil { 1634 copiedMap := map[string]*Device_Spec_NetworkingConfig_BridgesOpts{} 1635 sourceMap := source.GetBridges() 1636 for _, key := range bridgesMapKeys { 1637 copiedMap[key] = sourceMap[key] 1638 } 1639 result.Bridges = copiedMap 1640 } 1641 if wholeBondsAccepted == false && len(bondsMapKeys) > 0 && source.GetBonds() != nil { 1642 copiedMap := map[string]*Device_Spec_NetworkingConfig_BondsOpts{} 1643 sourceMap := source.GetBonds() 1644 for _, key := range bondsMapKeys { 1645 copiedMap[key] = sourceMap[key] 1646 } 1647 result.Bonds = copiedMap 1648 } 1649 if wholeTunnelsAccepted == false && len(tunnelsMapKeys) > 0 && source.GetTunnels() != nil { 1650 copiedMap := map[string]*Device_Spec_NetworkingConfig_TunnelsOpts{} 1651 sourceMap := source.GetTunnels() 1652 for _, key := range tunnelsMapKeys { 1653 copiedMap[key] = sourceMap[key] 1654 } 1655 result.Tunnels = copiedMap 1656 } 1657 if wholeVlansAccepted == false && len(vlansMapKeys) > 0 && source.GetVlans() != nil { 1658 copiedMap := map[string]*Device_Spec_NetworkingConfig_VlansOpts{} 1659 sourceMap := source.GetVlans() 1660 for _, key := range vlansMapKeys { 1661 copiedMap[key] = sourceMap[key] 1662 } 1663 result.Vlans = copiedMap 1664 } 1665 if wholeModemsAccepted == false && len(modemsMapKeys) > 0 && source.GetModems() != nil { 1666 copiedMap := map[string]*Device_Spec_NetworkingConfig_ModemOpts{} 1667 sourceMap := source.GetModems() 1668 for _, key := range modemsMapKeys { 1669 copiedMap[key] = sourceMap[key] 1670 } 1671 result.Modems = copiedMap 1672 } 1673 return result 1674 } 1675 1676 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 1677 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig)) 1678 } 1679 1680 func (fieldMask *Device_Spec_NetworkingConfig_FieldMask) PathsCount() int { 1681 if fieldMask == nil { 1682 return 0 1683 } 1684 return len(fieldMask.Paths) 1685 } 1686 1687 type Device_Spec_NetplanConfig_FieldMask struct { 1688 Paths []DeviceSpecNetplanConfig_FieldPath 1689 } 1690 1691 func FullDevice_Spec_NetplanConfig_FieldMask() *Device_Spec_NetplanConfig_FieldMask { 1692 res := &Device_Spec_NetplanConfig_FieldMask{} 1693 res.Paths = append(res.Paths, &DeviceSpecNetplanConfig_FieldTerminalPath{selector: DeviceSpecNetplanConfig_FieldPathSelectorNetwork}) 1694 return res 1695 } 1696 1697 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) String() string { 1698 if fieldMask == nil { 1699 return "<nil>" 1700 } 1701 pathsStr := make([]string, 0, len(fieldMask.Paths)) 1702 for _, path := range fieldMask.Paths { 1703 pathsStr = append(pathsStr, path.String()) 1704 } 1705 return strings.Join(pathsStr, ", ") 1706 } 1707 1708 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) IsFull() bool { 1709 if fieldMask == nil { 1710 return false 1711 } 1712 presentSelectors := make([]bool, 1) 1713 for _, path := range fieldMask.Paths { 1714 if asFinal, ok := path.(*DeviceSpecNetplanConfig_FieldTerminalPath); ok { 1715 presentSelectors[int(asFinal.selector)] = true 1716 } 1717 } 1718 for _, flag := range presentSelectors { 1719 if !flag { 1720 return false 1721 } 1722 } 1723 return true 1724 } 1725 1726 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) ProtoReflect() preflect.Message { 1727 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 1728 return ParseDeviceSpecNetplanConfig_FieldPath(raw) 1729 }) 1730 } 1731 1732 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) ProtoMessage() {} 1733 1734 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) Reset() { 1735 if fieldMask != nil { 1736 fieldMask.Paths = nil 1737 } 1738 } 1739 1740 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) Subtract(other *Device_Spec_NetplanConfig_FieldMask) *Device_Spec_NetplanConfig_FieldMask { 1741 result := &Device_Spec_NetplanConfig_FieldMask{} 1742 removedSelectors := make([]bool, 1) 1743 otherSubMasks := map[DeviceSpecNetplanConfig_FieldPathSelector]gotenobject.FieldMask{ 1744 DeviceSpecNetplanConfig_FieldPathSelectorNetwork: &Device_Spec_NetworkingConfig_FieldMask{}, 1745 } 1746 mySubMasks := map[DeviceSpecNetplanConfig_FieldPathSelector]gotenobject.FieldMask{ 1747 DeviceSpecNetplanConfig_FieldPathSelectorNetwork: &Device_Spec_NetworkingConfig_FieldMask{}, 1748 } 1749 1750 for _, path := range other.GetPaths() { 1751 switch tp := path.(type) { 1752 case *DeviceSpecNetplanConfig_FieldTerminalPath: 1753 removedSelectors[int(tp.selector)] = true 1754 case *DeviceSpecNetplanConfig_FieldSubPath: 1755 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 1756 } 1757 } 1758 for _, path := range fieldMask.GetPaths() { 1759 if !removedSelectors[int(path.Selector())] { 1760 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 1761 if tp, ok := path.(*DeviceSpecNetplanConfig_FieldTerminalPath); ok { 1762 switch tp.selector { 1763 case DeviceSpecNetplanConfig_FieldPathSelectorNetwork: 1764 mySubMasks[DeviceSpecNetplanConfig_FieldPathSelectorNetwork] = FullDevice_Spec_NetworkingConfig_FieldMask() 1765 } 1766 } else if tp, ok := path.(*DeviceSpecNetplanConfig_FieldSubPath); ok { 1767 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 1768 } 1769 } else { 1770 result.Paths = append(result.Paths, path) 1771 } 1772 } 1773 } 1774 for selector, mySubMask := range mySubMasks { 1775 if mySubMask.PathsCount() > 0 { 1776 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 1777 result.Paths = append(result.Paths, &DeviceSpecNetplanConfig_FieldSubPath{selector: selector, subPath: allowedPath}) 1778 } 1779 } 1780 } 1781 1782 if len(result.Paths) == 0 { 1783 return nil 1784 } 1785 return result 1786 } 1787 1788 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 1789 return fieldMask.Subtract(other.(*Device_Spec_NetplanConfig_FieldMask)) 1790 } 1791 1792 // FilterInputFields generates copy of field paths with output_only field paths removed 1793 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) FilterInputFields() *Device_Spec_NetplanConfig_FieldMask { 1794 result := &Device_Spec_NetplanConfig_FieldMask{} 1795 result.Paths = append(result.Paths, fieldMask.Paths...) 1796 return result 1797 } 1798 1799 // ToFieldMask is used for proto conversions 1800 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 1801 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1802 for _, path := range fieldMask.Paths { 1803 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 1804 } 1805 return protoFieldMask 1806 } 1807 1808 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 1809 if fieldMask == nil { 1810 return status.Error(codes.Internal, "target field mask is nil") 1811 } 1812 fieldMask.Paths = make([]DeviceSpecNetplanConfig_FieldPath, 0, len(protoFieldMask.Paths)) 1813 for _, strPath := range protoFieldMask.Paths { 1814 path, err := ParseDeviceSpecNetplanConfig_FieldPath(strPath) 1815 if err != nil { 1816 return err 1817 } 1818 fieldMask.Paths = append(fieldMask.Paths, path) 1819 } 1820 return nil 1821 } 1822 1823 // implement methods required by customType 1824 func (fieldMask Device_Spec_NetplanConfig_FieldMask) Marshal() ([]byte, error) { 1825 protoFieldMask := fieldMask.ToProtoFieldMask() 1826 return proto.Marshal(protoFieldMask) 1827 } 1828 1829 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) Unmarshal(data []byte) error { 1830 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1831 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 1832 return err 1833 } 1834 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 1835 return err 1836 } 1837 return nil 1838 } 1839 1840 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) Size() int { 1841 return proto.Size(fieldMask.ToProtoFieldMask()) 1842 } 1843 1844 func (fieldMask Device_Spec_NetplanConfig_FieldMask) MarshalJSON() ([]byte, error) { 1845 return json.Marshal(fieldMask.ToProtoFieldMask()) 1846 } 1847 1848 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) UnmarshalJSON(data []byte) error { 1849 protoFieldMask := &googlefieldmaskpb.FieldMask{} 1850 if err := json.Unmarshal(data, protoFieldMask); err != nil { 1851 return err 1852 } 1853 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 1854 return err 1855 } 1856 return nil 1857 } 1858 1859 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) AppendPath(path DeviceSpecNetplanConfig_FieldPath) { 1860 fieldMask.Paths = append(fieldMask.Paths, path) 1861 } 1862 1863 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 1864 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetplanConfig_FieldPath)) 1865 } 1866 1867 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) GetPaths() []DeviceSpecNetplanConfig_FieldPath { 1868 if fieldMask == nil { 1869 return nil 1870 } 1871 return fieldMask.Paths 1872 } 1873 1874 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) GetRawPaths() []gotenobject.FieldPath { 1875 if fieldMask == nil { 1876 return nil 1877 } 1878 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 1879 for _, path := range fieldMask.Paths { 1880 rawPaths = append(rawPaths, path) 1881 } 1882 return rawPaths 1883 } 1884 1885 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) SetFromCliFlag(raw string) error { 1886 path, err := ParseDeviceSpecNetplanConfig_FieldPath(raw) 1887 if err != nil { 1888 return err 1889 } 1890 fieldMask.Paths = append(fieldMask.Paths, path) 1891 return nil 1892 } 1893 1894 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) Set(target, source *Device_Spec_NetplanConfig) { 1895 for _, path := range fieldMask.Paths { 1896 val, _ := path.GetSingle(source) 1897 // if val is nil, then field does not exist in source, skip 1898 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 1899 if val != nil { 1900 path.WithIValue(val).SetTo(&target) 1901 } 1902 } 1903 } 1904 1905 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 1906 fieldMask.Set(target.(*Device_Spec_NetplanConfig), source.(*Device_Spec_NetplanConfig)) 1907 } 1908 1909 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) Project(source *Device_Spec_NetplanConfig) *Device_Spec_NetplanConfig { 1910 if source == nil { 1911 return nil 1912 } 1913 if fieldMask == nil { 1914 return source 1915 } 1916 result := &Device_Spec_NetplanConfig{} 1917 networkMask := &Device_Spec_NetworkingConfig_FieldMask{} 1918 wholeNetworkAccepted := false 1919 1920 for _, p := range fieldMask.Paths { 1921 switch tp := p.(type) { 1922 case *DeviceSpecNetplanConfig_FieldTerminalPath: 1923 switch tp.selector { 1924 case DeviceSpecNetplanConfig_FieldPathSelectorNetwork: 1925 result.Network = source.Network 1926 wholeNetworkAccepted = true 1927 } 1928 case *DeviceSpecNetplanConfig_FieldSubPath: 1929 switch tp.selector { 1930 case DeviceSpecNetplanConfig_FieldPathSelectorNetwork: 1931 networkMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfig_FieldPath)) 1932 } 1933 } 1934 } 1935 if wholeNetworkAccepted == false && len(networkMask.Paths) > 0 { 1936 result.Network = networkMask.Project(source.GetNetwork()) 1937 } 1938 return result 1939 } 1940 1941 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 1942 return fieldMask.Project(source.(*Device_Spec_NetplanConfig)) 1943 } 1944 1945 func (fieldMask *Device_Spec_NetplanConfig_FieldMask) PathsCount() int { 1946 if fieldMask == nil { 1947 return 0 1948 } 1949 return len(fieldMask.Paths) 1950 } 1951 1952 type Device_Spec_SSHConfig_FieldMask struct { 1953 Paths []DeviceSpecSSHConfig_FieldPath 1954 } 1955 1956 func FullDevice_Spec_SSHConfig_FieldMask() *Device_Spec_SSHConfig_FieldMask { 1957 res := &Device_Spec_SSHConfig_FieldMask{} 1958 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer}) 1959 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword}) 1960 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized}) 1961 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorIpAllowList}) 1962 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorIpDenyList}) 1963 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod}) 1964 res.Paths = append(res.Paths, &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey}) 1965 return res 1966 } 1967 1968 func (fieldMask *Device_Spec_SSHConfig_FieldMask) String() string { 1969 if fieldMask == nil { 1970 return "<nil>" 1971 } 1972 pathsStr := make([]string, 0, len(fieldMask.Paths)) 1973 for _, path := range fieldMask.Paths { 1974 pathsStr = append(pathsStr, path.String()) 1975 } 1976 return strings.Join(pathsStr, ", ") 1977 } 1978 1979 func (fieldMask *Device_Spec_SSHConfig_FieldMask) IsFull() bool { 1980 if fieldMask == nil { 1981 return false 1982 } 1983 presentSelectors := make([]bool, 7) 1984 for _, path := range fieldMask.Paths { 1985 if asFinal, ok := path.(*DeviceSpecSSHConfig_FieldTerminalPath); ok { 1986 presentSelectors[int(asFinal.selector)] = true 1987 } 1988 } 1989 for _, flag := range presentSelectors { 1990 if !flag { 1991 return false 1992 } 1993 } 1994 return true 1995 } 1996 1997 func (fieldMask *Device_Spec_SSHConfig_FieldMask) ProtoReflect() preflect.Message { 1998 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 1999 return ParseDeviceSpecSSHConfig_FieldPath(raw) 2000 }) 2001 } 2002 2003 func (fieldMask *Device_Spec_SSHConfig_FieldMask) ProtoMessage() {} 2004 2005 func (fieldMask *Device_Spec_SSHConfig_FieldMask) Reset() { 2006 if fieldMask != nil { 2007 fieldMask.Paths = nil 2008 } 2009 } 2010 2011 func (fieldMask *Device_Spec_SSHConfig_FieldMask) Subtract(other *Device_Spec_SSHConfig_FieldMask) *Device_Spec_SSHConfig_FieldMask { 2012 result := &Device_Spec_SSHConfig_FieldMask{} 2013 removedSelectors := make([]bool, 7) 2014 otherSubMasks := map[DeviceSpecSSHConfig_FieldPathSelector]gotenobject.FieldMask{ 2015 DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: &Device_Spec_SSHConfig_AuthKey_FieldMask{}, 2016 } 2017 mySubMasks := map[DeviceSpecSSHConfig_FieldPathSelector]gotenobject.FieldMask{ 2018 DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: &Device_Spec_SSHConfig_AuthKey_FieldMask{}, 2019 } 2020 2021 for _, path := range other.GetPaths() { 2022 switch tp := path.(type) { 2023 case *DeviceSpecSSHConfig_FieldTerminalPath: 2024 removedSelectors[int(tp.selector)] = true 2025 case *DeviceSpecSSHConfig_FieldSubPath: 2026 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 2027 } 2028 } 2029 for _, path := range fieldMask.GetPaths() { 2030 if !removedSelectors[int(path.Selector())] { 2031 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 2032 if tp, ok := path.(*DeviceSpecSSHConfig_FieldTerminalPath); ok { 2033 switch tp.selector { 2034 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 2035 mySubMasks[DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized] = FullDevice_Spec_SSHConfig_AuthKey_FieldMask() 2036 } 2037 } else if tp, ok := path.(*DeviceSpecSSHConfig_FieldSubPath); ok { 2038 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 2039 } 2040 } else { 2041 result.Paths = append(result.Paths, path) 2042 } 2043 } 2044 } 2045 for selector, mySubMask := range mySubMasks { 2046 if mySubMask.PathsCount() > 0 { 2047 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 2048 result.Paths = append(result.Paths, &DeviceSpecSSHConfig_FieldSubPath{selector: selector, subPath: allowedPath}) 2049 } 2050 } 2051 } 2052 2053 if len(result.Paths) == 0 { 2054 return nil 2055 } 2056 return result 2057 } 2058 2059 func (fieldMask *Device_Spec_SSHConfig_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 2060 return fieldMask.Subtract(other.(*Device_Spec_SSHConfig_FieldMask)) 2061 } 2062 2063 // FilterInputFields generates copy of field paths with output_only field paths removed 2064 func (fieldMask *Device_Spec_SSHConfig_FieldMask) FilterInputFields() *Device_Spec_SSHConfig_FieldMask { 2065 result := &Device_Spec_SSHConfig_FieldMask{} 2066 result.Paths = append(result.Paths, fieldMask.Paths...) 2067 return result 2068 } 2069 2070 // ToFieldMask is used for proto conversions 2071 func (fieldMask *Device_Spec_SSHConfig_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 2072 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2073 for _, path := range fieldMask.Paths { 2074 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 2075 } 2076 return protoFieldMask 2077 } 2078 2079 func (fieldMask *Device_Spec_SSHConfig_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 2080 if fieldMask == nil { 2081 return status.Error(codes.Internal, "target field mask is nil") 2082 } 2083 fieldMask.Paths = make([]DeviceSpecSSHConfig_FieldPath, 0, len(protoFieldMask.Paths)) 2084 for _, strPath := range protoFieldMask.Paths { 2085 path, err := ParseDeviceSpecSSHConfig_FieldPath(strPath) 2086 if err != nil { 2087 return err 2088 } 2089 fieldMask.Paths = append(fieldMask.Paths, path) 2090 } 2091 return nil 2092 } 2093 2094 // implement methods required by customType 2095 func (fieldMask Device_Spec_SSHConfig_FieldMask) Marshal() ([]byte, error) { 2096 protoFieldMask := fieldMask.ToProtoFieldMask() 2097 return proto.Marshal(protoFieldMask) 2098 } 2099 2100 func (fieldMask *Device_Spec_SSHConfig_FieldMask) Unmarshal(data []byte) error { 2101 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2102 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 2103 return err 2104 } 2105 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2106 return err 2107 } 2108 return nil 2109 } 2110 2111 func (fieldMask *Device_Spec_SSHConfig_FieldMask) Size() int { 2112 return proto.Size(fieldMask.ToProtoFieldMask()) 2113 } 2114 2115 func (fieldMask Device_Spec_SSHConfig_FieldMask) MarshalJSON() ([]byte, error) { 2116 return json.Marshal(fieldMask.ToProtoFieldMask()) 2117 } 2118 2119 func (fieldMask *Device_Spec_SSHConfig_FieldMask) UnmarshalJSON(data []byte) error { 2120 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2121 if err := json.Unmarshal(data, protoFieldMask); err != nil { 2122 return err 2123 } 2124 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2125 return err 2126 } 2127 return nil 2128 } 2129 2130 func (fieldMask *Device_Spec_SSHConfig_FieldMask) AppendPath(path DeviceSpecSSHConfig_FieldPath) { 2131 fieldMask.Paths = append(fieldMask.Paths, path) 2132 } 2133 2134 func (fieldMask *Device_Spec_SSHConfig_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 2135 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecSSHConfig_FieldPath)) 2136 } 2137 2138 func (fieldMask *Device_Spec_SSHConfig_FieldMask) GetPaths() []DeviceSpecSSHConfig_FieldPath { 2139 if fieldMask == nil { 2140 return nil 2141 } 2142 return fieldMask.Paths 2143 } 2144 2145 func (fieldMask *Device_Spec_SSHConfig_FieldMask) GetRawPaths() []gotenobject.FieldPath { 2146 if fieldMask == nil { 2147 return nil 2148 } 2149 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 2150 for _, path := range fieldMask.Paths { 2151 rawPaths = append(rawPaths, path) 2152 } 2153 return rawPaths 2154 } 2155 2156 func (fieldMask *Device_Spec_SSHConfig_FieldMask) SetFromCliFlag(raw string) error { 2157 path, err := ParseDeviceSpecSSHConfig_FieldPath(raw) 2158 if err != nil { 2159 return err 2160 } 2161 fieldMask.Paths = append(fieldMask.Paths, path) 2162 return nil 2163 } 2164 2165 func (fieldMask *Device_Spec_SSHConfig_FieldMask) Set(target, source *Device_Spec_SSHConfig) { 2166 for _, path := range fieldMask.Paths { 2167 val, _ := path.GetSingle(source) 2168 // if val is nil, then field does not exist in source, skip 2169 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 2170 if val != nil { 2171 path.WithIValue(val).SetTo(&target) 2172 } 2173 } 2174 } 2175 2176 func (fieldMask *Device_Spec_SSHConfig_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 2177 fieldMask.Set(target.(*Device_Spec_SSHConfig), source.(*Device_Spec_SSHConfig)) 2178 } 2179 2180 func (fieldMask *Device_Spec_SSHConfig_FieldMask) Project(source *Device_Spec_SSHConfig) *Device_Spec_SSHConfig { 2181 if source == nil { 2182 return nil 2183 } 2184 if fieldMask == nil { 2185 return source 2186 } 2187 result := &Device_Spec_SSHConfig{} 2188 sshAuthorizedMask := &Device_Spec_SSHConfig_AuthKey_FieldMask{} 2189 wholeSshAuthorizedAccepted := false 2190 2191 for _, p := range fieldMask.Paths { 2192 switch tp := p.(type) { 2193 case *DeviceSpecSSHConfig_FieldTerminalPath: 2194 switch tp.selector { 2195 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 2196 result.DisableSshServer = source.DisableSshServer 2197 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 2198 result.DisableSshPassword = source.DisableSshPassword 2199 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 2200 result.SshAuthorized = source.SshAuthorized 2201 wholeSshAuthorizedAccepted = true 2202 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 2203 result.IpAllowList = source.IpAllowList 2204 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 2205 result.IpDenyList = source.IpDenyList 2206 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 2207 result.RejectPeriod = source.RejectPeriod 2208 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 2209 result.DisableSshAuthkey = source.DisableSshAuthkey 2210 } 2211 case *DeviceSpecSSHConfig_FieldSubPath: 2212 switch tp.selector { 2213 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 2214 sshAuthorizedMask.AppendPath(tp.subPath.(DeviceSpecSSHConfigAuthKey_FieldPath)) 2215 } 2216 } 2217 } 2218 if wholeSshAuthorizedAccepted == false && len(sshAuthorizedMask.Paths) > 0 { 2219 for _, sourceItem := range source.GetSshAuthorized() { 2220 result.SshAuthorized = append(result.SshAuthorized, sshAuthorizedMask.Project(sourceItem)) 2221 } 2222 } 2223 return result 2224 } 2225 2226 func (fieldMask *Device_Spec_SSHConfig_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 2227 return fieldMask.Project(source.(*Device_Spec_SSHConfig)) 2228 } 2229 2230 func (fieldMask *Device_Spec_SSHConfig_FieldMask) PathsCount() int { 2231 if fieldMask == nil { 2232 return 0 2233 } 2234 return len(fieldMask.Paths) 2235 } 2236 2237 type Device_Spec_AttestationConfig_FieldMask struct { 2238 Paths []DeviceSpecAttestationConfig_FieldPath 2239 } 2240 2241 func FullDevice_Spec_AttestationConfig_FieldMask() *Device_Spec_AttestationConfig_FieldMask { 2242 res := &Device_Spec_AttestationConfig_FieldMask{} 2243 res.Paths = append(res.Paths, &DeviceSpecAttestationConfig_FieldTerminalPath{selector: DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected}) 2244 res.Paths = append(res.Paths, &DeviceSpecAttestationConfig_FieldTerminalPath{selector: DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain}) 2245 res.Paths = append(res.Paths, &DeviceSpecAttestationConfig_FieldTerminalPath{selector: DeviceSpecAttestationConfig_FieldPathSelectorInsecureUseTpmSimulatorSeed}) 2246 return res 2247 } 2248 2249 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) String() string { 2250 if fieldMask == nil { 2251 return "<nil>" 2252 } 2253 pathsStr := make([]string, 0, len(fieldMask.Paths)) 2254 for _, path := range fieldMask.Paths { 2255 pathsStr = append(pathsStr, path.String()) 2256 } 2257 return strings.Join(pathsStr, ", ") 2258 } 2259 2260 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) IsFull() bool { 2261 if fieldMask == nil { 2262 return false 2263 } 2264 presentSelectors := make([]bool, 3) 2265 for _, path := range fieldMask.Paths { 2266 if asFinal, ok := path.(*DeviceSpecAttestationConfig_FieldTerminalPath); ok { 2267 presentSelectors[int(asFinal.selector)] = true 2268 } 2269 } 2270 for _, flag := range presentSelectors { 2271 if !flag { 2272 return false 2273 } 2274 } 2275 return true 2276 } 2277 2278 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) ProtoReflect() preflect.Message { 2279 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 2280 return ParseDeviceSpecAttestationConfig_FieldPath(raw) 2281 }) 2282 } 2283 2284 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) ProtoMessage() {} 2285 2286 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) Reset() { 2287 if fieldMask != nil { 2288 fieldMask.Paths = nil 2289 } 2290 } 2291 2292 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) Subtract(other *Device_Spec_AttestationConfig_FieldMask) *Device_Spec_AttestationConfig_FieldMask { 2293 result := &Device_Spec_AttestationConfig_FieldMask{} 2294 removedSelectors := make([]bool, 3) 2295 2296 for _, path := range other.GetPaths() { 2297 switch tp := path.(type) { 2298 case *DeviceSpecAttestationConfig_FieldTerminalPath: 2299 removedSelectors[int(tp.selector)] = true 2300 } 2301 } 2302 for _, path := range fieldMask.GetPaths() { 2303 if !removedSelectors[int(path.Selector())] { 2304 result.Paths = append(result.Paths, path) 2305 } 2306 } 2307 2308 if len(result.Paths) == 0 { 2309 return nil 2310 } 2311 return result 2312 } 2313 2314 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 2315 return fieldMask.Subtract(other.(*Device_Spec_AttestationConfig_FieldMask)) 2316 } 2317 2318 // FilterInputFields generates copy of field paths with output_only field paths removed 2319 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) FilterInputFields() *Device_Spec_AttestationConfig_FieldMask { 2320 result := &Device_Spec_AttestationConfig_FieldMask{} 2321 result.Paths = append(result.Paths, fieldMask.Paths...) 2322 return result 2323 } 2324 2325 // ToFieldMask is used for proto conversions 2326 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 2327 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2328 for _, path := range fieldMask.Paths { 2329 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 2330 } 2331 return protoFieldMask 2332 } 2333 2334 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 2335 if fieldMask == nil { 2336 return status.Error(codes.Internal, "target field mask is nil") 2337 } 2338 fieldMask.Paths = make([]DeviceSpecAttestationConfig_FieldPath, 0, len(protoFieldMask.Paths)) 2339 for _, strPath := range protoFieldMask.Paths { 2340 path, err := ParseDeviceSpecAttestationConfig_FieldPath(strPath) 2341 if err != nil { 2342 return err 2343 } 2344 fieldMask.Paths = append(fieldMask.Paths, path) 2345 } 2346 return nil 2347 } 2348 2349 // implement methods required by customType 2350 func (fieldMask Device_Spec_AttestationConfig_FieldMask) Marshal() ([]byte, error) { 2351 protoFieldMask := fieldMask.ToProtoFieldMask() 2352 return proto.Marshal(protoFieldMask) 2353 } 2354 2355 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) Unmarshal(data []byte) error { 2356 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2357 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 2358 return err 2359 } 2360 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2361 return err 2362 } 2363 return nil 2364 } 2365 2366 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) Size() int { 2367 return proto.Size(fieldMask.ToProtoFieldMask()) 2368 } 2369 2370 func (fieldMask Device_Spec_AttestationConfig_FieldMask) MarshalJSON() ([]byte, error) { 2371 return json.Marshal(fieldMask.ToProtoFieldMask()) 2372 } 2373 2374 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) UnmarshalJSON(data []byte) error { 2375 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2376 if err := json.Unmarshal(data, protoFieldMask); err != nil { 2377 return err 2378 } 2379 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2380 return err 2381 } 2382 return nil 2383 } 2384 2385 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) AppendPath(path DeviceSpecAttestationConfig_FieldPath) { 2386 fieldMask.Paths = append(fieldMask.Paths, path) 2387 } 2388 2389 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 2390 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecAttestationConfig_FieldPath)) 2391 } 2392 2393 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) GetPaths() []DeviceSpecAttestationConfig_FieldPath { 2394 if fieldMask == nil { 2395 return nil 2396 } 2397 return fieldMask.Paths 2398 } 2399 2400 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) GetRawPaths() []gotenobject.FieldPath { 2401 if fieldMask == nil { 2402 return nil 2403 } 2404 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 2405 for _, path := range fieldMask.Paths { 2406 rawPaths = append(rawPaths, path) 2407 } 2408 return rawPaths 2409 } 2410 2411 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) SetFromCliFlag(raw string) error { 2412 path, err := ParseDeviceSpecAttestationConfig_FieldPath(raw) 2413 if err != nil { 2414 return err 2415 } 2416 fieldMask.Paths = append(fieldMask.Paths, path) 2417 return nil 2418 } 2419 2420 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) Set(target, source *Device_Spec_AttestationConfig) { 2421 for _, path := range fieldMask.Paths { 2422 val, _ := path.GetSingle(source) 2423 // if val is nil, then field does not exist in source, skip 2424 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 2425 if val != nil { 2426 path.WithIValue(val).SetTo(&target) 2427 } 2428 } 2429 } 2430 2431 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 2432 fieldMask.Set(target.(*Device_Spec_AttestationConfig), source.(*Device_Spec_AttestationConfig)) 2433 } 2434 2435 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) Project(source *Device_Spec_AttestationConfig) *Device_Spec_AttestationConfig { 2436 if source == nil { 2437 return nil 2438 } 2439 if fieldMask == nil { 2440 return source 2441 } 2442 result := &Device_Spec_AttestationConfig{} 2443 2444 for _, p := range fieldMask.Paths { 2445 switch tp := p.(type) { 2446 case *DeviceSpecAttestationConfig_FieldTerminalPath: 2447 switch tp.selector { 2448 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 2449 result.AttestationExpected = source.AttestationExpected 2450 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 2451 result.AttestationDomain = source.AttestationDomain 2452 case DeviceSpecAttestationConfig_FieldPathSelectorInsecureUseTpmSimulatorSeed: 2453 result.InsecureUseTpmSimulatorSeed = source.InsecureUseTpmSimulatorSeed 2454 } 2455 } 2456 } 2457 return result 2458 } 2459 2460 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 2461 return fieldMask.Project(source.(*Device_Spec_AttestationConfig)) 2462 } 2463 2464 func (fieldMask *Device_Spec_AttestationConfig_FieldMask) PathsCount() int { 2465 if fieldMask == nil { 2466 return 0 2467 } 2468 return len(fieldMask.Paths) 2469 } 2470 2471 type Device_Spec_LoggingConfig_FieldMask struct { 2472 Paths []DeviceSpecLoggingConfig_FieldPath 2473 } 2474 2475 func FullDevice_Spec_LoggingConfig_FieldMask() *Device_Spec_LoggingConfig_FieldMask { 2476 res := &Device_Spec_LoggingConfig_FieldMask{} 2477 res.Paths = append(res.Paths, &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorPriority}) 2478 res.Paths = append(res.Paths, &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorUnits}) 2479 res.Paths = append(res.Paths, &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport}) 2480 return res 2481 } 2482 2483 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) String() string { 2484 if fieldMask == nil { 2485 return "<nil>" 2486 } 2487 pathsStr := make([]string, 0, len(fieldMask.Paths)) 2488 for _, path := range fieldMask.Paths { 2489 pathsStr = append(pathsStr, path.String()) 2490 } 2491 return strings.Join(pathsStr, ", ") 2492 } 2493 2494 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) IsFull() bool { 2495 if fieldMask == nil { 2496 return false 2497 } 2498 presentSelectors := make([]bool, 3) 2499 for _, path := range fieldMask.Paths { 2500 if asFinal, ok := path.(*DeviceSpecLoggingConfig_FieldTerminalPath); ok { 2501 presentSelectors[int(asFinal.selector)] = true 2502 } 2503 } 2504 for _, flag := range presentSelectors { 2505 if !flag { 2506 return false 2507 } 2508 } 2509 return true 2510 } 2511 2512 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) ProtoReflect() preflect.Message { 2513 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 2514 return ParseDeviceSpecLoggingConfig_FieldPath(raw) 2515 }) 2516 } 2517 2518 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) ProtoMessage() {} 2519 2520 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) Reset() { 2521 if fieldMask != nil { 2522 fieldMask.Paths = nil 2523 } 2524 } 2525 2526 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) Subtract(other *Device_Spec_LoggingConfig_FieldMask) *Device_Spec_LoggingConfig_FieldMask { 2527 result := &Device_Spec_LoggingConfig_FieldMask{} 2528 removedSelectors := make([]bool, 3) 2529 2530 for _, path := range other.GetPaths() { 2531 switch tp := path.(type) { 2532 case *DeviceSpecLoggingConfig_FieldTerminalPath: 2533 removedSelectors[int(tp.selector)] = true 2534 } 2535 } 2536 for _, path := range fieldMask.GetPaths() { 2537 if !removedSelectors[int(path.Selector())] { 2538 result.Paths = append(result.Paths, path) 2539 } 2540 } 2541 2542 if len(result.Paths) == 0 { 2543 return nil 2544 } 2545 return result 2546 } 2547 2548 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 2549 return fieldMask.Subtract(other.(*Device_Spec_LoggingConfig_FieldMask)) 2550 } 2551 2552 // FilterInputFields generates copy of field paths with output_only field paths removed 2553 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) FilterInputFields() *Device_Spec_LoggingConfig_FieldMask { 2554 result := &Device_Spec_LoggingConfig_FieldMask{} 2555 result.Paths = append(result.Paths, fieldMask.Paths...) 2556 return result 2557 } 2558 2559 // ToFieldMask is used for proto conversions 2560 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 2561 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2562 for _, path := range fieldMask.Paths { 2563 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 2564 } 2565 return protoFieldMask 2566 } 2567 2568 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 2569 if fieldMask == nil { 2570 return status.Error(codes.Internal, "target field mask is nil") 2571 } 2572 fieldMask.Paths = make([]DeviceSpecLoggingConfig_FieldPath, 0, len(protoFieldMask.Paths)) 2573 for _, strPath := range protoFieldMask.Paths { 2574 path, err := ParseDeviceSpecLoggingConfig_FieldPath(strPath) 2575 if err != nil { 2576 return err 2577 } 2578 fieldMask.Paths = append(fieldMask.Paths, path) 2579 } 2580 return nil 2581 } 2582 2583 // implement methods required by customType 2584 func (fieldMask Device_Spec_LoggingConfig_FieldMask) Marshal() ([]byte, error) { 2585 protoFieldMask := fieldMask.ToProtoFieldMask() 2586 return proto.Marshal(protoFieldMask) 2587 } 2588 2589 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) Unmarshal(data []byte) error { 2590 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2591 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 2592 return err 2593 } 2594 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2595 return err 2596 } 2597 return nil 2598 } 2599 2600 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) Size() int { 2601 return proto.Size(fieldMask.ToProtoFieldMask()) 2602 } 2603 2604 func (fieldMask Device_Spec_LoggingConfig_FieldMask) MarshalJSON() ([]byte, error) { 2605 return json.Marshal(fieldMask.ToProtoFieldMask()) 2606 } 2607 2608 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) UnmarshalJSON(data []byte) error { 2609 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2610 if err := json.Unmarshal(data, protoFieldMask); err != nil { 2611 return err 2612 } 2613 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2614 return err 2615 } 2616 return nil 2617 } 2618 2619 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) AppendPath(path DeviceSpecLoggingConfig_FieldPath) { 2620 fieldMask.Paths = append(fieldMask.Paths, path) 2621 } 2622 2623 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 2624 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecLoggingConfig_FieldPath)) 2625 } 2626 2627 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) GetPaths() []DeviceSpecLoggingConfig_FieldPath { 2628 if fieldMask == nil { 2629 return nil 2630 } 2631 return fieldMask.Paths 2632 } 2633 2634 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) GetRawPaths() []gotenobject.FieldPath { 2635 if fieldMask == nil { 2636 return nil 2637 } 2638 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 2639 for _, path := range fieldMask.Paths { 2640 rawPaths = append(rawPaths, path) 2641 } 2642 return rawPaths 2643 } 2644 2645 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) SetFromCliFlag(raw string) error { 2646 path, err := ParseDeviceSpecLoggingConfig_FieldPath(raw) 2647 if err != nil { 2648 return err 2649 } 2650 fieldMask.Paths = append(fieldMask.Paths, path) 2651 return nil 2652 } 2653 2654 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) Set(target, source *Device_Spec_LoggingConfig) { 2655 for _, path := range fieldMask.Paths { 2656 val, _ := path.GetSingle(source) 2657 // if val is nil, then field does not exist in source, skip 2658 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 2659 if val != nil { 2660 path.WithIValue(val).SetTo(&target) 2661 } 2662 } 2663 } 2664 2665 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 2666 fieldMask.Set(target.(*Device_Spec_LoggingConfig), source.(*Device_Spec_LoggingConfig)) 2667 } 2668 2669 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) Project(source *Device_Spec_LoggingConfig) *Device_Spec_LoggingConfig { 2670 if source == nil { 2671 return nil 2672 } 2673 if fieldMask == nil { 2674 return source 2675 } 2676 result := &Device_Spec_LoggingConfig{} 2677 2678 for _, p := range fieldMask.Paths { 2679 switch tp := p.(type) { 2680 case *DeviceSpecLoggingConfig_FieldTerminalPath: 2681 switch tp.selector { 2682 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 2683 result.Priority = source.Priority 2684 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 2685 result.Units = source.Units 2686 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 2687 result.EnableJournalExport = source.EnableJournalExport 2688 } 2689 } 2690 } 2691 return result 2692 } 2693 2694 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 2695 return fieldMask.Project(source.(*Device_Spec_LoggingConfig)) 2696 } 2697 2698 func (fieldMask *Device_Spec_LoggingConfig_FieldMask) PathsCount() int { 2699 if fieldMask == nil { 2700 return 0 2701 } 2702 return len(fieldMask.Paths) 2703 } 2704 2705 type Device_Spec_ProxyConfig_FieldMask struct { 2706 Paths []DeviceSpecProxyConfig_FieldPath 2707 } 2708 2709 func FullDevice_Spec_ProxyConfig_FieldMask() *Device_Spec_ProxyConfig_FieldMask { 2710 res := &Device_Spec_ProxyConfig_FieldMask{} 2711 res.Paths = append(res.Paths, &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorHttpProxy}) 2712 res.Paths = append(res.Paths, &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy}) 2713 res.Paths = append(res.Paths, &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorNoProxy}) 2714 res.Paths = append(res.Paths, &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces}) 2715 return res 2716 } 2717 2718 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) String() string { 2719 if fieldMask == nil { 2720 return "<nil>" 2721 } 2722 pathsStr := make([]string, 0, len(fieldMask.Paths)) 2723 for _, path := range fieldMask.Paths { 2724 pathsStr = append(pathsStr, path.String()) 2725 } 2726 return strings.Join(pathsStr, ", ") 2727 } 2728 2729 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) IsFull() bool { 2730 if fieldMask == nil { 2731 return false 2732 } 2733 presentSelectors := make([]bool, 4) 2734 for _, path := range fieldMask.Paths { 2735 if asFinal, ok := path.(*DeviceSpecProxyConfig_FieldTerminalPath); ok { 2736 presentSelectors[int(asFinal.selector)] = true 2737 } 2738 } 2739 for _, flag := range presentSelectors { 2740 if !flag { 2741 return false 2742 } 2743 } 2744 return true 2745 } 2746 2747 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) ProtoReflect() preflect.Message { 2748 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 2749 return ParseDeviceSpecProxyConfig_FieldPath(raw) 2750 }) 2751 } 2752 2753 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) ProtoMessage() {} 2754 2755 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) Reset() { 2756 if fieldMask != nil { 2757 fieldMask.Paths = nil 2758 } 2759 } 2760 2761 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) Subtract(other *Device_Spec_ProxyConfig_FieldMask) *Device_Spec_ProxyConfig_FieldMask { 2762 result := &Device_Spec_ProxyConfig_FieldMask{} 2763 removedSelectors := make([]bool, 4) 2764 2765 for _, path := range other.GetPaths() { 2766 switch tp := path.(type) { 2767 case *DeviceSpecProxyConfig_FieldTerminalPath: 2768 removedSelectors[int(tp.selector)] = true 2769 } 2770 } 2771 for _, path := range fieldMask.GetPaths() { 2772 if !removedSelectors[int(path.Selector())] { 2773 result.Paths = append(result.Paths, path) 2774 } 2775 } 2776 2777 if len(result.Paths) == 0 { 2778 return nil 2779 } 2780 return result 2781 } 2782 2783 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 2784 return fieldMask.Subtract(other.(*Device_Spec_ProxyConfig_FieldMask)) 2785 } 2786 2787 // FilterInputFields generates copy of field paths with output_only field paths removed 2788 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) FilterInputFields() *Device_Spec_ProxyConfig_FieldMask { 2789 result := &Device_Spec_ProxyConfig_FieldMask{} 2790 result.Paths = append(result.Paths, fieldMask.Paths...) 2791 return result 2792 } 2793 2794 // ToFieldMask is used for proto conversions 2795 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 2796 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2797 for _, path := range fieldMask.Paths { 2798 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 2799 } 2800 return protoFieldMask 2801 } 2802 2803 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 2804 if fieldMask == nil { 2805 return status.Error(codes.Internal, "target field mask is nil") 2806 } 2807 fieldMask.Paths = make([]DeviceSpecProxyConfig_FieldPath, 0, len(protoFieldMask.Paths)) 2808 for _, strPath := range protoFieldMask.Paths { 2809 path, err := ParseDeviceSpecProxyConfig_FieldPath(strPath) 2810 if err != nil { 2811 return err 2812 } 2813 fieldMask.Paths = append(fieldMask.Paths, path) 2814 } 2815 return nil 2816 } 2817 2818 // implement methods required by customType 2819 func (fieldMask Device_Spec_ProxyConfig_FieldMask) Marshal() ([]byte, error) { 2820 protoFieldMask := fieldMask.ToProtoFieldMask() 2821 return proto.Marshal(protoFieldMask) 2822 } 2823 2824 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) Unmarshal(data []byte) error { 2825 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2826 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 2827 return err 2828 } 2829 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2830 return err 2831 } 2832 return nil 2833 } 2834 2835 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) Size() int { 2836 return proto.Size(fieldMask.ToProtoFieldMask()) 2837 } 2838 2839 func (fieldMask Device_Spec_ProxyConfig_FieldMask) MarshalJSON() ([]byte, error) { 2840 return json.Marshal(fieldMask.ToProtoFieldMask()) 2841 } 2842 2843 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) UnmarshalJSON(data []byte) error { 2844 protoFieldMask := &googlefieldmaskpb.FieldMask{} 2845 if err := json.Unmarshal(data, protoFieldMask); err != nil { 2846 return err 2847 } 2848 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 2849 return err 2850 } 2851 return nil 2852 } 2853 2854 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) AppendPath(path DeviceSpecProxyConfig_FieldPath) { 2855 fieldMask.Paths = append(fieldMask.Paths, path) 2856 } 2857 2858 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 2859 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecProxyConfig_FieldPath)) 2860 } 2861 2862 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) GetPaths() []DeviceSpecProxyConfig_FieldPath { 2863 if fieldMask == nil { 2864 return nil 2865 } 2866 return fieldMask.Paths 2867 } 2868 2869 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) GetRawPaths() []gotenobject.FieldPath { 2870 if fieldMask == nil { 2871 return nil 2872 } 2873 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 2874 for _, path := range fieldMask.Paths { 2875 rawPaths = append(rawPaths, path) 2876 } 2877 return rawPaths 2878 } 2879 2880 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) SetFromCliFlag(raw string) error { 2881 path, err := ParseDeviceSpecProxyConfig_FieldPath(raw) 2882 if err != nil { 2883 return err 2884 } 2885 fieldMask.Paths = append(fieldMask.Paths, path) 2886 return nil 2887 } 2888 2889 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) Set(target, source *Device_Spec_ProxyConfig) { 2890 for _, path := range fieldMask.Paths { 2891 val, _ := path.GetSingle(source) 2892 // if val is nil, then field does not exist in source, skip 2893 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 2894 if val != nil { 2895 path.WithIValue(val).SetTo(&target) 2896 } 2897 } 2898 } 2899 2900 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 2901 fieldMask.Set(target.(*Device_Spec_ProxyConfig), source.(*Device_Spec_ProxyConfig)) 2902 } 2903 2904 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) Project(source *Device_Spec_ProxyConfig) *Device_Spec_ProxyConfig { 2905 if source == nil { 2906 return nil 2907 } 2908 if fieldMask == nil { 2909 return source 2910 } 2911 result := &Device_Spec_ProxyConfig{} 2912 2913 for _, p := range fieldMask.Paths { 2914 switch tp := p.(type) { 2915 case *DeviceSpecProxyConfig_FieldTerminalPath: 2916 switch tp.selector { 2917 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 2918 result.HttpProxy = source.HttpProxy 2919 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 2920 result.HttpsProxy = source.HttpsProxy 2921 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 2922 result.NoProxy = source.NoProxy 2923 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 2924 result.ProxyInterfaces = source.ProxyInterfaces 2925 } 2926 } 2927 } 2928 return result 2929 } 2930 2931 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 2932 return fieldMask.Project(source.(*Device_Spec_ProxyConfig)) 2933 } 2934 2935 func (fieldMask *Device_Spec_ProxyConfig_FieldMask) PathsCount() int { 2936 if fieldMask == nil { 2937 return 0 2938 } 2939 return len(fieldMask.Paths) 2940 } 2941 2942 type Device_Spec_Location_FieldMask struct { 2943 Paths []DeviceSpecLocation_FieldPath 2944 } 2945 2946 func FullDevice_Spec_Location_FieldMask() *Device_Spec_Location_FieldMask { 2947 res := &Device_Spec_Location_FieldMask{} 2948 res.Paths = append(res.Paths, &DeviceSpecLocation_FieldTerminalPath{selector: DeviceSpecLocation_FieldPathSelectorAddress}) 2949 res.Paths = append(res.Paths, &DeviceSpecLocation_FieldTerminalPath{selector: DeviceSpecLocation_FieldPathSelectorPlacement}) 2950 return res 2951 } 2952 2953 func (fieldMask *Device_Spec_Location_FieldMask) String() string { 2954 if fieldMask == nil { 2955 return "<nil>" 2956 } 2957 pathsStr := make([]string, 0, len(fieldMask.Paths)) 2958 for _, path := range fieldMask.Paths { 2959 pathsStr = append(pathsStr, path.String()) 2960 } 2961 return strings.Join(pathsStr, ", ") 2962 } 2963 2964 func (fieldMask *Device_Spec_Location_FieldMask) IsFull() bool { 2965 if fieldMask == nil { 2966 return false 2967 } 2968 presentSelectors := make([]bool, 2) 2969 for _, path := range fieldMask.Paths { 2970 if asFinal, ok := path.(*DeviceSpecLocation_FieldTerminalPath); ok { 2971 presentSelectors[int(asFinal.selector)] = true 2972 } 2973 } 2974 for _, flag := range presentSelectors { 2975 if !flag { 2976 return false 2977 } 2978 } 2979 return true 2980 } 2981 2982 func (fieldMask *Device_Spec_Location_FieldMask) ProtoReflect() preflect.Message { 2983 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 2984 return ParseDeviceSpecLocation_FieldPath(raw) 2985 }) 2986 } 2987 2988 func (fieldMask *Device_Spec_Location_FieldMask) ProtoMessage() {} 2989 2990 func (fieldMask *Device_Spec_Location_FieldMask) Reset() { 2991 if fieldMask != nil { 2992 fieldMask.Paths = nil 2993 } 2994 } 2995 2996 func (fieldMask *Device_Spec_Location_FieldMask) Subtract(other *Device_Spec_Location_FieldMask) *Device_Spec_Location_FieldMask { 2997 result := &Device_Spec_Location_FieldMask{} 2998 removedSelectors := make([]bool, 2) 2999 3000 for _, path := range other.GetPaths() { 3001 switch tp := path.(type) { 3002 case *DeviceSpecLocation_FieldTerminalPath: 3003 removedSelectors[int(tp.selector)] = true 3004 } 3005 } 3006 for _, path := range fieldMask.GetPaths() { 3007 if !removedSelectors[int(path.Selector())] { 3008 result.Paths = append(result.Paths, path) 3009 } 3010 } 3011 3012 if len(result.Paths) == 0 { 3013 return nil 3014 } 3015 return result 3016 } 3017 3018 func (fieldMask *Device_Spec_Location_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 3019 return fieldMask.Subtract(other.(*Device_Spec_Location_FieldMask)) 3020 } 3021 3022 // FilterInputFields generates copy of field paths with output_only field paths removed 3023 func (fieldMask *Device_Spec_Location_FieldMask) FilterInputFields() *Device_Spec_Location_FieldMask { 3024 result := &Device_Spec_Location_FieldMask{} 3025 result.Paths = append(result.Paths, fieldMask.Paths...) 3026 return result 3027 } 3028 3029 // ToFieldMask is used for proto conversions 3030 func (fieldMask *Device_Spec_Location_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 3031 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3032 for _, path := range fieldMask.Paths { 3033 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 3034 } 3035 return protoFieldMask 3036 } 3037 3038 func (fieldMask *Device_Spec_Location_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 3039 if fieldMask == nil { 3040 return status.Error(codes.Internal, "target field mask is nil") 3041 } 3042 fieldMask.Paths = make([]DeviceSpecLocation_FieldPath, 0, len(protoFieldMask.Paths)) 3043 for _, strPath := range protoFieldMask.Paths { 3044 path, err := ParseDeviceSpecLocation_FieldPath(strPath) 3045 if err != nil { 3046 return err 3047 } 3048 fieldMask.Paths = append(fieldMask.Paths, path) 3049 } 3050 return nil 3051 } 3052 3053 // implement methods required by customType 3054 func (fieldMask Device_Spec_Location_FieldMask) Marshal() ([]byte, error) { 3055 protoFieldMask := fieldMask.ToProtoFieldMask() 3056 return proto.Marshal(protoFieldMask) 3057 } 3058 3059 func (fieldMask *Device_Spec_Location_FieldMask) Unmarshal(data []byte) error { 3060 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3061 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 3062 return err 3063 } 3064 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 3065 return err 3066 } 3067 return nil 3068 } 3069 3070 func (fieldMask *Device_Spec_Location_FieldMask) Size() int { 3071 return proto.Size(fieldMask.ToProtoFieldMask()) 3072 } 3073 3074 func (fieldMask Device_Spec_Location_FieldMask) MarshalJSON() ([]byte, error) { 3075 return json.Marshal(fieldMask.ToProtoFieldMask()) 3076 } 3077 3078 func (fieldMask *Device_Spec_Location_FieldMask) UnmarshalJSON(data []byte) error { 3079 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3080 if err := json.Unmarshal(data, protoFieldMask); err != nil { 3081 return err 3082 } 3083 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 3084 return err 3085 } 3086 return nil 3087 } 3088 3089 func (fieldMask *Device_Spec_Location_FieldMask) AppendPath(path DeviceSpecLocation_FieldPath) { 3090 fieldMask.Paths = append(fieldMask.Paths, path) 3091 } 3092 3093 func (fieldMask *Device_Spec_Location_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 3094 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecLocation_FieldPath)) 3095 } 3096 3097 func (fieldMask *Device_Spec_Location_FieldMask) GetPaths() []DeviceSpecLocation_FieldPath { 3098 if fieldMask == nil { 3099 return nil 3100 } 3101 return fieldMask.Paths 3102 } 3103 3104 func (fieldMask *Device_Spec_Location_FieldMask) GetRawPaths() []gotenobject.FieldPath { 3105 if fieldMask == nil { 3106 return nil 3107 } 3108 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 3109 for _, path := range fieldMask.Paths { 3110 rawPaths = append(rawPaths, path) 3111 } 3112 return rawPaths 3113 } 3114 3115 func (fieldMask *Device_Spec_Location_FieldMask) SetFromCliFlag(raw string) error { 3116 path, err := ParseDeviceSpecLocation_FieldPath(raw) 3117 if err != nil { 3118 return err 3119 } 3120 fieldMask.Paths = append(fieldMask.Paths, path) 3121 return nil 3122 } 3123 3124 func (fieldMask *Device_Spec_Location_FieldMask) Set(target, source *Device_Spec_Location) { 3125 for _, path := range fieldMask.Paths { 3126 val, _ := path.GetSingle(source) 3127 // if val is nil, then field does not exist in source, skip 3128 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 3129 if val != nil { 3130 path.WithIValue(val).SetTo(&target) 3131 } 3132 } 3133 } 3134 3135 func (fieldMask *Device_Spec_Location_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 3136 fieldMask.Set(target.(*Device_Spec_Location), source.(*Device_Spec_Location)) 3137 } 3138 3139 func (fieldMask *Device_Spec_Location_FieldMask) Project(source *Device_Spec_Location) *Device_Spec_Location { 3140 if source == nil { 3141 return nil 3142 } 3143 if fieldMask == nil { 3144 return source 3145 } 3146 result := &Device_Spec_Location{} 3147 3148 for _, p := range fieldMask.Paths { 3149 switch tp := p.(type) { 3150 case *DeviceSpecLocation_FieldTerminalPath: 3151 switch tp.selector { 3152 case DeviceSpecLocation_FieldPathSelectorAddress: 3153 result.Address = source.Address 3154 case DeviceSpecLocation_FieldPathSelectorPlacement: 3155 result.Placement = source.Placement 3156 } 3157 } 3158 } 3159 return result 3160 } 3161 3162 func (fieldMask *Device_Spec_Location_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 3163 return fieldMask.Project(source.(*Device_Spec_Location)) 3164 } 3165 3166 func (fieldMask *Device_Spec_Location_FieldMask) PathsCount() int { 3167 if fieldMask == nil { 3168 return 0 3169 } 3170 return len(fieldMask.Paths) 3171 } 3172 3173 type Device_Spec_NetworkingConfig_CommonOpts_FieldMask struct { 3174 Paths []DeviceSpecNetworkingConfigCommonOpts_FieldPath 3175 } 3176 3177 func FullDevice_Spec_NetworkingConfig_CommonOpts_FieldMask() *Device_Spec_NetworkingConfig_CommonOpts_FieldMask { 3178 res := &Device_Spec_NetworkingConfig_CommonOpts_FieldMask{} 3179 return res 3180 } 3181 3182 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) String() string { 3183 if fieldMask == nil { 3184 return "<nil>" 3185 } 3186 pathsStr := make([]string, 0, len(fieldMask.Paths)) 3187 for _, path := range fieldMask.Paths { 3188 pathsStr = append(pathsStr, path.String()) 3189 } 3190 return strings.Join(pathsStr, ", ") 3191 } 3192 3193 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) IsFull() bool { 3194 if fieldMask == nil { 3195 return false 3196 } 3197 presentSelectors := make([]bool, 0) 3198 for _, path := range fieldMask.Paths { 3199 if asFinal, ok := path.(*DeviceSpecNetworkingConfigCommonOpts_FieldTerminalPath); ok { 3200 presentSelectors[int(asFinal.selector)] = true 3201 } 3202 } 3203 for _, flag := range presentSelectors { 3204 if !flag { 3205 return false 3206 } 3207 } 3208 return true 3209 } 3210 3211 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) ProtoReflect() preflect.Message { 3212 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 3213 return ParseDeviceSpecNetworkingConfigCommonOpts_FieldPath(raw) 3214 }) 3215 } 3216 3217 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) ProtoMessage() {} 3218 3219 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Reset() { 3220 if fieldMask != nil { 3221 fieldMask.Paths = nil 3222 } 3223 } 3224 3225 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) *Device_Spec_NetworkingConfig_CommonOpts_FieldMask { 3226 result := &Device_Spec_NetworkingConfig_CommonOpts_FieldMask{} 3227 removedSelectors := make([]bool, 0) 3228 3229 for _, path := range other.GetPaths() { 3230 switch tp := path.(type) { 3231 case *DeviceSpecNetworkingConfigCommonOpts_FieldTerminalPath: 3232 removedSelectors[int(tp.selector)] = true 3233 } 3234 } 3235 for _, path := range fieldMask.GetPaths() { 3236 if !removedSelectors[int(path.Selector())] { 3237 result.Paths = append(result.Paths, path) 3238 } 3239 } 3240 3241 if len(result.Paths) == 0 { 3242 return nil 3243 } 3244 return result 3245 } 3246 3247 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 3248 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_CommonOpts_FieldMask)) 3249 } 3250 3251 // FilterInputFields generates copy of field paths with output_only field paths removed 3252 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_CommonOpts_FieldMask { 3253 result := &Device_Spec_NetworkingConfig_CommonOpts_FieldMask{} 3254 result.Paths = append(result.Paths, fieldMask.Paths...) 3255 return result 3256 } 3257 3258 // ToFieldMask is used for proto conversions 3259 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 3260 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3261 for _, path := range fieldMask.Paths { 3262 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 3263 } 3264 return protoFieldMask 3265 } 3266 3267 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 3268 if fieldMask == nil { 3269 return status.Error(codes.Internal, "target field mask is nil") 3270 } 3271 fieldMask.Paths = make([]DeviceSpecNetworkingConfigCommonOpts_FieldPath, 0, len(protoFieldMask.Paths)) 3272 for _, strPath := range protoFieldMask.Paths { 3273 path, err := ParseDeviceSpecNetworkingConfigCommonOpts_FieldPath(strPath) 3274 if err != nil { 3275 return err 3276 } 3277 fieldMask.Paths = append(fieldMask.Paths, path) 3278 } 3279 return nil 3280 } 3281 3282 // implement methods required by customType 3283 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Marshal() ([]byte, error) { 3284 protoFieldMask := fieldMask.ToProtoFieldMask() 3285 return proto.Marshal(protoFieldMask) 3286 } 3287 3288 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Unmarshal(data []byte) error { 3289 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3290 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 3291 return err 3292 } 3293 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 3294 return err 3295 } 3296 return nil 3297 } 3298 3299 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Size() int { 3300 return proto.Size(fieldMask.ToProtoFieldMask()) 3301 } 3302 3303 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_FieldMask) MarshalJSON() ([]byte, error) { 3304 return json.Marshal(fieldMask.ToProtoFieldMask()) 3305 } 3306 3307 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) UnmarshalJSON(data []byte) error { 3308 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3309 if err := json.Unmarshal(data, protoFieldMask); err != nil { 3310 return err 3311 } 3312 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 3313 return err 3314 } 3315 return nil 3316 } 3317 3318 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigCommonOpts_FieldPath) { 3319 fieldMask.Paths = append(fieldMask.Paths, path) 3320 } 3321 3322 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 3323 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigCommonOpts_FieldPath)) 3324 } 3325 3326 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigCommonOpts_FieldPath { 3327 if fieldMask == nil { 3328 return nil 3329 } 3330 return fieldMask.Paths 3331 } 3332 3333 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 3334 if fieldMask == nil { 3335 return nil 3336 } 3337 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 3338 for _, path := range fieldMask.Paths { 3339 rawPaths = append(rawPaths, path) 3340 } 3341 return rawPaths 3342 } 3343 3344 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) SetFromCliFlag(raw string) error { 3345 path, err := ParseDeviceSpecNetworkingConfigCommonOpts_FieldPath(raw) 3346 if err != nil { 3347 return err 3348 } 3349 fieldMask.Paths = append(fieldMask.Paths, path) 3350 return nil 3351 } 3352 3353 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_CommonOpts) { 3354 for _, path := range fieldMask.Paths { 3355 val, _ := path.GetSingle(source) 3356 // if val is nil, then field does not exist in source, skip 3357 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 3358 if val != nil { 3359 path.WithIValue(val).SetTo(&target) 3360 } 3361 } 3362 } 3363 3364 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 3365 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_CommonOpts), source.(*Device_Spec_NetworkingConfig_CommonOpts)) 3366 } 3367 3368 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_CommonOpts) *Device_Spec_NetworkingConfig_CommonOpts { 3369 if source == nil { 3370 return nil 3371 } 3372 if fieldMask == nil { 3373 return source 3374 } 3375 result := &Device_Spec_NetworkingConfig_CommonOpts{} 3376 3377 for _, p := range fieldMask.Paths { 3378 switch tp := p.(type) { 3379 case *DeviceSpecNetworkingConfigCommonOpts_FieldTerminalPath: 3380 switch tp.selector { 3381 } 3382 } 3383 } 3384 return result 3385 } 3386 3387 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 3388 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_CommonOpts)) 3389 } 3390 3391 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_FieldMask) PathsCount() int { 3392 if fieldMask == nil { 3393 return 0 3394 } 3395 return len(fieldMask.Paths) 3396 } 3397 3398 type Device_Spec_NetworkingConfig_EthOpts_FieldMask struct { 3399 Paths []DeviceSpecNetworkingConfigEthOpts_FieldPath 3400 } 3401 3402 func FullDevice_Spec_NetworkingConfig_EthOpts_FieldMask() *Device_Spec_NetworkingConfig_EthOpts_FieldMask { 3403 res := &Device_Spec_NetworkingConfig_EthOpts_FieldMask{} 3404 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch}) 3405 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorSetName}) 3406 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorWakeonlan}) 3407 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRenderer}) 3408 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4}) 3409 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6}) 3410 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorIpv6Privacy}) 3411 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorLinkLocal}) 3412 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorCritical}) 3413 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcpIdentifier}) 3414 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides}) 3415 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides}) 3416 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAcceptRa}) 3417 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAddresses}) 3418 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers}) 3419 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMacaddress}) 3420 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMtu}) 3421 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorOptional}) 3422 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorOptionalAddresses}) 3423 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes}) 3424 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy}) 3425 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth}) 3426 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorGateway4}) 3427 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorGateway6}) 3428 return res 3429 } 3430 3431 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) String() string { 3432 if fieldMask == nil { 3433 return "<nil>" 3434 } 3435 pathsStr := make([]string, 0, len(fieldMask.Paths)) 3436 for _, path := range fieldMask.Paths { 3437 pathsStr = append(pathsStr, path.String()) 3438 } 3439 return strings.Join(pathsStr, ", ") 3440 } 3441 3442 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) IsFull() bool { 3443 if fieldMask == nil { 3444 return false 3445 } 3446 presentSelectors := make([]bool, 24) 3447 for _, path := range fieldMask.Paths { 3448 if asFinal, ok := path.(*DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath); ok { 3449 presentSelectors[int(asFinal.selector)] = true 3450 } 3451 } 3452 for _, flag := range presentSelectors { 3453 if !flag { 3454 return false 3455 } 3456 } 3457 return true 3458 } 3459 3460 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) ProtoReflect() preflect.Message { 3461 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 3462 return ParseDeviceSpecNetworkingConfigEthOpts_FieldPath(raw) 3463 }) 3464 } 3465 3466 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) ProtoMessage() {} 3467 3468 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) Reset() { 3469 if fieldMask != nil { 3470 fieldMask.Paths = nil 3471 } 3472 } 3473 3474 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_EthOpts_FieldMask) *Device_Spec_NetworkingConfig_EthOpts_FieldMask { 3475 result := &Device_Spec_NetworkingConfig_EthOpts_FieldMask{} 3476 removedSelectors := make([]bool, 24) 3477 otherSubMasks := map[DeviceSpecNetworkingConfigEthOpts_FieldPathSelector]gotenobject.FieldMask{ 3478 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch: &Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask{}, 3479 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3480 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3481 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 3482 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 3483 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 3484 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 3485 } 3486 mySubMasks := map[DeviceSpecNetworkingConfigEthOpts_FieldPathSelector]gotenobject.FieldMask{ 3487 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch: &Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask{}, 3488 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3489 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3490 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 3491 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 3492 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 3493 DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 3494 } 3495 3496 for _, path := range other.GetPaths() { 3497 switch tp := path.(type) { 3498 case *DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath: 3499 removedSelectors[int(tp.selector)] = true 3500 case *DeviceSpecNetworkingConfigEthOpts_FieldSubPath: 3501 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 3502 } 3503 } 3504 for _, path := range fieldMask.GetPaths() { 3505 if !removedSelectors[int(path.Selector())] { 3506 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 3507 if tp, ok := path.(*DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath); ok { 3508 switch tp.selector { 3509 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch: 3510 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch] = FullDevice_Spec_NetworkingConfig_EthOpts_Match_FieldMask() 3511 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides: 3512 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 3513 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides: 3514 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 3515 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers: 3516 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 3517 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes: 3518 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 3519 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy: 3520 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 3521 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth: 3522 mySubMasks[DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 3523 } 3524 } else if tp, ok := path.(*DeviceSpecNetworkingConfigEthOpts_FieldSubPath); ok { 3525 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 3526 } 3527 } else { 3528 result.Paths = append(result.Paths, path) 3529 } 3530 } 3531 } 3532 for selector, mySubMask := range mySubMasks { 3533 if mySubMask.PathsCount() > 0 { 3534 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 3535 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigEthOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 3536 } 3537 } 3538 } 3539 3540 if len(result.Paths) == 0 { 3541 return nil 3542 } 3543 return result 3544 } 3545 3546 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 3547 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_EthOpts_FieldMask)) 3548 } 3549 3550 // FilterInputFields generates copy of field paths with output_only field paths removed 3551 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_EthOpts_FieldMask { 3552 result := &Device_Spec_NetworkingConfig_EthOpts_FieldMask{} 3553 result.Paths = append(result.Paths, fieldMask.Paths...) 3554 return result 3555 } 3556 3557 // ToFieldMask is used for proto conversions 3558 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 3559 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3560 for _, path := range fieldMask.Paths { 3561 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 3562 } 3563 return protoFieldMask 3564 } 3565 3566 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 3567 if fieldMask == nil { 3568 return status.Error(codes.Internal, "target field mask is nil") 3569 } 3570 fieldMask.Paths = make([]DeviceSpecNetworkingConfigEthOpts_FieldPath, 0, len(protoFieldMask.Paths)) 3571 for _, strPath := range protoFieldMask.Paths { 3572 path, err := ParseDeviceSpecNetworkingConfigEthOpts_FieldPath(strPath) 3573 if err != nil { 3574 return err 3575 } 3576 fieldMask.Paths = append(fieldMask.Paths, path) 3577 } 3578 return nil 3579 } 3580 3581 // implement methods required by customType 3582 func (fieldMask Device_Spec_NetworkingConfig_EthOpts_FieldMask) Marshal() ([]byte, error) { 3583 protoFieldMask := fieldMask.ToProtoFieldMask() 3584 return proto.Marshal(protoFieldMask) 3585 } 3586 3587 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) Unmarshal(data []byte) error { 3588 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3589 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 3590 return err 3591 } 3592 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 3593 return err 3594 } 3595 return nil 3596 } 3597 3598 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) Size() int { 3599 return proto.Size(fieldMask.ToProtoFieldMask()) 3600 } 3601 3602 func (fieldMask Device_Spec_NetworkingConfig_EthOpts_FieldMask) MarshalJSON() ([]byte, error) { 3603 return json.Marshal(fieldMask.ToProtoFieldMask()) 3604 } 3605 3606 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) UnmarshalJSON(data []byte) error { 3607 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3608 if err := json.Unmarshal(data, protoFieldMask); err != nil { 3609 return err 3610 } 3611 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 3612 return err 3613 } 3614 return nil 3615 } 3616 3617 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigEthOpts_FieldPath) { 3618 fieldMask.Paths = append(fieldMask.Paths, path) 3619 } 3620 3621 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 3622 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigEthOpts_FieldPath)) 3623 } 3624 3625 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigEthOpts_FieldPath { 3626 if fieldMask == nil { 3627 return nil 3628 } 3629 return fieldMask.Paths 3630 } 3631 3632 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 3633 if fieldMask == nil { 3634 return nil 3635 } 3636 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 3637 for _, path := range fieldMask.Paths { 3638 rawPaths = append(rawPaths, path) 3639 } 3640 return rawPaths 3641 } 3642 3643 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) SetFromCliFlag(raw string) error { 3644 path, err := ParseDeviceSpecNetworkingConfigEthOpts_FieldPath(raw) 3645 if err != nil { 3646 return err 3647 } 3648 fieldMask.Paths = append(fieldMask.Paths, path) 3649 return nil 3650 } 3651 3652 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_EthOpts) { 3653 for _, path := range fieldMask.Paths { 3654 val, _ := path.GetSingle(source) 3655 // if val is nil, then field does not exist in source, skip 3656 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 3657 if val != nil { 3658 path.WithIValue(val).SetTo(&target) 3659 } 3660 } 3661 } 3662 3663 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 3664 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_EthOpts), source.(*Device_Spec_NetworkingConfig_EthOpts)) 3665 } 3666 3667 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_EthOpts) *Device_Spec_NetworkingConfig_EthOpts { 3668 if source == nil { 3669 return nil 3670 } 3671 if fieldMask == nil { 3672 return source 3673 } 3674 result := &Device_Spec_NetworkingConfig_EthOpts{} 3675 matchMask := &Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask{} 3676 wholeMatchAccepted := false 3677 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 3678 wholeDhcp4OverridesAccepted := false 3679 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 3680 wholeDhcp6OverridesAccepted := false 3681 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 3682 wholeNameserversAccepted := false 3683 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 3684 wholeRoutesAccepted := false 3685 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 3686 wholeRoutingPolicyAccepted := false 3687 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 3688 wholeAuthAccepted := false 3689 3690 for _, p := range fieldMask.Paths { 3691 switch tp := p.(type) { 3692 case *DeviceSpecNetworkingConfigEthOpts_FieldTerminalPath: 3693 switch tp.selector { 3694 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch: 3695 result.Match = source.Match 3696 wholeMatchAccepted = true 3697 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorSetName: 3698 result.SetName = source.SetName 3699 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorWakeonlan: 3700 result.Wakeonlan = source.Wakeonlan 3701 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRenderer: 3702 result.Renderer = source.Renderer 3703 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4: 3704 result.Dhcp4 = source.Dhcp4 3705 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6: 3706 result.Dhcp6 = source.Dhcp6 3707 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorIpv6Privacy: 3708 result.Ipv6Privacy = source.Ipv6Privacy 3709 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorLinkLocal: 3710 result.LinkLocal = source.LinkLocal 3711 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorCritical: 3712 result.Critical = source.Critical 3713 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcpIdentifier: 3714 result.DhcpIdentifier = source.DhcpIdentifier 3715 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides: 3716 result.Dhcp4Overrides = source.Dhcp4Overrides 3717 wholeDhcp4OverridesAccepted = true 3718 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides: 3719 result.Dhcp6Overrides = source.Dhcp6Overrides 3720 wholeDhcp6OverridesAccepted = true 3721 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAcceptRa: 3722 result.AcceptRa = source.AcceptRa 3723 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAddresses: 3724 result.Addresses = source.Addresses 3725 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers: 3726 result.Nameservers = source.Nameservers 3727 wholeNameserversAccepted = true 3728 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMacaddress: 3729 result.Macaddress = source.Macaddress 3730 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMtu: 3731 result.Mtu = source.Mtu 3732 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorOptional: 3733 result.Optional = source.Optional 3734 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorOptionalAddresses: 3735 result.OptionalAddresses = source.OptionalAddresses 3736 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes: 3737 result.Routes = source.Routes 3738 wholeRoutesAccepted = true 3739 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy: 3740 result.RoutingPolicy = source.RoutingPolicy 3741 wholeRoutingPolicyAccepted = true 3742 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth: 3743 result.Auth = source.Auth 3744 wholeAuthAccepted = true 3745 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorGateway4: 3746 result.Gateway4 = source.Gateway4 3747 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorGateway6: 3748 result.Gateway6 = source.Gateway6 3749 } 3750 case *DeviceSpecNetworkingConfigEthOpts_FieldSubPath: 3751 switch tp.selector { 3752 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorMatch: 3753 matchMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigEthOptsMatch_FieldPath)) 3754 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp4Overrides: 3755 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 3756 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorDhcp6Overrides: 3757 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 3758 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorNameservers: 3759 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 3760 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutes: 3761 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 3762 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorRoutingPolicy: 3763 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 3764 case DeviceSpecNetworkingConfigEthOpts_FieldPathSelectorAuth: 3765 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 3766 } 3767 } 3768 } 3769 if wholeMatchAccepted == false && len(matchMask.Paths) > 0 { 3770 result.Match = matchMask.Project(source.GetMatch()) 3771 } 3772 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 3773 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 3774 } 3775 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 3776 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 3777 } 3778 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 3779 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 3780 } 3781 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 3782 for _, sourceItem := range source.GetRoutes() { 3783 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 3784 } 3785 } 3786 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 3787 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 3788 } 3789 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 3790 result.Auth = authMask.Project(source.GetAuth()) 3791 } 3792 return result 3793 } 3794 3795 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 3796 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_EthOpts)) 3797 } 3798 3799 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_FieldMask) PathsCount() int { 3800 if fieldMask == nil { 3801 return 0 3802 } 3803 return len(fieldMask.Paths) 3804 } 3805 3806 type Device_Spec_NetworkingConfig_WifiOpts_FieldMask struct { 3807 Paths []DeviceSpecNetworkingConfigWifiOpts_FieldPath 3808 } 3809 3810 func FullDevice_Spec_NetworkingConfig_WifiOpts_FieldMask() *Device_Spec_NetworkingConfig_WifiOpts_FieldMask { 3811 res := &Device_Spec_NetworkingConfig_WifiOpts_FieldMask{} 3812 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch}) 3813 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorSetName}) 3814 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorWakeonlan}) 3815 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAccessPoints}) 3816 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorWakeonwlan}) 3817 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRegulatoryDomain}) 3818 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRenderer}) 3819 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4}) 3820 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6}) 3821 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorIpv6Privacy}) 3822 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorLinkLocal}) 3823 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorCritical}) 3824 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcpIdentifier}) 3825 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides}) 3826 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides}) 3827 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAcceptRa}) 3828 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAddresses}) 3829 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers}) 3830 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMacaddress}) 3831 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMtu}) 3832 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorOptional}) 3833 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorOptionalAddresses}) 3834 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes}) 3835 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy}) 3836 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth}) 3837 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorGateway4}) 3838 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorGateway6}) 3839 return res 3840 } 3841 3842 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) String() string { 3843 if fieldMask == nil { 3844 return "<nil>" 3845 } 3846 pathsStr := make([]string, 0, len(fieldMask.Paths)) 3847 for _, path := range fieldMask.Paths { 3848 pathsStr = append(pathsStr, path.String()) 3849 } 3850 return strings.Join(pathsStr, ", ") 3851 } 3852 3853 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) IsFull() bool { 3854 if fieldMask == nil { 3855 return false 3856 } 3857 presentSelectors := make([]bool, 27) 3858 for _, path := range fieldMask.Paths { 3859 if asFinal, ok := path.(*DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath); ok { 3860 presentSelectors[int(asFinal.selector)] = true 3861 } 3862 } 3863 for _, flag := range presentSelectors { 3864 if !flag { 3865 return false 3866 } 3867 } 3868 return true 3869 } 3870 3871 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) ProtoReflect() preflect.Message { 3872 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 3873 return ParseDeviceSpecNetworkingConfigWifiOpts_FieldPath(raw) 3874 }) 3875 } 3876 3877 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) ProtoMessage() {} 3878 3879 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Reset() { 3880 if fieldMask != nil { 3881 fieldMask.Paths = nil 3882 } 3883 } 3884 3885 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) *Device_Spec_NetworkingConfig_WifiOpts_FieldMask { 3886 result := &Device_Spec_NetworkingConfig_WifiOpts_FieldMask{} 3887 removedSelectors := make([]bool, 27) 3888 otherSubMasks := map[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelector]gotenobject.FieldMask{ 3889 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch: &Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask{}, 3890 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3891 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3892 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 3893 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 3894 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 3895 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 3896 } 3897 mySubMasks := map[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelector]gotenobject.FieldMask{ 3898 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch: &Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask{}, 3899 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3900 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 3901 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 3902 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 3903 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 3904 DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 3905 } 3906 3907 for _, path := range other.GetPaths() { 3908 switch tp := path.(type) { 3909 case *DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath: 3910 removedSelectors[int(tp.selector)] = true 3911 case *DeviceSpecNetworkingConfigWifiOpts_FieldSubPath: 3912 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 3913 } 3914 } 3915 for _, path := range fieldMask.GetPaths() { 3916 if !removedSelectors[int(path.Selector())] { 3917 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 3918 if tp, ok := path.(*DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath); ok { 3919 switch tp.selector { 3920 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch: 3921 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch] = FullDevice_Spec_NetworkingConfig_WifiOpts_Match_FieldMask() 3922 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides: 3923 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 3924 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides: 3925 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 3926 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers: 3927 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 3928 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes: 3929 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 3930 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy: 3931 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 3932 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth: 3933 mySubMasks[DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 3934 } 3935 } else if tp, ok := path.(*DeviceSpecNetworkingConfigWifiOpts_FieldSubPath); ok { 3936 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 3937 } 3938 } else { 3939 result.Paths = append(result.Paths, path) 3940 } 3941 } 3942 } 3943 for selector, mySubMask := range mySubMasks { 3944 if mySubMask.PathsCount() > 0 { 3945 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 3946 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigWifiOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 3947 } 3948 } 3949 } 3950 3951 if len(result.Paths) == 0 { 3952 return nil 3953 } 3954 return result 3955 } 3956 3957 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 3958 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_WifiOpts_FieldMask)) 3959 } 3960 3961 // FilterInputFields generates copy of field paths with output_only field paths removed 3962 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_WifiOpts_FieldMask { 3963 result := &Device_Spec_NetworkingConfig_WifiOpts_FieldMask{} 3964 result.Paths = append(result.Paths, fieldMask.Paths...) 3965 return result 3966 } 3967 3968 // ToFieldMask is used for proto conversions 3969 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 3970 protoFieldMask := &googlefieldmaskpb.FieldMask{} 3971 for _, path := range fieldMask.Paths { 3972 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 3973 } 3974 return protoFieldMask 3975 } 3976 3977 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 3978 if fieldMask == nil { 3979 return status.Error(codes.Internal, "target field mask is nil") 3980 } 3981 fieldMask.Paths = make([]DeviceSpecNetworkingConfigWifiOpts_FieldPath, 0, len(protoFieldMask.Paths)) 3982 for _, strPath := range protoFieldMask.Paths { 3983 path, err := ParseDeviceSpecNetworkingConfigWifiOpts_FieldPath(strPath) 3984 if err != nil { 3985 return err 3986 } 3987 fieldMask.Paths = append(fieldMask.Paths, path) 3988 } 3989 return nil 3990 } 3991 3992 // implement methods required by customType 3993 func (fieldMask Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Marshal() ([]byte, error) { 3994 protoFieldMask := fieldMask.ToProtoFieldMask() 3995 return proto.Marshal(protoFieldMask) 3996 } 3997 3998 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Unmarshal(data []byte) error { 3999 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4000 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 4001 return err 4002 } 4003 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 4004 return err 4005 } 4006 return nil 4007 } 4008 4009 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Size() int { 4010 return proto.Size(fieldMask.ToProtoFieldMask()) 4011 } 4012 4013 func (fieldMask Device_Spec_NetworkingConfig_WifiOpts_FieldMask) MarshalJSON() ([]byte, error) { 4014 return json.Marshal(fieldMask.ToProtoFieldMask()) 4015 } 4016 4017 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) UnmarshalJSON(data []byte) error { 4018 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4019 if err := json.Unmarshal(data, protoFieldMask); err != nil { 4020 return err 4021 } 4022 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 4023 return err 4024 } 4025 return nil 4026 } 4027 4028 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigWifiOpts_FieldPath) { 4029 fieldMask.Paths = append(fieldMask.Paths, path) 4030 } 4031 4032 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 4033 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigWifiOpts_FieldPath)) 4034 } 4035 4036 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigWifiOpts_FieldPath { 4037 if fieldMask == nil { 4038 return nil 4039 } 4040 return fieldMask.Paths 4041 } 4042 4043 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 4044 if fieldMask == nil { 4045 return nil 4046 } 4047 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 4048 for _, path := range fieldMask.Paths { 4049 rawPaths = append(rawPaths, path) 4050 } 4051 return rawPaths 4052 } 4053 4054 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) SetFromCliFlag(raw string) error { 4055 path, err := ParseDeviceSpecNetworkingConfigWifiOpts_FieldPath(raw) 4056 if err != nil { 4057 return err 4058 } 4059 fieldMask.Paths = append(fieldMask.Paths, path) 4060 return nil 4061 } 4062 4063 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_WifiOpts) { 4064 for _, path := range fieldMask.Paths { 4065 val, _ := path.GetSingle(source) 4066 // if val is nil, then field does not exist in source, skip 4067 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 4068 if val != nil { 4069 path.WithIValue(val).SetTo(&target) 4070 } 4071 } 4072 } 4073 4074 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 4075 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_WifiOpts), source.(*Device_Spec_NetworkingConfig_WifiOpts)) 4076 } 4077 4078 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_WifiOpts) *Device_Spec_NetworkingConfig_WifiOpts { 4079 if source == nil { 4080 return nil 4081 } 4082 if fieldMask == nil { 4083 return source 4084 } 4085 result := &Device_Spec_NetworkingConfig_WifiOpts{} 4086 matchMask := &Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask{} 4087 wholeMatchAccepted := false 4088 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 4089 wholeDhcp4OverridesAccepted := false 4090 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 4091 wholeDhcp6OverridesAccepted := false 4092 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 4093 wholeNameserversAccepted := false 4094 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 4095 wholeRoutesAccepted := false 4096 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 4097 wholeRoutingPolicyAccepted := false 4098 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 4099 wholeAuthAccepted := false 4100 var accessPointsMapKeys []string 4101 wholeAccessPointsAccepted := false 4102 4103 for _, p := range fieldMask.Paths { 4104 switch tp := p.(type) { 4105 case *DeviceSpecNetworkingConfigWifiOpts_FieldTerminalPath: 4106 switch tp.selector { 4107 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch: 4108 result.Match = source.Match 4109 wholeMatchAccepted = true 4110 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorSetName: 4111 result.SetName = source.SetName 4112 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorWakeonlan: 4113 result.Wakeonlan = source.Wakeonlan 4114 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAccessPoints: 4115 result.AccessPoints = source.AccessPoints 4116 wholeAccessPointsAccepted = true 4117 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorWakeonwlan: 4118 result.Wakeonwlan = source.Wakeonwlan 4119 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRegulatoryDomain: 4120 result.RegulatoryDomain = source.RegulatoryDomain 4121 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRenderer: 4122 result.Renderer = source.Renderer 4123 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4: 4124 result.Dhcp4 = source.Dhcp4 4125 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6: 4126 result.Dhcp6 = source.Dhcp6 4127 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorIpv6Privacy: 4128 result.Ipv6Privacy = source.Ipv6Privacy 4129 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorLinkLocal: 4130 result.LinkLocal = source.LinkLocal 4131 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorCritical: 4132 result.Critical = source.Critical 4133 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcpIdentifier: 4134 result.DhcpIdentifier = source.DhcpIdentifier 4135 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides: 4136 result.Dhcp4Overrides = source.Dhcp4Overrides 4137 wholeDhcp4OverridesAccepted = true 4138 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides: 4139 result.Dhcp6Overrides = source.Dhcp6Overrides 4140 wholeDhcp6OverridesAccepted = true 4141 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAcceptRa: 4142 result.AcceptRa = source.AcceptRa 4143 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAddresses: 4144 result.Addresses = source.Addresses 4145 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers: 4146 result.Nameservers = source.Nameservers 4147 wholeNameserversAccepted = true 4148 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMacaddress: 4149 result.Macaddress = source.Macaddress 4150 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMtu: 4151 result.Mtu = source.Mtu 4152 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorOptional: 4153 result.Optional = source.Optional 4154 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorOptionalAddresses: 4155 result.OptionalAddresses = source.OptionalAddresses 4156 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes: 4157 result.Routes = source.Routes 4158 wholeRoutesAccepted = true 4159 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy: 4160 result.RoutingPolicy = source.RoutingPolicy 4161 wholeRoutingPolicyAccepted = true 4162 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth: 4163 result.Auth = source.Auth 4164 wholeAuthAccepted = true 4165 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorGateway4: 4166 result.Gateway4 = source.Gateway4 4167 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorGateway6: 4168 result.Gateway6 = source.Gateway6 4169 } 4170 case *DeviceSpecNetworkingConfigWifiOpts_FieldSubPath: 4171 switch tp.selector { 4172 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorMatch: 4173 matchMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigWifiOptsMatch_FieldPath)) 4174 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp4Overrides: 4175 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 4176 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorDhcp6Overrides: 4177 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 4178 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorNameservers: 4179 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 4180 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutes: 4181 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 4182 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorRoutingPolicy: 4183 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 4184 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAuth: 4185 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 4186 } 4187 case *DeviceSpecNetworkingConfigWifiOpts_FieldPathMap: 4188 switch tp.selector { 4189 case DeviceSpecNetworkingConfigWifiOpts_FieldPathSelectorAccessPoints: 4190 accessPointsMapKeys = append(accessPointsMapKeys, tp.key) 4191 } 4192 } 4193 } 4194 if wholeMatchAccepted == false && len(matchMask.Paths) > 0 { 4195 result.Match = matchMask.Project(source.GetMatch()) 4196 } 4197 if wholeAccessPointsAccepted == false && len(accessPointsMapKeys) > 0 && source.GetAccessPoints() != nil { 4198 copiedMap := map[string]*Device_Spec_NetworkingConfig_WifiOpts_AccessPoint{} 4199 sourceMap := source.GetAccessPoints() 4200 for _, key := range accessPointsMapKeys { 4201 copiedMap[key] = sourceMap[key] 4202 } 4203 result.AccessPoints = copiedMap 4204 } 4205 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 4206 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 4207 } 4208 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 4209 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 4210 } 4211 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 4212 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 4213 } 4214 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 4215 for _, sourceItem := range source.GetRoutes() { 4216 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 4217 } 4218 } 4219 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 4220 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 4221 } 4222 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 4223 result.Auth = authMask.Project(source.GetAuth()) 4224 } 4225 return result 4226 } 4227 4228 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 4229 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_WifiOpts)) 4230 } 4231 4232 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_FieldMask) PathsCount() int { 4233 if fieldMask == nil { 4234 return 0 4235 } 4236 return len(fieldMask.Paths) 4237 } 4238 4239 type Device_Spec_NetworkingConfig_BridgesOpts_FieldMask struct { 4240 Paths []DeviceSpecNetworkingConfigBridgesOpts_FieldPath 4241 } 4242 4243 func FullDevice_Spec_NetworkingConfig_BridgesOpts_FieldMask() *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask { 4244 res := &Device_Spec_NetworkingConfig_BridgesOpts_FieldMask{} 4245 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorInterfaces}) 4246 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters}) 4247 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRenderer}) 4248 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4}) 4249 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6}) 4250 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorIpv6Privacy}) 4251 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorLinkLocal}) 4252 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorCritical}) 4253 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcpIdentifier}) 4254 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides}) 4255 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides}) 4256 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAcceptRa}) 4257 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAddresses}) 4258 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers}) 4259 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorMacaddress}) 4260 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorMtu}) 4261 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorOptional}) 4262 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorOptionalAddresses}) 4263 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes}) 4264 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy}) 4265 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth}) 4266 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorGateway4}) 4267 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorGateway6}) 4268 return res 4269 } 4270 4271 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) String() string { 4272 if fieldMask == nil { 4273 return "<nil>" 4274 } 4275 pathsStr := make([]string, 0, len(fieldMask.Paths)) 4276 for _, path := range fieldMask.Paths { 4277 pathsStr = append(pathsStr, path.String()) 4278 } 4279 return strings.Join(pathsStr, ", ") 4280 } 4281 4282 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) IsFull() bool { 4283 if fieldMask == nil { 4284 return false 4285 } 4286 presentSelectors := make([]bool, 23) 4287 for _, path := range fieldMask.Paths { 4288 if asFinal, ok := path.(*DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath); ok { 4289 presentSelectors[int(asFinal.selector)] = true 4290 } 4291 } 4292 for _, flag := range presentSelectors { 4293 if !flag { 4294 return false 4295 } 4296 } 4297 return true 4298 } 4299 4300 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) ProtoReflect() preflect.Message { 4301 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 4302 return ParseDeviceSpecNetworkingConfigBridgesOpts_FieldPath(raw) 4303 }) 4304 } 4305 4306 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) ProtoMessage() {} 4307 4308 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Reset() { 4309 if fieldMask != nil { 4310 fieldMask.Paths = nil 4311 } 4312 } 4313 4314 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask { 4315 result := &Device_Spec_NetworkingConfig_BridgesOpts_FieldMask{} 4316 removedSelectors := make([]bool, 23) 4317 otherSubMasks := map[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelector]gotenobject.FieldMask{ 4318 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters: &Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask{}, 4319 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4320 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4321 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 4322 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 4323 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 4324 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 4325 } 4326 mySubMasks := map[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelector]gotenobject.FieldMask{ 4327 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters: &Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask{}, 4328 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4329 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4330 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 4331 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 4332 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 4333 DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 4334 } 4335 4336 for _, path := range other.GetPaths() { 4337 switch tp := path.(type) { 4338 case *DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath: 4339 removedSelectors[int(tp.selector)] = true 4340 case *DeviceSpecNetworkingConfigBridgesOpts_FieldSubPath: 4341 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 4342 } 4343 } 4344 for _, path := range fieldMask.GetPaths() { 4345 if !removedSelectors[int(path.Selector())] { 4346 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 4347 if tp, ok := path.(*DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath); ok { 4348 switch tp.selector { 4349 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters: 4350 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters] = FullDevice_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask() 4351 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides: 4352 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 4353 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides: 4354 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 4355 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers: 4356 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 4357 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes: 4358 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 4359 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy: 4360 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 4361 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth: 4362 mySubMasks[DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 4363 } 4364 } else if tp, ok := path.(*DeviceSpecNetworkingConfigBridgesOpts_FieldSubPath); ok { 4365 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 4366 } 4367 } else { 4368 result.Paths = append(result.Paths, path) 4369 } 4370 } 4371 } 4372 for selector, mySubMask := range mySubMasks { 4373 if mySubMask.PathsCount() > 0 { 4374 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 4375 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigBridgesOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 4376 } 4377 } 4378 } 4379 4380 if len(result.Paths) == 0 { 4381 return nil 4382 } 4383 return result 4384 } 4385 4386 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 4387 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_BridgesOpts_FieldMask)) 4388 } 4389 4390 // FilterInputFields generates copy of field paths with output_only field paths removed 4391 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask { 4392 result := &Device_Spec_NetworkingConfig_BridgesOpts_FieldMask{} 4393 result.Paths = append(result.Paths, fieldMask.Paths...) 4394 return result 4395 } 4396 4397 // ToFieldMask is used for proto conversions 4398 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 4399 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4400 for _, path := range fieldMask.Paths { 4401 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 4402 } 4403 return protoFieldMask 4404 } 4405 4406 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 4407 if fieldMask == nil { 4408 return status.Error(codes.Internal, "target field mask is nil") 4409 } 4410 fieldMask.Paths = make([]DeviceSpecNetworkingConfigBridgesOpts_FieldPath, 0, len(protoFieldMask.Paths)) 4411 for _, strPath := range protoFieldMask.Paths { 4412 path, err := ParseDeviceSpecNetworkingConfigBridgesOpts_FieldPath(strPath) 4413 if err != nil { 4414 return err 4415 } 4416 fieldMask.Paths = append(fieldMask.Paths, path) 4417 } 4418 return nil 4419 } 4420 4421 // implement methods required by customType 4422 func (fieldMask Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Marshal() ([]byte, error) { 4423 protoFieldMask := fieldMask.ToProtoFieldMask() 4424 return proto.Marshal(protoFieldMask) 4425 } 4426 4427 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Unmarshal(data []byte) error { 4428 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4429 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 4430 return err 4431 } 4432 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 4433 return err 4434 } 4435 return nil 4436 } 4437 4438 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Size() int { 4439 return proto.Size(fieldMask.ToProtoFieldMask()) 4440 } 4441 4442 func (fieldMask Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) MarshalJSON() ([]byte, error) { 4443 return json.Marshal(fieldMask.ToProtoFieldMask()) 4444 } 4445 4446 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) UnmarshalJSON(data []byte) error { 4447 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4448 if err := json.Unmarshal(data, protoFieldMask); err != nil { 4449 return err 4450 } 4451 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 4452 return err 4453 } 4454 return nil 4455 } 4456 4457 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigBridgesOpts_FieldPath) { 4458 fieldMask.Paths = append(fieldMask.Paths, path) 4459 } 4460 4461 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 4462 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigBridgesOpts_FieldPath)) 4463 } 4464 4465 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigBridgesOpts_FieldPath { 4466 if fieldMask == nil { 4467 return nil 4468 } 4469 return fieldMask.Paths 4470 } 4471 4472 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 4473 if fieldMask == nil { 4474 return nil 4475 } 4476 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 4477 for _, path := range fieldMask.Paths { 4478 rawPaths = append(rawPaths, path) 4479 } 4480 return rawPaths 4481 } 4482 4483 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) SetFromCliFlag(raw string) error { 4484 path, err := ParseDeviceSpecNetworkingConfigBridgesOpts_FieldPath(raw) 4485 if err != nil { 4486 return err 4487 } 4488 fieldMask.Paths = append(fieldMask.Paths, path) 4489 return nil 4490 } 4491 4492 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_BridgesOpts) { 4493 for _, path := range fieldMask.Paths { 4494 val, _ := path.GetSingle(source) 4495 // if val is nil, then field does not exist in source, skip 4496 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 4497 if val != nil { 4498 path.WithIValue(val).SetTo(&target) 4499 } 4500 } 4501 } 4502 4503 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 4504 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_BridgesOpts), source.(*Device_Spec_NetworkingConfig_BridgesOpts)) 4505 } 4506 4507 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_BridgesOpts) *Device_Spec_NetworkingConfig_BridgesOpts { 4508 if source == nil { 4509 return nil 4510 } 4511 if fieldMask == nil { 4512 return source 4513 } 4514 result := &Device_Spec_NetworkingConfig_BridgesOpts{} 4515 parametersMask := &Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask{} 4516 wholeParametersAccepted := false 4517 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 4518 wholeDhcp4OverridesAccepted := false 4519 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 4520 wholeDhcp6OverridesAccepted := false 4521 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 4522 wholeNameserversAccepted := false 4523 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 4524 wholeRoutesAccepted := false 4525 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 4526 wholeRoutingPolicyAccepted := false 4527 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 4528 wholeAuthAccepted := false 4529 4530 for _, p := range fieldMask.Paths { 4531 switch tp := p.(type) { 4532 case *DeviceSpecNetworkingConfigBridgesOpts_FieldTerminalPath: 4533 switch tp.selector { 4534 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorInterfaces: 4535 result.Interfaces = source.Interfaces 4536 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters: 4537 result.Parameters = source.Parameters 4538 wholeParametersAccepted = true 4539 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRenderer: 4540 result.Renderer = source.Renderer 4541 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4: 4542 result.Dhcp4 = source.Dhcp4 4543 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6: 4544 result.Dhcp6 = source.Dhcp6 4545 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorIpv6Privacy: 4546 result.Ipv6Privacy = source.Ipv6Privacy 4547 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorLinkLocal: 4548 result.LinkLocal = source.LinkLocal 4549 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorCritical: 4550 result.Critical = source.Critical 4551 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcpIdentifier: 4552 result.DhcpIdentifier = source.DhcpIdentifier 4553 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides: 4554 result.Dhcp4Overrides = source.Dhcp4Overrides 4555 wholeDhcp4OverridesAccepted = true 4556 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides: 4557 result.Dhcp6Overrides = source.Dhcp6Overrides 4558 wholeDhcp6OverridesAccepted = true 4559 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAcceptRa: 4560 result.AcceptRa = source.AcceptRa 4561 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAddresses: 4562 result.Addresses = source.Addresses 4563 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers: 4564 result.Nameservers = source.Nameservers 4565 wholeNameserversAccepted = true 4566 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorMacaddress: 4567 result.Macaddress = source.Macaddress 4568 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorMtu: 4569 result.Mtu = source.Mtu 4570 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorOptional: 4571 result.Optional = source.Optional 4572 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorOptionalAddresses: 4573 result.OptionalAddresses = source.OptionalAddresses 4574 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes: 4575 result.Routes = source.Routes 4576 wholeRoutesAccepted = true 4577 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy: 4578 result.RoutingPolicy = source.RoutingPolicy 4579 wholeRoutingPolicyAccepted = true 4580 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth: 4581 result.Auth = source.Auth 4582 wholeAuthAccepted = true 4583 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorGateway4: 4584 result.Gateway4 = source.Gateway4 4585 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorGateway6: 4586 result.Gateway6 = source.Gateway6 4587 } 4588 case *DeviceSpecNetworkingConfigBridgesOpts_FieldSubPath: 4589 switch tp.selector { 4590 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorParameters: 4591 parametersMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath)) 4592 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp4Overrides: 4593 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 4594 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorDhcp6Overrides: 4595 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 4596 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorNameservers: 4597 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 4598 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutes: 4599 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 4600 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorRoutingPolicy: 4601 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 4602 case DeviceSpecNetworkingConfigBridgesOpts_FieldPathSelectorAuth: 4603 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 4604 } 4605 } 4606 } 4607 if wholeParametersAccepted == false && len(parametersMask.Paths) > 0 { 4608 result.Parameters = parametersMask.Project(source.GetParameters()) 4609 } 4610 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 4611 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 4612 } 4613 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 4614 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 4615 } 4616 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 4617 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 4618 } 4619 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 4620 for _, sourceItem := range source.GetRoutes() { 4621 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 4622 } 4623 } 4624 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 4625 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 4626 } 4627 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 4628 result.Auth = authMask.Project(source.GetAuth()) 4629 } 4630 return result 4631 } 4632 4633 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 4634 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_BridgesOpts)) 4635 } 4636 4637 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_FieldMask) PathsCount() int { 4638 if fieldMask == nil { 4639 return 0 4640 } 4641 return len(fieldMask.Paths) 4642 } 4643 4644 type Device_Spec_NetworkingConfig_BondsOpts_FieldMask struct { 4645 Paths []DeviceSpecNetworkingConfigBondsOpts_FieldPath 4646 } 4647 4648 func FullDevice_Spec_NetworkingConfig_BondsOpts_FieldMask() *Device_Spec_NetworkingConfig_BondsOpts_FieldMask { 4649 res := &Device_Spec_NetworkingConfig_BondsOpts_FieldMask{} 4650 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorInterfaces}) 4651 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters}) 4652 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRenderer}) 4653 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4}) 4654 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6}) 4655 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorIpv6Privacy}) 4656 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorLinkLocal}) 4657 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorCritical}) 4658 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcpIdentifier}) 4659 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides}) 4660 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides}) 4661 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAcceptRa}) 4662 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAddresses}) 4663 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers}) 4664 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorMacaddress}) 4665 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorMtu}) 4666 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorOptional}) 4667 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorOptionalAddresses}) 4668 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes}) 4669 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy}) 4670 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth}) 4671 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorGateway4}) 4672 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorGateway6}) 4673 return res 4674 } 4675 4676 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) String() string { 4677 if fieldMask == nil { 4678 return "<nil>" 4679 } 4680 pathsStr := make([]string, 0, len(fieldMask.Paths)) 4681 for _, path := range fieldMask.Paths { 4682 pathsStr = append(pathsStr, path.String()) 4683 } 4684 return strings.Join(pathsStr, ", ") 4685 } 4686 4687 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) IsFull() bool { 4688 if fieldMask == nil { 4689 return false 4690 } 4691 presentSelectors := make([]bool, 23) 4692 for _, path := range fieldMask.Paths { 4693 if asFinal, ok := path.(*DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath); ok { 4694 presentSelectors[int(asFinal.selector)] = true 4695 } 4696 } 4697 for _, flag := range presentSelectors { 4698 if !flag { 4699 return false 4700 } 4701 } 4702 return true 4703 } 4704 4705 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) ProtoReflect() preflect.Message { 4706 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 4707 return ParseDeviceSpecNetworkingConfigBondsOpts_FieldPath(raw) 4708 }) 4709 } 4710 4711 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) ProtoMessage() {} 4712 4713 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Reset() { 4714 if fieldMask != nil { 4715 fieldMask.Paths = nil 4716 } 4717 } 4718 4719 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) *Device_Spec_NetworkingConfig_BondsOpts_FieldMask { 4720 result := &Device_Spec_NetworkingConfig_BondsOpts_FieldMask{} 4721 removedSelectors := make([]bool, 23) 4722 otherSubMasks := map[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelector]gotenobject.FieldMask{ 4723 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters: &Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask{}, 4724 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4725 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4726 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 4727 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 4728 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 4729 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 4730 } 4731 mySubMasks := map[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelector]gotenobject.FieldMask{ 4732 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters: &Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask{}, 4733 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4734 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 4735 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 4736 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 4737 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 4738 DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 4739 } 4740 4741 for _, path := range other.GetPaths() { 4742 switch tp := path.(type) { 4743 case *DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath: 4744 removedSelectors[int(tp.selector)] = true 4745 case *DeviceSpecNetworkingConfigBondsOpts_FieldSubPath: 4746 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 4747 } 4748 } 4749 for _, path := range fieldMask.GetPaths() { 4750 if !removedSelectors[int(path.Selector())] { 4751 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 4752 if tp, ok := path.(*DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath); ok { 4753 switch tp.selector { 4754 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters: 4755 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters] = FullDevice_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask() 4756 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides: 4757 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 4758 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides: 4759 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 4760 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers: 4761 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 4762 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes: 4763 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 4764 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy: 4765 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 4766 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth: 4767 mySubMasks[DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 4768 } 4769 } else if tp, ok := path.(*DeviceSpecNetworkingConfigBondsOpts_FieldSubPath); ok { 4770 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 4771 } 4772 } else { 4773 result.Paths = append(result.Paths, path) 4774 } 4775 } 4776 } 4777 for selector, mySubMask := range mySubMasks { 4778 if mySubMask.PathsCount() > 0 { 4779 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 4780 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigBondsOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 4781 } 4782 } 4783 } 4784 4785 if len(result.Paths) == 0 { 4786 return nil 4787 } 4788 return result 4789 } 4790 4791 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 4792 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_BondsOpts_FieldMask)) 4793 } 4794 4795 // FilterInputFields generates copy of field paths with output_only field paths removed 4796 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_BondsOpts_FieldMask { 4797 result := &Device_Spec_NetworkingConfig_BondsOpts_FieldMask{} 4798 result.Paths = append(result.Paths, fieldMask.Paths...) 4799 return result 4800 } 4801 4802 // ToFieldMask is used for proto conversions 4803 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 4804 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4805 for _, path := range fieldMask.Paths { 4806 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 4807 } 4808 return protoFieldMask 4809 } 4810 4811 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 4812 if fieldMask == nil { 4813 return status.Error(codes.Internal, "target field mask is nil") 4814 } 4815 fieldMask.Paths = make([]DeviceSpecNetworkingConfigBondsOpts_FieldPath, 0, len(protoFieldMask.Paths)) 4816 for _, strPath := range protoFieldMask.Paths { 4817 path, err := ParseDeviceSpecNetworkingConfigBondsOpts_FieldPath(strPath) 4818 if err != nil { 4819 return err 4820 } 4821 fieldMask.Paths = append(fieldMask.Paths, path) 4822 } 4823 return nil 4824 } 4825 4826 // implement methods required by customType 4827 func (fieldMask Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Marshal() ([]byte, error) { 4828 protoFieldMask := fieldMask.ToProtoFieldMask() 4829 return proto.Marshal(protoFieldMask) 4830 } 4831 4832 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Unmarshal(data []byte) error { 4833 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4834 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 4835 return err 4836 } 4837 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 4838 return err 4839 } 4840 return nil 4841 } 4842 4843 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Size() int { 4844 return proto.Size(fieldMask.ToProtoFieldMask()) 4845 } 4846 4847 func (fieldMask Device_Spec_NetworkingConfig_BondsOpts_FieldMask) MarshalJSON() ([]byte, error) { 4848 return json.Marshal(fieldMask.ToProtoFieldMask()) 4849 } 4850 4851 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) UnmarshalJSON(data []byte) error { 4852 protoFieldMask := &googlefieldmaskpb.FieldMask{} 4853 if err := json.Unmarshal(data, protoFieldMask); err != nil { 4854 return err 4855 } 4856 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 4857 return err 4858 } 4859 return nil 4860 } 4861 4862 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigBondsOpts_FieldPath) { 4863 fieldMask.Paths = append(fieldMask.Paths, path) 4864 } 4865 4866 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 4867 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigBondsOpts_FieldPath)) 4868 } 4869 4870 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigBondsOpts_FieldPath { 4871 if fieldMask == nil { 4872 return nil 4873 } 4874 return fieldMask.Paths 4875 } 4876 4877 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 4878 if fieldMask == nil { 4879 return nil 4880 } 4881 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 4882 for _, path := range fieldMask.Paths { 4883 rawPaths = append(rawPaths, path) 4884 } 4885 return rawPaths 4886 } 4887 4888 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) SetFromCliFlag(raw string) error { 4889 path, err := ParseDeviceSpecNetworkingConfigBondsOpts_FieldPath(raw) 4890 if err != nil { 4891 return err 4892 } 4893 fieldMask.Paths = append(fieldMask.Paths, path) 4894 return nil 4895 } 4896 4897 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_BondsOpts) { 4898 for _, path := range fieldMask.Paths { 4899 val, _ := path.GetSingle(source) 4900 // if val is nil, then field does not exist in source, skip 4901 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 4902 if val != nil { 4903 path.WithIValue(val).SetTo(&target) 4904 } 4905 } 4906 } 4907 4908 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 4909 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_BondsOpts), source.(*Device_Spec_NetworkingConfig_BondsOpts)) 4910 } 4911 4912 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_BondsOpts) *Device_Spec_NetworkingConfig_BondsOpts { 4913 if source == nil { 4914 return nil 4915 } 4916 if fieldMask == nil { 4917 return source 4918 } 4919 result := &Device_Spec_NetworkingConfig_BondsOpts{} 4920 parametersMask := &Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask{} 4921 wholeParametersAccepted := false 4922 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 4923 wholeDhcp4OverridesAccepted := false 4924 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 4925 wholeDhcp6OverridesAccepted := false 4926 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 4927 wholeNameserversAccepted := false 4928 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 4929 wholeRoutesAccepted := false 4930 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 4931 wholeRoutingPolicyAccepted := false 4932 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 4933 wholeAuthAccepted := false 4934 4935 for _, p := range fieldMask.Paths { 4936 switch tp := p.(type) { 4937 case *DeviceSpecNetworkingConfigBondsOpts_FieldTerminalPath: 4938 switch tp.selector { 4939 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorInterfaces: 4940 result.Interfaces = source.Interfaces 4941 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters: 4942 result.Parameters = source.Parameters 4943 wholeParametersAccepted = true 4944 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRenderer: 4945 result.Renderer = source.Renderer 4946 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4: 4947 result.Dhcp4 = source.Dhcp4 4948 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6: 4949 result.Dhcp6 = source.Dhcp6 4950 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorIpv6Privacy: 4951 result.Ipv6Privacy = source.Ipv6Privacy 4952 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorLinkLocal: 4953 result.LinkLocal = source.LinkLocal 4954 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorCritical: 4955 result.Critical = source.Critical 4956 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcpIdentifier: 4957 result.DhcpIdentifier = source.DhcpIdentifier 4958 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides: 4959 result.Dhcp4Overrides = source.Dhcp4Overrides 4960 wholeDhcp4OverridesAccepted = true 4961 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides: 4962 result.Dhcp6Overrides = source.Dhcp6Overrides 4963 wholeDhcp6OverridesAccepted = true 4964 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAcceptRa: 4965 result.AcceptRa = source.AcceptRa 4966 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAddresses: 4967 result.Addresses = source.Addresses 4968 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers: 4969 result.Nameservers = source.Nameservers 4970 wholeNameserversAccepted = true 4971 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorMacaddress: 4972 result.Macaddress = source.Macaddress 4973 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorMtu: 4974 result.Mtu = source.Mtu 4975 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorOptional: 4976 result.Optional = source.Optional 4977 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorOptionalAddresses: 4978 result.OptionalAddresses = source.OptionalAddresses 4979 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes: 4980 result.Routes = source.Routes 4981 wholeRoutesAccepted = true 4982 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy: 4983 result.RoutingPolicy = source.RoutingPolicy 4984 wholeRoutingPolicyAccepted = true 4985 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth: 4986 result.Auth = source.Auth 4987 wholeAuthAccepted = true 4988 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorGateway4: 4989 result.Gateway4 = source.Gateway4 4990 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorGateway6: 4991 result.Gateway6 = source.Gateway6 4992 } 4993 case *DeviceSpecNetworkingConfigBondsOpts_FieldSubPath: 4994 switch tp.selector { 4995 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorParameters: 4996 parametersMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigBondsOptsParameters_FieldPath)) 4997 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp4Overrides: 4998 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 4999 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorDhcp6Overrides: 5000 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 5001 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorNameservers: 5002 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 5003 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutes: 5004 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 5005 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorRoutingPolicy: 5006 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 5007 case DeviceSpecNetworkingConfigBondsOpts_FieldPathSelectorAuth: 5008 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 5009 } 5010 } 5011 } 5012 if wholeParametersAccepted == false && len(parametersMask.Paths) > 0 { 5013 result.Parameters = parametersMask.Project(source.GetParameters()) 5014 } 5015 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 5016 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 5017 } 5018 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 5019 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 5020 } 5021 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 5022 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 5023 } 5024 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 5025 for _, sourceItem := range source.GetRoutes() { 5026 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 5027 } 5028 } 5029 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 5030 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 5031 } 5032 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 5033 result.Auth = authMask.Project(source.GetAuth()) 5034 } 5035 return result 5036 } 5037 5038 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 5039 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_BondsOpts)) 5040 } 5041 5042 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_FieldMask) PathsCount() int { 5043 if fieldMask == nil { 5044 return 0 5045 } 5046 return len(fieldMask.Paths) 5047 } 5048 5049 type Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask struct { 5050 Paths []DeviceSpecNetworkingConfigTunnelsOpts_FieldPath 5051 } 5052 5053 func FullDevice_Spec_NetworkingConfig_TunnelsOpts_FieldMask() *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask { 5054 res := &Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask{} 5055 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorMode}) 5056 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorLocal}) 5057 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRemote}) 5058 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorKey}) 5059 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRenderer}) 5060 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4}) 5061 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6}) 5062 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorIpv6Privacy}) 5063 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorLinkLocal}) 5064 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorCritical}) 5065 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcpIdentifier}) 5066 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides}) 5067 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides}) 5068 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAcceptRa}) 5069 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAddresses}) 5070 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers}) 5071 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorMacaddress}) 5072 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorMtu}) 5073 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorOptional}) 5074 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorOptionalAddresses}) 5075 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes}) 5076 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy}) 5077 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth}) 5078 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorGateway4}) 5079 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorGateway6}) 5080 return res 5081 } 5082 5083 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) String() string { 5084 if fieldMask == nil { 5085 return "<nil>" 5086 } 5087 pathsStr := make([]string, 0, len(fieldMask.Paths)) 5088 for _, path := range fieldMask.Paths { 5089 pathsStr = append(pathsStr, path.String()) 5090 } 5091 return strings.Join(pathsStr, ", ") 5092 } 5093 5094 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) IsFull() bool { 5095 if fieldMask == nil { 5096 return false 5097 } 5098 presentSelectors := make([]bool, 25) 5099 for _, path := range fieldMask.Paths { 5100 if asFinal, ok := path.(*DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath); ok { 5101 presentSelectors[int(asFinal.selector)] = true 5102 } 5103 } 5104 for _, flag := range presentSelectors { 5105 if !flag { 5106 return false 5107 } 5108 } 5109 return true 5110 } 5111 5112 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) ProtoReflect() preflect.Message { 5113 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 5114 return ParseDeviceSpecNetworkingConfigTunnelsOpts_FieldPath(raw) 5115 }) 5116 } 5117 5118 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) ProtoMessage() {} 5119 5120 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Reset() { 5121 if fieldMask != nil { 5122 fieldMask.Paths = nil 5123 } 5124 } 5125 5126 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask { 5127 result := &Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask{} 5128 removedSelectors := make([]bool, 25) 5129 otherSubMasks := map[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelector]gotenobject.FieldMask{ 5130 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5131 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5132 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 5133 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 5134 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 5135 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 5136 } 5137 mySubMasks := map[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelector]gotenobject.FieldMask{ 5138 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5139 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5140 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 5141 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 5142 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 5143 DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 5144 } 5145 5146 for _, path := range other.GetPaths() { 5147 switch tp := path.(type) { 5148 case *DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath: 5149 removedSelectors[int(tp.selector)] = true 5150 case *DeviceSpecNetworkingConfigTunnelsOpts_FieldSubPath: 5151 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 5152 } 5153 } 5154 for _, path := range fieldMask.GetPaths() { 5155 if !removedSelectors[int(path.Selector())] { 5156 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 5157 if tp, ok := path.(*DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath); ok { 5158 switch tp.selector { 5159 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides: 5160 mySubMasks[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 5161 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides: 5162 mySubMasks[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 5163 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers: 5164 mySubMasks[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 5165 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes: 5166 mySubMasks[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 5167 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy: 5168 mySubMasks[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 5169 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth: 5170 mySubMasks[DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 5171 } 5172 } else if tp, ok := path.(*DeviceSpecNetworkingConfigTunnelsOpts_FieldSubPath); ok { 5173 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 5174 } 5175 } else { 5176 result.Paths = append(result.Paths, path) 5177 } 5178 } 5179 } 5180 for selector, mySubMask := range mySubMasks { 5181 if mySubMask.PathsCount() > 0 { 5182 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 5183 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigTunnelsOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 5184 } 5185 } 5186 } 5187 5188 if len(result.Paths) == 0 { 5189 return nil 5190 } 5191 return result 5192 } 5193 5194 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 5195 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask)) 5196 } 5197 5198 // FilterInputFields generates copy of field paths with output_only field paths removed 5199 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask { 5200 result := &Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask{} 5201 result.Paths = append(result.Paths, fieldMask.Paths...) 5202 return result 5203 } 5204 5205 // ToFieldMask is used for proto conversions 5206 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 5207 protoFieldMask := &googlefieldmaskpb.FieldMask{} 5208 for _, path := range fieldMask.Paths { 5209 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 5210 } 5211 return protoFieldMask 5212 } 5213 5214 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 5215 if fieldMask == nil { 5216 return status.Error(codes.Internal, "target field mask is nil") 5217 } 5218 fieldMask.Paths = make([]DeviceSpecNetworkingConfigTunnelsOpts_FieldPath, 0, len(protoFieldMask.Paths)) 5219 for _, strPath := range protoFieldMask.Paths { 5220 path, err := ParseDeviceSpecNetworkingConfigTunnelsOpts_FieldPath(strPath) 5221 if err != nil { 5222 return err 5223 } 5224 fieldMask.Paths = append(fieldMask.Paths, path) 5225 } 5226 return nil 5227 } 5228 5229 // implement methods required by customType 5230 func (fieldMask Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Marshal() ([]byte, error) { 5231 protoFieldMask := fieldMask.ToProtoFieldMask() 5232 return proto.Marshal(protoFieldMask) 5233 } 5234 5235 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Unmarshal(data []byte) error { 5236 protoFieldMask := &googlefieldmaskpb.FieldMask{} 5237 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 5238 return err 5239 } 5240 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 5241 return err 5242 } 5243 return nil 5244 } 5245 5246 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Size() int { 5247 return proto.Size(fieldMask.ToProtoFieldMask()) 5248 } 5249 5250 func (fieldMask Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) MarshalJSON() ([]byte, error) { 5251 return json.Marshal(fieldMask.ToProtoFieldMask()) 5252 } 5253 5254 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) UnmarshalJSON(data []byte) error { 5255 protoFieldMask := &googlefieldmaskpb.FieldMask{} 5256 if err := json.Unmarshal(data, protoFieldMask); err != nil { 5257 return err 5258 } 5259 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 5260 return err 5261 } 5262 return nil 5263 } 5264 5265 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigTunnelsOpts_FieldPath) { 5266 fieldMask.Paths = append(fieldMask.Paths, path) 5267 } 5268 5269 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 5270 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigTunnelsOpts_FieldPath)) 5271 } 5272 5273 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigTunnelsOpts_FieldPath { 5274 if fieldMask == nil { 5275 return nil 5276 } 5277 return fieldMask.Paths 5278 } 5279 5280 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 5281 if fieldMask == nil { 5282 return nil 5283 } 5284 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 5285 for _, path := range fieldMask.Paths { 5286 rawPaths = append(rawPaths, path) 5287 } 5288 return rawPaths 5289 } 5290 5291 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) SetFromCliFlag(raw string) error { 5292 path, err := ParseDeviceSpecNetworkingConfigTunnelsOpts_FieldPath(raw) 5293 if err != nil { 5294 return err 5295 } 5296 fieldMask.Paths = append(fieldMask.Paths, path) 5297 return nil 5298 } 5299 5300 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_TunnelsOpts) { 5301 for _, path := range fieldMask.Paths { 5302 val, _ := path.GetSingle(source) 5303 // if val is nil, then field does not exist in source, skip 5304 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 5305 if val != nil { 5306 path.WithIValue(val).SetTo(&target) 5307 } 5308 } 5309 } 5310 5311 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 5312 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_TunnelsOpts), source.(*Device_Spec_NetworkingConfig_TunnelsOpts)) 5313 } 5314 5315 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_TunnelsOpts) *Device_Spec_NetworkingConfig_TunnelsOpts { 5316 if source == nil { 5317 return nil 5318 } 5319 if fieldMask == nil { 5320 return source 5321 } 5322 result := &Device_Spec_NetworkingConfig_TunnelsOpts{} 5323 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 5324 wholeDhcp4OverridesAccepted := false 5325 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 5326 wholeDhcp6OverridesAccepted := false 5327 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 5328 wholeNameserversAccepted := false 5329 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 5330 wholeRoutesAccepted := false 5331 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 5332 wholeRoutingPolicyAccepted := false 5333 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 5334 wholeAuthAccepted := false 5335 5336 for _, p := range fieldMask.Paths { 5337 switch tp := p.(type) { 5338 case *DeviceSpecNetworkingConfigTunnelsOpts_FieldTerminalPath: 5339 switch tp.selector { 5340 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorMode: 5341 result.Mode = source.Mode 5342 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorLocal: 5343 result.Local = source.Local 5344 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRemote: 5345 result.Remote = source.Remote 5346 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorKey: 5347 result.Key = source.Key 5348 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRenderer: 5349 result.Renderer = source.Renderer 5350 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4: 5351 result.Dhcp4 = source.Dhcp4 5352 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6: 5353 result.Dhcp6 = source.Dhcp6 5354 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorIpv6Privacy: 5355 result.Ipv6Privacy = source.Ipv6Privacy 5356 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorLinkLocal: 5357 result.LinkLocal = source.LinkLocal 5358 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorCritical: 5359 result.Critical = source.Critical 5360 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcpIdentifier: 5361 result.DhcpIdentifier = source.DhcpIdentifier 5362 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides: 5363 result.Dhcp4Overrides = source.Dhcp4Overrides 5364 wholeDhcp4OverridesAccepted = true 5365 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides: 5366 result.Dhcp6Overrides = source.Dhcp6Overrides 5367 wholeDhcp6OverridesAccepted = true 5368 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAcceptRa: 5369 result.AcceptRa = source.AcceptRa 5370 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAddresses: 5371 result.Addresses = source.Addresses 5372 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers: 5373 result.Nameservers = source.Nameservers 5374 wholeNameserversAccepted = true 5375 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorMacaddress: 5376 result.Macaddress = source.Macaddress 5377 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorMtu: 5378 result.Mtu = source.Mtu 5379 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorOptional: 5380 result.Optional = source.Optional 5381 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorOptionalAddresses: 5382 result.OptionalAddresses = source.OptionalAddresses 5383 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes: 5384 result.Routes = source.Routes 5385 wholeRoutesAccepted = true 5386 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy: 5387 result.RoutingPolicy = source.RoutingPolicy 5388 wholeRoutingPolicyAccepted = true 5389 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth: 5390 result.Auth = source.Auth 5391 wholeAuthAccepted = true 5392 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorGateway4: 5393 result.Gateway4 = source.Gateway4 5394 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorGateway6: 5395 result.Gateway6 = source.Gateway6 5396 } 5397 case *DeviceSpecNetworkingConfigTunnelsOpts_FieldSubPath: 5398 switch tp.selector { 5399 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp4Overrides: 5400 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 5401 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorDhcp6Overrides: 5402 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 5403 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorNameservers: 5404 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 5405 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutes: 5406 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 5407 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorRoutingPolicy: 5408 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 5409 case DeviceSpecNetworkingConfigTunnelsOpts_FieldPathSelectorAuth: 5410 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 5411 } 5412 } 5413 } 5414 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 5415 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 5416 } 5417 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 5418 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 5419 } 5420 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 5421 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 5422 } 5423 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 5424 for _, sourceItem := range source.GetRoutes() { 5425 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 5426 } 5427 } 5428 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 5429 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 5430 } 5431 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 5432 result.Auth = authMask.Project(source.GetAuth()) 5433 } 5434 return result 5435 } 5436 5437 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 5438 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_TunnelsOpts)) 5439 } 5440 5441 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_FieldMask) PathsCount() int { 5442 if fieldMask == nil { 5443 return 0 5444 } 5445 return len(fieldMask.Paths) 5446 } 5447 5448 type Device_Spec_NetworkingConfig_VlansOpts_FieldMask struct { 5449 Paths []DeviceSpecNetworkingConfigVlansOpts_FieldPath 5450 } 5451 5452 func FullDevice_Spec_NetworkingConfig_VlansOpts_FieldMask() *Device_Spec_NetworkingConfig_VlansOpts_FieldMask { 5453 res := &Device_Spec_NetworkingConfig_VlansOpts_FieldMask{} 5454 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorId}) 5455 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorLink}) 5456 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRenderer}) 5457 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4}) 5458 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6}) 5459 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorIpv6Privacy}) 5460 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorLinkLocal}) 5461 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorCritical}) 5462 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcpIdentifier}) 5463 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides}) 5464 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides}) 5465 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAcceptRa}) 5466 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAddresses}) 5467 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers}) 5468 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorMacaddress}) 5469 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorMtu}) 5470 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorOptional}) 5471 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorOptionalAddresses}) 5472 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes}) 5473 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy}) 5474 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth}) 5475 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorGateway4}) 5476 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorGateway6}) 5477 return res 5478 } 5479 5480 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) String() string { 5481 if fieldMask == nil { 5482 return "<nil>" 5483 } 5484 pathsStr := make([]string, 0, len(fieldMask.Paths)) 5485 for _, path := range fieldMask.Paths { 5486 pathsStr = append(pathsStr, path.String()) 5487 } 5488 return strings.Join(pathsStr, ", ") 5489 } 5490 5491 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) IsFull() bool { 5492 if fieldMask == nil { 5493 return false 5494 } 5495 presentSelectors := make([]bool, 23) 5496 for _, path := range fieldMask.Paths { 5497 if asFinal, ok := path.(*DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath); ok { 5498 presentSelectors[int(asFinal.selector)] = true 5499 } 5500 } 5501 for _, flag := range presentSelectors { 5502 if !flag { 5503 return false 5504 } 5505 } 5506 return true 5507 } 5508 5509 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) ProtoReflect() preflect.Message { 5510 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 5511 return ParseDeviceSpecNetworkingConfigVlansOpts_FieldPath(raw) 5512 }) 5513 } 5514 5515 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) ProtoMessage() {} 5516 5517 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Reset() { 5518 if fieldMask != nil { 5519 fieldMask.Paths = nil 5520 } 5521 } 5522 5523 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) *Device_Spec_NetworkingConfig_VlansOpts_FieldMask { 5524 result := &Device_Spec_NetworkingConfig_VlansOpts_FieldMask{} 5525 removedSelectors := make([]bool, 23) 5526 otherSubMasks := map[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelector]gotenobject.FieldMask{ 5527 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5528 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5529 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 5530 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 5531 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 5532 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 5533 } 5534 mySubMasks := map[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelector]gotenobject.FieldMask{ 5535 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5536 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5537 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 5538 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 5539 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 5540 DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 5541 } 5542 5543 for _, path := range other.GetPaths() { 5544 switch tp := path.(type) { 5545 case *DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath: 5546 removedSelectors[int(tp.selector)] = true 5547 case *DeviceSpecNetworkingConfigVlansOpts_FieldSubPath: 5548 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 5549 } 5550 } 5551 for _, path := range fieldMask.GetPaths() { 5552 if !removedSelectors[int(path.Selector())] { 5553 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 5554 if tp, ok := path.(*DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath); ok { 5555 switch tp.selector { 5556 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides: 5557 mySubMasks[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 5558 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides: 5559 mySubMasks[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 5560 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers: 5561 mySubMasks[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 5562 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes: 5563 mySubMasks[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 5564 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy: 5565 mySubMasks[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 5566 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth: 5567 mySubMasks[DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 5568 } 5569 } else if tp, ok := path.(*DeviceSpecNetworkingConfigVlansOpts_FieldSubPath); ok { 5570 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 5571 } 5572 } else { 5573 result.Paths = append(result.Paths, path) 5574 } 5575 } 5576 } 5577 for selector, mySubMask := range mySubMasks { 5578 if mySubMask.PathsCount() > 0 { 5579 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 5580 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigVlansOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 5581 } 5582 } 5583 } 5584 5585 if len(result.Paths) == 0 { 5586 return nil 5587 } 5588 return result 5589 } 5590 5591 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 5592 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_VlansOpts_FieldMask)) 5593 } 5594 5595 // FilterInputFields generates copy of field paths with output_only field paths removed 5596 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_VlansOpts_FieldMask { 5597 result := &Device_Spec_NetworkingConfig_VlansOpts_FieldMask{} 5598 result.Paths = append(result.Paths, fieldMask.Paths...) 5599 return result 5600 } 5601 5602 // ToFieldMask is used for proto conversions 5603 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 5604 protoFieldMask := &googlefieldmaskpb.FieldMask{} 5605 for _, path := range fieldMask.Paths { 5606 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 5607 } 5608 return protoFieldMask 5609 } 5610 5611 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 5612 if fieldMask == nil { 5613 return status.Error(codes.Internal, "target field mask is nil") 5614 } 5615 fieldMask.Paths = make([]DeviceSpecNetworkingConfigVlansOpts_FieldPath, 0, len(protoFieldMask.Paths)) 5616 for _, strPath := range protoFieldMask.Paths { 5617 path, err := ParseDeviceSpecNetworkingConfigVlansOpts_FieldPath(strPath) 5618 if err != nil { 5619 return err 5620 } 5621 fieldMask.Paths = append(fieldMask.Paths, path) 5622 } 5623 return nil 5624 } 5625 5626 // implement methods required by customType 5627 func (fieldMask Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Marshal() ([]byte, error) { 5628 protoFieldMask := fieldMask.ToProtoFieldMask() 5629 return proto.Marshal(protoFieldMask) 5630 } 5631 5632 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Unmarshal(data []byte) error { 5633 protoFieldMask := &googlefieldmaskpb.FieldMask{} 5634 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 5635 return err 5636 } 5637 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 5638 return err 5639 } 5640 return nil 5641 } 5642 5643 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Size() int { 5644 return proto.Size(fieldMask.ToProtoFieldMask()) 5645 } 5646 5647 func (fieldMask Device_Spec_NetworkingConfig_VlansOpts_FieldMask) MarshalJSON() ([]byte, error) { 5648 return json.Marshal(fieldMask.ToProtoFieldMask()) 5649 } 5650 5651 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) UnmarshalJSON(data []byte) error { 5652 protoFieldMask := &googlefieldmaskpb.FieldMask{} 5653 if err := json.Unmarshal(data, protoFieldMask); err != nil { 5654 return err 5655 } 5656 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 5657 return err 5658 } 5659 return nil 5660 } 5661 5662 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigVlansOpts_FieldPath) { 5663 fieldMask.Paths = append(fieldMask.Paths, path) 5664 } 5665 5666 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 5667 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigVlansOpts_FieldPath)) 5668 } 5669 5670 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigVlansOpts_FieldPath { 5671 if fieldMask == nil { 5672 return nil 5673 } 5674 return fieldMask.Paths 5675 } 5676 5677 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 5678 if fieldMask == nil { 5679 return nil 5680 } 5681 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 5682 for _, path := range fieldMask.Paths { 5683 rawPaths = append(rawPaths, path) 5684 } 5685 return rawPaths 5686 } 5687 5688 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) SetFromCliFlag(raw string) error { 5689 path, err := ParseDeviceSpecNetworkingConfigVlansOpts_FieldPath(raw) 5690 if err != nil { 5691 return err 5692 } 5693 fieldMask.Paths = append(fieldMask.Paths, path) 5694 return nil 5695 } 5696 5697 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_VlansOpts) { 5698 for _, path := range fieldMask.Paths { 5699 val, _ := path.GetSingle(source) 5700 // if val is nil, then field does not exist in source, skip 5701 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 5702 if val != nil { 5703 path.WithIValue(val).SetTo(&target) 5704 } 5705 } 5706 } 5707 5708 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 5709 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_VlansOpts), source.(*Device_Spec_NetworkingConfig_VlansOpts)) 5710 } 5711 5712 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_VlansOpts) *Device_Spec_NetworkingConfig_VlansOpts { 5713 if source == nil { 5714 return nil 5715 } 5716 if fieldMask == nil { 5717 return source 5718 } 5719 result := &Device_Spec_NetworkingConfig_VlansOpts{} 5720 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 5721 wholeDhcp4OverridesAccepted := false 5722 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 5723 wholeDhcp6OverridesAccepted := false 5724 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 5725 wholeNameserversAccepted := false 5726 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 5727 wholeRoutesAccepted := false 5728 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 5729 wholeRoutingPolicyAccepted := false 5730 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 5731 wholeAuthAccepted := false 5732 5733 for _, p := range fieldMask.Paths { 5734 switch tp := p.(type) { 5735 case *DeviceSpecNetworkingConfigVlansOpts_FieldTerminalPath: 5736 switch tp.selector { 5737 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorId: 5738 result.Id = source.Id 5739 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorLink: 5740 result.Link = source.Link 5741 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRenderer: 5742 result.Renderer = source.Renderer 5743 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4: 5744 result.Dhcp4 = source.Dhcp4 5745 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6: 5746 result.Dhcp6 = source.Dhcp6 5747 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorIpv6Privacy: 5748 result.Ipv6Privacy = source.Ipv6Privacy 5749 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorLinkLocal: 5750 result.LinkLocal = source.LinkLocal 5751 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorCritical: 5752 result.Critical = source.Critical 5753 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcpIdentifier: 5754 result.DhcpIdentifier = source.DhcpIdentifier 5755 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides: 5756 result.Dhcp4Overrides = source.Dhcp4Overrides 5757 wholeDhcp4OverridesAccepted = true 5758 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides: 5759 result.Dhcp6Overrides = source.Dhcp6Overrides 5760 wholeDhcp6OverridesAccepted = true 5761 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAcceptRa: 5762 result.AcceptRa = source.AcceptRa 5763 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAddresses: 5764 result.Addresses = source.Addresses 5765 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers: 5766 result.Nameservers = source.Nameservers 5767 wholeNameserversAccepted = true 5768 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorMacaddress: 5769 result.Macaddress = source.Macaddress 5770 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorMtu: 5771 result.Mtu = source.Mtu 5772 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorOptional: 5773 result.Optional = source.Optional 5774 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorOptionalAddresses: 5775 result.OptionalAddresses = source.OptionalAddresses 5776 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes: 5777 result.Routes = source.Routes 5778 wholeRoutesAccepted = true 5779 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy: 5780 result.RoutingPolicy = source.RoutingPolicy 5781 wholeRoutingPolicyAccepted = true 5782 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth: 5783 result.Auth = source.Auth 5784 wholeAuthAccepted = true 5785 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorGateway4: 5786 result.Gateway4 = source.Gateway4 5787 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorGateway6: 5788 result.Gateway6 = source.Gateway6 5789 } 5790 case *DeviceSpecNetworkingConfigVlansOpts_FieldSubPath: 5791 switch tp.selector { 5792 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp4Overrides: 5793 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 5794 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorDhcp6Overrides: 5795 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 5796 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorNameservers: 5797 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 5798 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutes: 5799 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 5800 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorRoutingPolicy: 5801 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 5802 case DeviceSpecNetworkingConfigVlansOpts_FieldPathSelectorAuth: 5803 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 5804 } 5805 } 5806 } 5807 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 5808 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 5809 } 5810 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 5811 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 5812 } 5813 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 5814 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 5815 } 5816 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 5817 for _, sourceItem := range source.GetRoutes() { 5818 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 5819 } 5820 } 5821 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 5822 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 5823 } 5824 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 5825 result.Auth = authMask.Project(source.GetAuth()) 5826 } 5827 return result 5828 } 5829 5830 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 5831 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_VlansOpts)) 5832 } 5833 5834 func (fieldMask *Device_Spec_NetworkingConfig_VlansOpts_FieldMask) PathsCount() int { 5835 if fieldMask == nil { 5836 return 0 5837 } 5838 return len(fieldMask.Paths) 5839 } 5840 5841 type Device_Spec_NetworkingConfig_ModemOpts_FieldMask struct { 5842 Paths []DeviceSpecNetworkingConfigModemOpts_FieldPath 5843 } 5844 5845 func FullDevice_Spec_NetworkingConfig_ModemOpts_FieldMask() *Device_Spec_NetworkingConfig_ModemOpts_FieldMask { 5846 res := &Device_Spec_NetworkingConfig_ModemOpts_FieldMask{} 5847 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorApn}) 5848 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorUsername}) 5849 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorPassword}) 5850 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNumber}) 5851 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNetworkId}) 5852 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDeviceId}) 5853 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorPin}) 5854 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorSimId}) 5855 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorSimOperatorId}) 5856 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAutoConfig}) 5857 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRenderer}) 5858 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4}) 5859 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6}) 5860 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorIpv6Privacy}) 5861 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorLinkLocal}) 5862 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorCritical}) 5863 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcpIdentifier}) 5864 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides}) 5865 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides}) 5866 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAcceptRa}) 5867 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAddresses}) 5868 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers}) 5869 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorMacaddress}) 5870 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorMtu}) 5871 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorOptional}) 5872 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorOptionalAddresses}) 5873 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes}) 5874 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy}) 5875 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth}) 5876 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorGateway4}) 5877 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath{selector: DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorGateway6}) 5878 return res 5879 } 5880 5881 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) String() string { 5882 if fieldMask == nil { 5883 return "<nil>" 5884 } 5885 pathsStr := make([]string, 0, len(fieldMask.Paths)) 5886 for _, path := range fieldMask.Paths { 5887 pathsStr = append(pathsStr, path.String()) 5888 } 5889 return strings.Join(pathsStr, ", ") 5890 } 5891 5892 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) IsFull() bool { 5893 if fieldMask == nil { 5894 return false 5895 } 5896 presentSelectors := make([]bool, 31) 5897 for _, path := range fieldMask.Paths { 5898 if asFinal, ok := path.(*DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath); ok { 5899 presentSelectors[int(asFinal.selector)] = true 5900 } 5901 } 5902 for _, flag := range presentSelectors { 5903 if !flag { 5904 return false 5905 } 5906 } 5907 return true 5908 } 5909 5910 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) ProtoReflect() preflect.Message { 5911 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 5912 return ParseDeviceSpecNetworkingConfigModemOpts_FieldPath(raw) 5913 }) 5914 } 5915 5916 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) ProtoMessage() {} 5917 5918 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Reset() { 5919 if fieldMask != nil { 5920 fieldMask.Paths = nil 5921 } 5922 } 5923 5924 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) *Device_Spec_NetworkingConfig_ModemOpts_FieldMask { 5925 result := &Device_Spec_NetworkingConfig_ModemOpts_FieldMask{} 5926 removedSelectors := make([]bool, 31) 5927 otherSubMasks := map[DeviceSpecNetworkingConfigModemOpts_FieldPathSelector]gotenobject.FieldMask{ 5928 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5929 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5930 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 5931 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 5932 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 5933 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 5934 } 5935 mySubMasks := map[DeviceSpecNetworkingConfigModemOpts_FieldPathSelector]gotenobject.FieldMask{ 5936 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5937 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides: &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{}, 5938 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers: &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{}, 5939 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes: &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{}, 5940 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy: &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{}, 5941 DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 5942 } 5943 5944 for _, path := range other.GetPaths() { 5945 switch tp := path.(type) { 5946 case *DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath: 5947 removedSelectors[int(tp.selector)] = true 5948 case *DeviceSpecNetworkingConfigModemOpts_FieldSubPath: 5949 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 5950 } 5951 } 5952 for _, path := range fieldMask.GetPaths() { 5953 if !removedSelectors[int(path.Selector())] { 5954 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 5955 if tp, ok := path.(*DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath); ok { 5956 switch tp.selector { 5957 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides: 5958 mySubMasks[DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 5959 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides: 5960 mySubMasks[DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides] = FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() 5961 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers: 5962 mySubMasks[DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers] = FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() 5963 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes: 5964 mySubMasks[DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes] = FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() 5965 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy: 5966 mySubMasks[DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy] = FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() 5967 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth: 5968 mySubMasks[DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 5969 } 5970 } else if tp, ok := path.(*DeviceSpecNetworkingConfigModemOpts_FieldSubPath); ok { 5971 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 5972 } 5973 } else { 5974 result.Paths = append(result.Paths, path) 5975 } 5976 } 5977 } 5978 for selector, mySubMask := range mySubMasks { 5979 if mySubMask.PathsCount() > 0 { 5980 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 5981 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigModemOpts_FieldSubPath{selector: selector, subPath: allowedPath}) 5982 } 5983 } 5984 } 5985 5986 if len(result.Paths) == 0 { 5987 return nil 5988 } 5989 return result 5990 } 5991 5992 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 5993 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_ModemOpts_FieldMask)) 5994 } 5995 5996 // FilterInputFields generates copy of field paths with output_only field paths removed 5997 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_ModemOpts_FieldMask { 5998 result := &Device_Spec_NetworkingConfig_ModemOpts_FieldMask{} 5999 result.Paths = append(result.Paths, fieldMask.Paths...) 6000 return result 6001 } 6002 6003 // ToFieldMask is used for proto conversions 6004 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 6005 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6006 for _, path := range fieldMask.Paths { 6007 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 6008 } 6009 return protoFieldMask 6010 } 6011 6012 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 6013 if fieldMask == nil { 6014 return status.Error(codes.Internal, "target field mask is nil") 6015 } 6016 fieldMask.Paths = make([]DeviceSpecNetworkingConfigModemOpts_FieldPath, 0, len(protoFieldMask.Paths)) 6017 for _, strPath := range protoFieldMask.Paths { 6018 path, err := ParseDeviceSpecNetworkingConfigModemOpts_FieldPath(strPath) 6019 if err != nil { 6020 return err 6021 } 6022 fieldMask.Paths = append(fieldMask.Paths, path) 6023 } 6024 return nil 6025 } 6026 6027 // implement methods required by customType 6028 func (fieldMask Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Marshal() ([]byte, error) { 6029 protoFieldMask := fieldMask.ToProtoFieldMask() 6030 return proto.Marshal(protoFieldMask) 6031 } 6032 6033 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Unmarshal(data []byte) error { 6034 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6035 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 6036 return err 6037 } 6038 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6039 return err 6040 } 6041 return nil 6042 } 6043 6044 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Size() int { 6045 return proto.Size(fieldMask.ToProtoFieldMask()) 6046 } 6047 6048 func (fieldMask Device_Spec_NetworkingConfig_ModemOpts_FieldMask) MarshalJSON() ([]byte, error) { 6049 return json.Marshal(fieldMask.ToProtoFieldMask()) 6050 } 6051 6052 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) UnmarshalJSON(data []byte) error { 6053 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6054 if err := json.Unmarshal(data, protoFieldMask); err != nil { 6055 return err 6056 } 6057 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6058 return err 6059 } 6060 return nil 6061 } 6062 6063 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) AppendPath(path DeviceSpecNetworkingConfigModemOpts_FieldPath) { 6064 fieldMask.Paths = append(fieldMask.Paths, path) 6065 } 6066 6067 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 6068 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigModemOpts_FieldPath)) 6069 } 6070 6071 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) GetPaths() []DeviceSpecNetworkingConfigModemOpts_FieldPath { 6072 if fieldMask == nil { 6073 return nil 6074 } 6075 return fieldMask.Paths 6076 } 6077 6078 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 6079 if fieldMask == nil { 6080 return nil 6081 } 6082 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 6083 for _, path := range fieldMask.Paths { 6084 rawPaths = append(rawPaths, path) 6085 } 6086 return rawPaths 6087 } 6088 6089 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) SetFromCliFlag(raw string) error { 6090 path, err := ParseDeviceSpecNetworkingConfigModemOpts_FieldPath(raw) 6091 if err != nil { 6092 return err 6093 } 6094 fieldMask.Paths = append(fieldMask.Paths, path) 6095 return nil 6096 } 6097 6098 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_ModemOpts) { 6099 for _, path := range fieldMask.Paths { 6100 val, _ := path.GetSingle(source) 6101 // if val is nil, then field does not exist in source, skip 6102 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 6103 if val != nil { 6104 path.WithIValue(val).SetTo(&target) 6105 } 6106 } 6107 } 6108 6109 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 6110 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_ModemOpts), source.(*Device_Spec_NetworkingConfig_ModemOpts)) 6111 } 6112 6113 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) Project(source *Device_Spec_NetworkingConfig_ModemOpts) *Device_Spec_NetworkingConfig_ModemOpts { 6114 if source == nil { 6115 return nil 6116 } 6117 if fieldMask == nil { 6118 return source 6119 } 6120 result := &Device_Spec_NetworkingConfig_ModemOpts{} 6121 dhcp4OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 6122 wholeDhcp4OverridesAccepted := false 6123 dhcp6OverridesMask := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 6124 wholeDhcp6OverridesAccepted := false 6125 nameserversMask := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 6126 wholeNameserversAccepted := false 6127 routesMask := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 6128 wholeRoutesAccepted := false 6129 routingPolicyMask := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 6130 wholeRoutingPolicyAccepted := false 6131 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 6132 wholeAuthAccepted := false 6133 6134 for _, p := range fieldMask.Paths { 6135 switch tp := p.(type) { 6136 case *DeviceSpecNetworkingConfigModemOpts_FieldTerminalPath: 6137 switch tp.selector { 6138 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorApn: 6139 result.Apn = source.Apn 6140 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorUsername: 6141 result.Username = source.Username 6142 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorPassword: 6143 result.Password = source.Password 6144 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNumber: 6145 result.Number = source.Number 6146 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNetworkId: 6147 result.NetworkId = source.NetworkId 6148 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDeviceId: 6149 result.DeviceId = source.DeviceId 6150 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorPin: 6151 result.Pin = source.Pin 6152 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorSimId: 6153 result.SimId = source.SimId 6154 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorSimOperatorId: 6155 result.SimOperatorId = source.SimOperatorId 6156 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAutoConfig: 6157 result.AutoConfig = source.AutoConfig 6158 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRenderer: 6159 result.Renderer = source.Renderer 6160 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4: 6161 result.Dhcp4 = source.Dhcp4 6162 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6: 6163 result.Dhcp6 = source.Dhcp6 6164 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorIpv6Privacy: 6165 result.Ipv6Privacy = source.Ipv6Privacy 6166 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorLinkLocal: 6167 result.LinkLocal = source.LinkLocal 6168 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorCritical: 6169 result.Critical = source.Critical 6170 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcpIdentifier: 6171 result.DhcpIdentifier = source.DhcpIdentifier 6172 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides: 6173 result.Dhcp4Overrides = source.Dhcp4Overrides 6174 wholeDhcp4OverridesAccepted = true 6175 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides: 6176 result.Dhcp6Overrides = source.Dhcp6Overrides 6177 wholeDhcp6OverridesAccepted = true 6178 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAcceptRa: 6179 result.AcceptRa = source.AcceptRa 6180 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAddresses: 6181 result.Addresses = source.Addresses 6182 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers: 6183 result.Nameservers = source.Nameservers 6184 wholeNameserversAccepted = true 6185 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorMacaddress: 6186 result.Macaddress = source.Macaddress 6187 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorMtu: 6188 result.Mtu = source.Mtu 6189 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorOptional: 6190 result.Optional = source.Optional 6191 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorOptionalAddresses: 6192 result.OptionalAddresses = source.OptionalAddresses 6193 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes: 6194 result.Routes = source.Routes 6195 wholeRoutesAccepted = true 6196 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy: 6197 result.RoutingPolicy = source.RoutingPolicy 6198 wholeRoutingPolicyAccepted = true 6199 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth: 6200 result.Auth = source.Auth 6201 wholeAuthAccepted = true 6202 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorGateway4: 6203 result.Gateway4 = source.Gateway4 6204 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorGateway6: 6205 result.Gateway6 = source.Gateway6 6206 } 6207 case *DeviceSpecNetworkingConfigModemOpts_FieldSubPath: 6208 switch tp.selector { 6209 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp4Overrides: 6210 dhcp4OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 6211 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorDhcp6Overrides: 6212 dhcp6OverridesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 6213 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorNameservers: 6214 nameserversMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 6215 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutes: 6216 routesMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 6217 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorRoutingPolicy: 6218 routingPolicyMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 6219 case DeviceSpecNetworkingConfigModemOpts_FieldPathSelectorAuth: 6220 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 6221 } 6222 } 6223 } 6224 if wholeDhcp4OverridesAccepted == false && len(dhcp4OverridesMask.Paths) > 0 { 6225 result.Dhcp4Overrides = dhcp4OverridesMask.Project(source.GetDhcp4Overrides()) 6226 } 6227 if wholeDhcp6OverridesAccepted == false && len(dhcp6OverridesMask.Paths) > 0 { 6228 result.Dhcp6Overrides = dhcp6OverridesMask.Project(source.GetDhcp6Overrides()) 6229 } 6230 if wholeNameserversAccepted == false && len(nameserversMask.Paths) > 0 { 6231 result.Nameservers = nameserversMask.Project(source.GetNameservers()) 6232 } 6233 if wholeRoutesAccepted == false && len(routesMask.Paths) > 0 { 6234 for _, sourceItem := range source.GetRoutes() { 6235 result.Routes = append(result.Routes, routesMask.Project(sourceItem)) 6236 } 6237 } 6238 if wholeRoutingPolicyAccepted == false && len(routingPolicyMask.Paths) > 0 { 6239 result.RoutingPolicy = routingPolicyMask.Project(source.GetRoutingPolicy()) 6240 } 6241 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 6242 result.Auth = authMask.Project(source.GetAuth()) 6243 } 6244 return result 6245 } 6246 6247 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 6248 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_ModemOpts)) 6249 } 6250 6251 func (fieldMask *Device_Spec_NetworkingConfig_ModemOpts_FieldMask) PathsCount() int { 6252 if fieldMask == nil { 6253 return 0 6254 } 6255 return len(fieldMask.Paths) 6256 } 6257 6258 type Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask struct { 6259 Paths []DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath 6260 } 6261 6262 func FullDevice_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask() *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask { 6263 res := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 6264 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseDns}) 6265 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseNtp}) 6266 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorSendHostname}) 6267 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseHostname}) 6268 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseMtu}) 6269 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorHostname}) 6270 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseRoutes}) 6271 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorRouteMetric}) 6272 return res 6273 } 6274 6275 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) String() string { 6276 if fieldMask == nil { 6277 return "<nil>" 6278 } 6279 pathsStr := make([]string, 0, len(fieldMask.Paths)) 6280 for _, path := range fieldMask.Paths { 6281 pathsStr = append(pathsStr, path.String()) 6282 } 6283 return strings.Join(pathsStr, ", ") 6284 } 6285 6286 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) IsFull() bool { 6287 if fieldMask == nil { 6288 return false 6289 } 6290 presentSelectors := make([]bool, 8) 6291 for _, path := range fieldMask.Paths { 6292 if asFinal, ok := path.(*DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath); ok { 6293 presentSelectors[int(asFinal.selector)] = true 6294 } 6295 } 6296 for _, flag := range presentSelectors { 6297 if !flag { 6298 return false 6299 } 6300 } 6301 return true 6302 } 6303 6304 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) ProtoReflect() preflect.Message { 6305 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 6306 return ParseDeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath(raw) 6307 }) 6308 } 6309 6310 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) ProtoMessage() {} 6311 6312 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Reset() { 6313 if fieldMask != nil { 6314 fieldMask.Paths = nil 6315 } 6316 } 6317 6318 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask { 6319 result := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 6320 removedSelectors := make([]bool, 8) 6321 6322 for _, path := range other.GetPaths() { 6323 switch tp := path.(type) { 6324 case *DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath: 6325 removedSelectors[int(tp.selector)] = true 6326 } 6327 } 6328 for _, path := range fieldMask.GetPaths() { 6329 if !removedSelectors[int(path.Selector())] { 6330 result.Paths = append(result.Paths, path) 6331 } 6332 } 6333 6334 if len(result.Paths) == 0 { 6335 return nil 6336 } 6337 return result 6338 } 6339 6340 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 6341 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask)) 6342 } 6343 6344 // FilterInputFields generates copy of field paths with output_only field paths removed 6345 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask { 6346 result := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask{} 6347 result.Paths = append(result.Paths, fieldMask.Paths...) 6348 return result 6349 } 6350 6351 // ToFieldMask is used for proto conversions 6352 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 6353 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6354 for _, path := range fieldMask.Paths { 6355 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 6356 } 6357 return protoFieldMask 6358 } 6359 6360 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 6361 if fieldMask == nil { 6362 return status.Error(codes.Internal, "target field mask is nil") 6363 } 6364 fieldMask.Paths = make([]DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath, 0, len(protoFieldMask.Paths)) 6365 for _, strPath := range protoFieldMask.Paths { 6366 path, err := ParseDeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath(strPath) 6367 if err != nil { 6368 return err 6369 } 6370 fieldMask.Paths = append(fieldMask.Paths, path) 6371 } 6372 return nil 6373 } 6374 6375 // implement methods required by customType 6376 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Marshal() ([]byte, error) { 6377 protoFieldMask := fieldMask.ToProtoFieldMask() 6378 return proto.Marshal(protoFieldMask) 6379 } 6380 6381 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Unmarshal(data []byte) error { 6382 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6383 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 6384 return err 6385 } 6386 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6387 return err 6388 } 6389 return nil 6390 } 6391 6392 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Size() int { 6393 return proto.Size(fieldMask.ToProtoFieldMask()) 6394 } 6395 6396 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) MarshalJSON() ([]byte, error) { 6397 return json.Marshal(fieldMask.ToProtoFieldMask()) 6398 } 6399 6400 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) UnmarshalJSON(data []byte) error { 6401 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6402 if err := json.Unmarshal(data, protoFieldMask); err != nil { 6403 return err 6404 } 6405 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6406 return err 6407 } 6408 return nil 6409 } 6410 6411 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) AppendPath(path DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath) { 6412 fieldMask.Paths = append(fieldMask.Paths, path) 6413 } 6414 6415 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 6416 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath)) 6417 } 6418 6419 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) GetPaths() []DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath { 6420 if fieldMask == nil { 6421 return nil 6422 } 6423 return fieldMask.Paths 6424 } 6425 6426 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) GetRawPaths() []gotenobject.FieldPath { 6427 if fieldMask == nil { 6428 return nil 6429 } 6430 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 6431 for _, path := range fieldMask.Paths { 6432 rawPaths = append(rawPaths, path) 6433 } 6434 return rawPaths 6435 } 6436 6437 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) SetFromCliFlag(raw string) error { 6438 path, err := ParseDeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPath(raw) 6439 if err != nil { 6440 return err 6441 } 6442 fieldMask.Paths = append(fieldMask.Paths, path) 6443 return nil 6444 } 6445 6446 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides) { 6447 for _, path := range fieldMask.Paths { 6448 val, _ := path.GetSingle(source) 6449 // if val is nil, then field does not exist in source, skip 6450 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 6451 if val != nil { 6452 path.WithIValue(val).SetTo(&target) 6453 } 6454 } 6455 } 6456 6457 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 6458 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides), source.(*Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides)) 6459 } 6460 6461 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) Project(source *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides) *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides { 6462 if source == nil { 6463 return nil 6464 } 6465 if fieldMask == nil { 6466 return source 6467 } 6468 result := &Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides{} 6469 6470 for _, p := range fieldMask.Paths { 6471 switch tp := p.(type) { 6472 case *DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldTerminalPath: 6473 switch tp.selector { 6474 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseDns: 6475 result.UseDns = source.UseDns 6476 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseNtp: 6477 result.UseNtp = source.UseNtp 6478 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorSendHostname: 6479 result.SendHostname = source.SendHostname 6480 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseHostname: 6481 result.UseHostname = source.UseHostname 6482 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseMtu: 6483 result.UseMtu = source.UseMtu 6484 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorHostname: 6485 result.Hostname = source.Hostname 6486 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorUseRoutes: 6487 result.UseRoutes = source.UseRoutes 6488 case DeviceSpecNetworkingConfigCommonOptsDHCPOverrides_FieldPathSelectorRouteMetric: 6489 result.RouteMetric = source.RouteMetric 6490 } 6491 } 6492 } 6493 return result 6494 } 6495 6496 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 6497 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides)) 6498 } 6499 6500 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_DHCPOverrides_FieldMask) PathsCount() int { 6501 if fieldMask == nil { 6502 return 0 6503 } 6504 return len(fieldMask.Paths) 6505 } 6506 6507 type Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask struct { 6508 Paths []DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath 6509 } 6510 6511 func FullDevice_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask() *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask { 6512 res := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 6513 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsNameservers_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPathSelectorSearch}) 6514 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsNameservers_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPathSelectorAddresses}) 6515 return res 6516 } 6517 6518 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) String() string { 6519 if fieldMask == nil { 6520 return "<nil>" 6521 } 6522 pathsStr := make([]string, 0, len(fieldMask.Paths)) 6523 for _, path := range fieldMask.Paths { 6524 pathsStr = append(pathsStr, path.String()) 6525 } 6526 return strings.Join(pathsStr, ", ") 6527 } 6528 6529 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) IsFull() bool { 6530 if fieldMask == nil { 6531 return false 6532 } 6533 presentSelectors := make([]bool, 2) 6534 for _, path := range fieldMask.Paths { 6535 if asFinal, ok := path.(*DeviceSpecNetworkingConfigCommonOptsNameservers_FieldTerminalPath); ok { 6536 presentSelectors[int(asFinal.selector)] = true 6537 } 6538 } 6539 for _, flag := range presentSelectors { 6540 if !flag { 6541 return false 6542 } 6543 } 6544 return true 6545 } 6546 6547 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) ProtoReflect() preflect.Message { 6548 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 6549 return ParseDeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath(raw) 6550 }) 6551 } 6552 6553 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) ProtoMessage() {} 6554 6555 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Reset() { 6556 if fieldMask != nil { 6557 fieldMask.Paths = nil 6558 } 6559 } 6560 6561 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask { 6562 result := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 6563 removedSelectors := make([]bool, 2) 6564 6565 for _, path := range other.GetPaths() { 6566 switch tp := path.(type) { 6567 case *DeviceSpecNetworkingConfigCommonOptsNameservers_FieldTerminalPath: 6568 removedSelectors[int(tp.selector)] = true 6569 } 6570 } 6571 for _, path := range fieldMask.GetPaths() { 6572 if !removedSelectors[int(path.Selector())] { 6573 result.Paths = append(result.Paths, path) 6574 } 6575 } 6576 6577 if len(result.Paths) == 0 { 6578 return nil 6579 } 6580 return result 6581 } 6582 6583 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 6584 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask)) 6585 } 6586 6587 // FilterInputFields generates copy of field paths with output_only field paths removed 6588 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask { 6589 result := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask{} 6590 result.Paths = append(result.Paths, fieldMask.Paths...) 6591 return result 6592 } 6593 6594 // ToFieldMask is used for proto conversions 6595 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 6596 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6597 for _, path := range fieldMask.Paths { 6598 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 6599 } 6600 return protoFieldMask 6601 } 6602 6603 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 6604 if fieldMask == nil { 6605 return status.Error(codes.Internal, "target field mask is nil") 6606 } 6607 fieldMask.Paths = make([]DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath, 0, len(protoFieldMask.Paths)) 6608 for _, strPath := range protoFieldMask.Paths { 6609 path, err := ParseDeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath(strPath) 6610 if err != nil { 6611 return err 6612 } 6613 fieldMask.Paths = append(fieldMask.Paths, path) 6614 } 6615 return nil 6616 } 6617 6618 // implement methods required by customType 6619 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Marshal() ([]byte, error) { 6620 protoFieldMask := fieldMask.ToProtoFieldMask() 6621 return proto.Marshal(protoFieldMask) 6622 } 6623 6624 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Unmarshal(data []byte) error { 6625 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6626 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 6627 return err 6628 } 6629 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6630 return err 6631 } 6632 return nil 6633 } 6634 6635 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Size() int { 6636 return proto.Size(fieldMask.ToProtoFieldMask()) 6637 } 6638 6639 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) MarshalJSON() ([]byte, error) { 6640 return json.Marshal(fieldMask.ToProtoFieldMask()) 6641 } 6642 6643 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) UnmarshalJSON(data []byte) error { 6644 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6645 if err := json.Unmarshal(data, protoFieldMask); err != nil { 6646 return err 6647 } 6648 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6649 return err 6650 } 6651 return nil 6652 } 6653 6654 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) AppendPath(path DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath) { 6655 fieldMask.Paths = append(fieldMask.Paths, path) 6656 } 6657 6658 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 6659 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath)) 6660 } 6661 6662 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) GetPaths() []DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath { 6663 if fieldMask == nil { 6664 return nil 6665 } 6666 return fieldMask.Paths 6667 } 6668 6669 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) GetRawPaths() []gotenobject.FieldPath { 6670 if fieldMask == nil { 6671 return nil 6672 } 6673 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 6674 for _, path := range fieldMask.Paths { 6675 rawPaths = append(rawPaths, path) 6676 } 6677 return rawPaths 6678 } 6679 6680 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) SetFromCliFlag(raw string) error { 6681 path, err := ParseDeviceSpecNetworkingConfigCommonOptsNameservers_FieldPath(raw) 6682 if err != nil { 6683 return err 6684 } 6685 fieldMask.Paths = append(fieldMask.Paths, path) 6686 return nil 6687 } 6688 6689 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_CommonOpts_Nameservers) { 6690 for _, path := range fieldMask.Paths { 6691 val, _ := path.GetSingle(source) 6692 // if val is nil, then field does not exist in source, skip 6693 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 6694 if val != nil { 6695 path.WithIValue(val).SetTo(&target) 6696 } 6697 } 6698 } 6699 6700 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 6701 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_CommonOpts_Nameservers), source.(*Device_Spec_NetworkingConfig_CommonOpts_Nameservers)) 6702 } 6703 6704 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) Project(source *Device_Spec_NetworkingConfig_CommonOpts_Nameservers) *Device_Spec_NetworkingConfig_CommonOpts_Nameservers { 6705 if source == nil { 6706 return nil 6707 } 6708 if fieldMask == nil { 6709 return source 6710 } 6711 result := &Device_Spec_NetworkingConfig_CommonOpts_Nameservers{} 6712 6713 for _, p := range fieldMask.Paths { 6714 switch tp := p.(type) { 6715 case *DeviceSpecNetworkingConfigCommonOptsNameservers_FieldTerminalPath: 6716 switch tp.selector { 6717 case DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPathSelectorSearch: 6718 result.Search = source.Search 6719 case DeviceSpecNetworkingConfigCommonOptsNameservers_FieldPathSelectorAddresses: 6720 result.Addresses = source.Addresses 6721 } 6722 } 6723 } 6724 return result 6725 } 6726 6727 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 6728 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_CommonOpts_Nameservers)) 6729 } 6730 6731 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Nameservers_FieldMask) PathsCount() int { 6732 if fieldMask == nil { 6733 return 0 6734 } 6735 return len(fieldMask.Paths) 6736 } 6737 6738 type Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask struct { 6739 Paths []DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath 6740 } 6741 6742 func FullDevice_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask() *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask { 6743 res := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 6744 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorFrom}) 6745 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorTo}) 6746 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorVia}) 6747 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorOnLink}) 6748 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorMetric}) 6749 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorType}) 6750 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorScope}) 6751 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorTable}) 6752 return res 6753 } 6754 6755 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) String() string { 6756 if fieldMask == nil { 6757 return "<nil>" 6758 } 6759 pathsStr := make([]string, 0, len(fieldMask.Paths)) 6760 for _, path := range fieldMask.Paths { 6761 pathsStr = append(pathsStr, path.String()) 6762 } 6763 return strings.Join(pathsStr, ", ") 6764 } 6765 6766 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) IsFull() bool { 6767 if fieldMask == nil { 6768 return false 6769 } 6770 presentSelectors := make([]bool, 8) 6771 for _, path := range fieldMask.Paths { 6772 if asFinal, ok := path.(*DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath); ok { 6773 presentSelectors[int(asFinal.selector)] = true 6774 } 6775 } 6776 for _, flag := range presentSelectors { 6777 if !flag { 6778 return false 6779 } 6780 } 6781 return true 6782 } 6783 6784 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) ProtoReflect() preflect.Message { 6785 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 6786 return ParseDeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath(raw) 6787 }) 6788 } 6789 6790 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) ProtoMessage() {} 6791 6792 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Reset() { 6793 if fieldMask != nil { 6794 fieldMask.Paths = nil 6795 } 6796 } 6797 6798 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask { 6799 result := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 6800 removedSelectors := make([]bool, 8) 6801 6802 for _, path := range other.GetPaths() { 6803 switch tp := path.(type) { 6804 case *DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath: 6805 removedSelectors[int(tp.selector)] = true 6806 } 6807 } 6808 for _, path := range fieldMask.GetPaths() { 6809 if !removedSelectors[int(path.Selector())] { 6810 result.Paths = append(result.Paths, path) 6811 } 6812 } 6813 6814 if len(result.Paths) == 0 { 6815 return nil 6816 } 6817 return result 6818 } 6819 6820 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 6821 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask)) 6822 } 6823 6824 // FilterInputFields generates copy of field paths with output_only field paths removed 6825 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask { 6826 result := &Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask{} 6827 result.Paths = append(result.Paths, fieldMask.Paths...) 6828 return result 6829 } 6830 6831 // ToFieldMask is used for proto conversions 6832 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 6833 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6834 for _, path := range fieldMask.Paths { 6835 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 6836 } 6837 return protoFieldMask 6838 } 6839 6840 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 6841 if fieldMask == nil { 6842 return status.Error(codes.Internal, "target field mask is nil") 6843 } 6844 fieldMask.Paths = make([]DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath, 0, len(protoFieldMask.Paths)) 6845 for _, strPath := range protoFieldMask.Paths { 6846 path, err := ParseDeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath(strPath) 6847 if err != nil { 6848 return err 6849 } 6850 fieldMask.Paths = append(fieldMask.Paths, path) 6851 } 6852 return nil 6853 } 6854 6855 // implement methods required by customType 6856 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Marshal() ([]byte, error) { 6857 protoFieldMask := fieldMask.ToProtoFieldMask() 6858 return proto.Marshal(protoFieldMask) 6859 } 6860 6861 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Unmarshal(data []byte) error { 6862 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6863 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 6864 return err 6865 } 6866 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6867 return err 6868 } 6869 return nil 6870 } 6871 6872 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Size() int { 6873 return proto.Size(fieldMask.ToProtoFieldMask()) 6874 } 6875 6876 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) MarshalJSON() ([]byte, error) { 6877 return json.Marshal(fieldMask.ToProtoFieldMask()) 6878 } 6879 6880 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) UnmarshalJSON(data []byte) error { 6881 protoFieldMask := &googlefieldmaskpb.FieldMask{} 6882 if err := json.Unmarshal(data, protoFieldMask); err != nil { 6883 return err 6884 } 6885 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 6886 return err 6887 } 6888 return nil 6889 } 6890 6891 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) AppendPath(path DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath) { 6892 fieldMask.Paths = append(fieldMask.Paths, path) 6893 } 6894 6895 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 6896 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath)) 6897 } 6898 6899 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) GetPaths() []DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath { 6900 if fieldMask == nil { 6901 return nil 6902 } 6903 return fieldMask.Paths 6904 } 6905 6906 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) GetRawPaths() []gotenobject.FieldPath { 6907 if fieldMask == nil { 6908 return nil 6909 } 6910 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 6911 for _, path := range fieldMask.Paths { 6912 rawPaths = append(rawPaths, path) 6913 } 6914 return rawPaths 6915 } 6916 6917 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) SetFromCliFlag(raw string) error { 6918 path, err := ParseDeviceSpecNetworkingConfigCommonOptsRoutes_FieldPath(raw) 6919 if err != nil { 6920 return err 6921 } 6922 fieldMask.Paths = append(fieldMask.Paths, path) 6923 return nil 6924 } 6925 6926 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_CommonOpts_Routes) { 6927 for _, path := range fieldMask.Paths { 6928 val, _ := path.GetSingle(source) 6929 // if val is nil, then field does not exist in source, skip 6930 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 6931 if val != nil { 6932 path.WithIValue(val).SetTo(&target) 6933 } 6934 } 6935 } 6936 6937 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 6938 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_CommonOpts_Routes), source.(*Device_Spec_NetworkingConfig_CommonOpts_Routes)) 6939 } 6940 6941 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) Project(source *Device_Spec_NetworkingConfig_CommonOpts_Routes) *Device_Spec_NetworkingConfig_CommonOpts_Routes { 6942 if source == nil { 6943 return nil 6944 } 6945 if fieldMask == nil { 6946 return source 6947 } 6948 result := &Device_Spec_NetworkingConfig_CommonOpts_Routes{} 6949 6950 for _, p := range fieldMask.Paths { 6951 switch tp := p.(type) { 6952 case *DeviceSpecNetworkingConfigCommonOptsRoutes_FieldTerminalPath: 6953 switch tp.selector { 6954 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorFrom: 6955 result.From = source.From 6956 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorTo: 6957 result.To = source.To 6958 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorVia: 6959 result.Via = source.Via 6960 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorOnLink: 6961 result.OnLink = source.OnLink 6962 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorMetric: 6963 result.Metric = source.Metric 6964 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorType: 6965 result.Type = source.Type 6966 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorScope: 6967 result.Scope = source.Scope 6968 case DeviceSpecNetworkingConfigCommonOptsRoutes_FieldPathSelectorTable: 6969 result.Table = source.Table 6970 } 6971 } 6972 } 6973 return result 6974 } 6975 6976 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 6977 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_CommonOpts_Routes)) 6978 } 6979 6980 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Routes_FieldMask) PathsCount() int { 6981 if fieldMask == nil { 6982 return 0 6983 } 6984 return len(fieldMask.Paths) 6985 } 6986 6987 type Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask struct { 6988 Paths []DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath 6989 } 6990 6991 func FullDevice_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask() *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask { 6992 res := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 6993 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorFrom}) 6994 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorTo}) 6995 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorTable}) 6996 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorPriority}) 6997 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorMark}) 6998 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorTypeOfService}) 6999 return res 7000 } 7001 7002 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) String() string { 7003 if fieldMask == nil { 7004 return "<nil>" 7005 } 7006 pathsStr := make([]string, 0, len(fieldMask.Paths)) 7007 for _, path := range fieldMask.Paths { 7008 pathsStr = append(pathsStr, path.String()) 7009 } 7010 return strings.Join(pathsStr, ", ") 7011 } 7012 7013 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) IsFull() bool { 7014 if fieldMask == nil { 7015 return false 7016 } 7017 presentSelectors := make([]bool, 6) 7018 for _, path := range fieldMask.Paths { 7019 if asFinal, ok := path.(*DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath); ok { 7020 presentSelectors[int(asFinal.selector)] = true 7021 } 7022 } 7023 for _, flag := range presentSelectors { 7024 if !flag { 7025 return false 7026 } 7027 } 7028 return true 7029 } 7030 7031 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) ProtoReflect() preflect.Message { 7032 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 7033 return ParseDeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath(raw) 7034 }) 7035 } 7036 7037 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) ProtoMessage() {} 7038 7039 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Reset() { 7040 if fieldMask != nil { 7041 fieldMask.Paths = nil 7042 } 7043 } 7044 7045 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask { 7046 result := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 7047 removedSelectors := make([]bool, 6) 7048 7049 for _, path := range other.GetPaths() { 7050 switch tp := path.(type) { 7051 case *DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath: 7052 removedSelectors[int(tp.selector)] = true 7053 } 7054 } 7055 for _, path := range fieldMask.GetPaths() { 7056 if !removedSelectors[int(path.Selector())] { 7057 result.Paths = append(result.Paths, path) 7058 } 7059 } 7060 7061 if len(result.Paths) == 0 { 7062 return nil 7063 } 7064 return result 7065 } 7066 7067 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 7068 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask)) 7069 } 7070 7071 // FilterInputFields generates copy of field paths with output_only field paths removed 7072 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask { 7073 result := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask{} 7074 result.Paths = append(result.Paths, fieldMask.Paths...) 7075 return result 7076 } 7077 7078 // ToFieldMask is used for proto conversions 7079 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 7080 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7081 for _, path := range fieldMask.Paths { 7082 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 7083 } 7084 return protoFieldMask 7085 } 7086 7087 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 7088 if fieldMask == nil { 7089 return status.Error(codes.Internal, "target field mask is nil") 7090 } 7091 fieldMask.Paths = make([]DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath, 0, len(protoFieldMask.Paths)) 7092 for _, strPath := range protoFieldMask.Paths { 7093 path, err := ParseDeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath(strPath) 7094 if err != nil { 7095 return err 7096 } 7097 fieldMask.Paths = append(fieldMask.Paths, path) 7098 } 7099 return nil 7100 } 7101 7102 // implement methods required by customType 7103 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Marshal() ([]byte, error) { 7104 protoFieldMask := fieldMask.ToProtoFieldMask() 7105 return proto.Marshal(protoFieldMask) 7106 } 7107 7108 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Unmarshal(data []byte) error { 7109 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7110 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 7111 return err 7112 } 7113 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7114 return err 7115 } 7116 return nil 7117 } 7118 7119 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Size() int { 7120 return proto.Size(fieldMask.ToProtoFieldMask()) 7121 } 7122 7123 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) MarshalJSON() ([]byte, error) { 7124 return json.Marshal(fieldMask.ToProtoFieldMask()) 7125 } 7126 7127 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) UnmarshalJSON(data []byte) error { 7128 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7129 if err := json.Unmarshal(data, protoFieldMask); err != nil { 7130 return err 7131 } 7132 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7133 return err 7134 } 7135 return nil 7136 } 7137 7138 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) AppendPath(path DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath) { 7139 fieldMask.Paths = append(fieldMask.Paths, path) 7140 } 7141 7142 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 7143 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath)) 7144 } 7145 7146 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) GetPaths() []DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath { 7147 if fieldMask == nil { 7148 return nil 7149 } 7150 return fieldMask.Paths 7151 } 7152 7153 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) GetRawPaths() []gotenobject.FieldPath { 7154 if fieldMask == nil { 7155 return nil 7156 } 7157 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 7158 for _, path := range fieldMask.Paths { 7159 rawPaths = append(rawPaths, path) 7160 } 7161 return rawPaths 7162 } 7163 7164 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) SetFromCliFlag(raw string) error { 7165 path, err := ParseDeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPath(raw) 7166 if err != nil { 7167 return err 7168 } 7169 fieldMask.Paths = append(fieldMask.Paths, path) 7170 return nil 7171 } 7172 7173 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy) { 7174 for _, path := range fieldMask.Paths { 7175 val, _ := path.GetSingle(source) 7176 // if val is nil, then field does not exist in source, skip 7177 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 7178 if val != nil { 7179 path.WithIValue(val).SetTo(&target) 7180 } 7181 } 7182 } 7183 7184 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 7185 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy), source.(*Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy)) 7186 } 7187 7188 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) Project(source *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy) *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy { 7189 if source == nil { 7190 return nil 7191 } 7192 if fieldMask == nil { 7193 return source 7194 } 7195 result := &Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy{} 7196 7197 for _, p := range fieldMask.Paths { 7198 switch tp := p.(type) { 7199 case *DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldTerminalPath: 7200 switch tp.selector { 7201 case DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorFrom: 7202 result.From = source.From 7203 case DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorTo: 7204 result.To = source.To 7205 case DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorTable: 7206 result.Table = source.Table 7207 case DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorPriority: 7208 result.Priority = source.Priority 7209 case DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorMark: 7210 result.Mark = source.Mark 7211 case DeviceSpecNetworkingConfigCommonOptsRoutingPolicy_FieldPathSelectorTypeOfService: 7212 result.TypeOfService = source.TypeOfService 7213 } 7214 } 7215 } 7216 return result 7217 } 7218 7219 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 7220 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy)) 7221 } 7222 7223 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_RoutingPolicy_FieldMask) PathsCount() int { 7224 if fieldMask == nil { 7225 return 0 7226 } 7227 return len(fieldMask.Paths) 7228 } 7229 7230 type Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask struct { 7231 Paths []DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath 7232 } 7233 7234 func FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask { 7235 res := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 7236 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorKeyManagement}) 7237 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorPassword}) 7238 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorMethod}) 7239 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorIdentity}) 7240 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorAnonymousIdentity}) 7241 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorCaCertificate}) 7242 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorClientCertificate}) 7243 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorClientKey}) 7244 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorClientKeyPassword}) 7245 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath{selector: DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorPhase2Auth}) 7246 return res 7247 } 7248 7249 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) String() string { 7250 if fieldMask == nil { 7251 return "<nil>" 7252 } 7253 pathsStr := make([]string, 0, len(fieldMask.Paths)) 7254 for _, path := range fieldMask.Paths { 7255 pathsStr = append(pathsStr, path.String()) 7256 } 7257 return strings.Join(pathsStr, ", ") 7258 } 7259 7260 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) IsFull() bool { 7261 if fieldMask == nil { 7262 return false 7263 } 7264 presentSelectors := make([]bool, 10) 7265 for _, path := range fieldMask.Paths { 7266 if asFinal, ok := path.(*DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath); ok { 7267 presentSelectors[int(asFinal.selector)] = true 7268 } 7269 } 7270 for _, flag := range presentSelectors { 7271 if !flag { 7272 return false 7273 } 7274 } 7275 return true 7276 } 7277 7278 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) ProtoReflect() preflect.Message { 7279 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 7280 return ParseDeviceSpecNetworkingConfigCommonOptsAuth_FieldPath(raw) 7281 }) 7282 } 7283 7284 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) ProtoMessage() {} 7285 7286 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Reset() { 7287 if fieldMask != nil { 7288 fieldMask.Paths = nil 7289 } 7290 } 7291 7292 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask { 7293 result := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 7294 removedSelectors := make([]bool, 10) 7295 7296 for _, path := range other.GetPaths() { 7297 switch tp := path.(type) { 7298 case *DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath: 7299 removedSelectors[int(tp.selector)] = true 7300 } 7301 } 7302 for _, path := range fieldMask.GetPaths() { 7303 if !removedSelectors[int(path.Selector())] { 7304 result.Paths = append(result.Paths, path) 7305 } 7306 } 7307 7308 if len(result.Paths) == 0 { 7309 return nil 7310 } 7311 return result 7312 } 7313 7314 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 7315 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask)) 7316 } 7317 7318 // FilterInputFields generates copy of field paths with output_only field paths removed 7319 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask { 7320 result := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 7321 result.Paths = append(result.Paths, fieldMask.Paths...) 7322 return result 7323 } 7324 7325 // ToFieldMask is used for proto conversions 7326 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 7327 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7328 for _, path := range fieldMask.Paths { 7329 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 7330 } 7331 return protoFieldMask 7332 } 7333 7334 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 7335 if fieldMask == nil { 7336 return status.Error(codes.Internal, "target field mask is nil") 7337 } 7338 fieldMask.Paths = make([]DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath, 0, len(protoFieldMask.Paths)) 7339 for _, strPath := range protoFieldMask.Paths { 7340 path, err := ParseDeviceSpecNetworkingConfigCommonOptsAuth_FieldPath(strPath) 7341 if err != nil { 7342 return err 7343 } 7344 fieldMask.Paths = append(fieldMask.Paths, path) 7345 } 7346 return nil 7347 } 7348 7349 // implement methods required by customType 7350 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Marshal() ([]byte, error) { 7351 protoFieldMask := fieldMask.ToProtoFieldMask() 7352 return proto.Marshal(protoFieldMask) 7353 } 7354 7355 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Unmarshal(data []byte) error { 7356 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7357 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 7358 return err 7359 } 7360 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7361 return err 7362 } 7363 return nil 7364 } 7365 7366 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Size() int { 7367 return proto.Size(fieldMask.ToProtoFieldMask()) 7368 } 7369 7370 func (fieldMask Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) MarshalJSON() ([]byte, error) { 7371 return json.Marshal(fieldMask.ToProtoFieldMask()) 7372 } 7373 7374 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) UnmarshalJSON(data []byte) error { 7375 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7376 if err := json.Unmarshal(data, protoFieldMask); err != nil { 7377 return err 7378 } 7379 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7380 return err 7381 } 7382 return nil 7383 } 7384 7385 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) AppendPath(path DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath) { 7386 fieldMask.Paths = append(fieldMask.Paths, path) 7387 } 7388 7389 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 7390 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 7391 } 7392 7393 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) GetPaths() []DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath { 7394 if fieldMask == nil { 7395 return nil 7396 } 7397 return fieldMask.Paths 7398 } 7399 7400 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) GetRawPaths() []gotenobject.FieldPath { 7401 if fieldMask == nil { 7402 return nil 7403 } 7404 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 7405 for _, path := range fieldMask.Paths { 7406 rawPaths = append(rawPaths, path) 7407 } 7408 return rawPaths 7409 } 7410 7411 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) SetFromCliFlag(raw string) error { 7412 path, err := ParseDeviceSpecNetworkingConfigCommonOptsAuth_FieldPath(raw) 7413 if err != nil { 7414 return err 7415 } 7416 fieldMask.Paths = append(fieldMask.Paths, path) 7417 return nil 7418 } 7419 7420 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_CommonOpts_Auth) { 7421 for _, path := range fieldMask.Paths { 7422 val, _ := path.GetSingle(source) 7423 // if val is nil, then field does not exist in source, skip 7424 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 7425 if val != nil { 7426 path.WithIValue(val).SetTo(&target) 7427 } 7428 } 7429 } 7430 7431 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 7432 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_CommonOpts_Auth), source.(*Device_Spec_NetworkingConfig_CommonOpts_Auth)) 7433 } 7434 7435 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) Project(source *Device_Spec_NetworkingConfig_CommonOpts_Auth) *Device_Spec_NetworkingConfig_CommonOpts_Auth { 7436 if source == nil { 7437 return nil 7438 } 7439 if fieldMask == nil { 7440 return source 7441 } 7442 result := &Device_Spec_NetworkingConfig_CommonOpts_Auth{} 7443 7444 for _, p := range fieldMask.Paths { 7445 switch tp := p.(type) { 7446 case *DeviceSpecNetworkingConfigCommonOptsAuth_FieldTerminalPath: 7447 switch tp.selector { 7448 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorKeyManagement: 7449 result.KeyManagement = source.KeyManagement 7450 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorPassword: 7451 result.Password = source.Password 7452 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorMethod: 7453 result.Method = source.Method 7454 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorIdentity: 7455 result.Identity = source.Identity 7456 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorAnonymousIdentity: 7457 result.AnonymousIdentity = source.AnonymousIdentity 7458 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorCaCertificate: 7459 result.CaCertificate = source.CaCertificate 7460 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorClientCertificate: 7461 result.ClientCertificate = source.ClientCertificate 7462 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorClientKey: 7463 result.ClientKey = source.ClientKey 7464 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorClientKeyPassword: 7465 result.ClientKeyPassword = source.ClientKeyPassword 7466 case DeviceSpecNetworkingConfigCommonOptsAuth_FieldPathSelectorPhase2Auth: 7467 result.Phase2Auth = source.Phase2Auth 7468 } 7469 } 7470 } 7471 return result 7472 } 7473 7474 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 7475 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_CommonOpts_Auth)) 7476 } 7477 7478 func (fieldMask *Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask) PathsCount() int { 7479 if fieldMask == nil { 7480 return 0 7481 } 7482 return len(fieldMask.Paths) 7483 } 7484 7485 type Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask struct { 7486 Paths []DeviceSpecNetworkingConfigEthOptsMatch_FieldPath 7487 } 7488 7489 func FullDevice_Spec_NetworkingConfig_EthOpts_Match_FieldMask() *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask { 7490 res := &Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask{} 7491 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOptsMatch_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOptsMatch_FieldPathSelectorName}) 7492 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOptsMatch_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOptsMatch_FieldPathSelectorMacaddress}) 7493 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigEthOptsMatch_FieldTerminalPath{selector: DeviceSpecNetworkingConfigEthOptsMatch_FieldPathSelectorDriver}) 7494 return res 7495 } 7496 7497 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) String() string { 7498 if fieldMask == nil { 7499 return "<nil>" 7500 } 7501 pathsStr := make([]string, 0, len(fieldMask.Paths)) 7502 for _, path := range fieldMask.Paths { 7503 pathsStr = append(pathsStr, path.String()) 7504 } 7505 return strings.Join(pathsStr, ", ") 7506 } 7507 7508 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) IsFull() bool { 7509 if fieldMask == nil { 7510 return false 7511 } 7512 presentSelectors := make([]bool, 3) 7513 for _, path := range fieldMask.Paths { 7514 if asFinal, ok := path.(*DeviceSpecNetworkingConfigEthOptsMatch_FieldTerminalPath); ok { 7515 presentSelectors[int(asFinal.selector)] = true 7516 } 7517 } 7518 for _, flag := range presentSelectors { 7519 if !flag { 7520 return false 7521 } 7522 } 7523 return true 7524 } 7525 7526 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) ProtoReflect() preflect.Message { 7527 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 7528 return ParseDeviceSpecNetworkingConfigEthOptsMatch_FieldPath(raw) 7529 }) 7530 } 7531 7532 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) ProtoMessage() {} 7533 7534 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Reset() { 7535 if fieldMask != nil { 7536 fieldMask.Paths = nil 7537 } 7538 } 7539 7540 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask { 7541 result := &Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask{} 7542 removedSelectors := make([]bool, 3) 7543 7544 for _, path := range other.GetPaths() { 7545 switch tp := path.(type) { 7546 case *DeviceSpecNetworkingConfigEthOptsMatch_FieldTerminalPath: 7547 removedSelectors[int(tp.selector)] = true 7548 } 7549 } 7550 for _, path := range fieldMask.GetPaths() { 7551 if !removedSelectors[int(path.Selector())] { 7552 result.Paths = append(result.Paths, path) 7553 } 7554 } 7555 7556 if len(result.Paths) == 0 { 7557 return nil 7558 } 7559 return result 7560 } 7561 7562 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 7563 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask)) 7564 } 7565 7566 // FilterInputFields generates copy of field paths with output_only field paths removed 7567 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask { 7568 result := &Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask{} 7569 result.Paths = append(result.Paths, fieldMask.Paths...) 7570 return result 7571 } 7572 7573 // ToFieldMask is used for proto conversions 7574 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 7575 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7576 for _, path := range fieldMask.Paths { 7577 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 7578 } 7579 return protoFieldMask 7580 } 7581 7582 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 7583 if fieldMask == nil { 7584 return status.Error(codes.Internal, "target field mask is nil") 7585 } 7586 fieldMask.Paths = make([]DeviceSpecNetworkingConfigEthOptsMatch_FieldPath, 0, len(protoFieldMask.Paths)) 7587 for _, strPath := range protoFieldMask.Paths { 7588 path, err := ParseDeviceSpecNetworkingConfigEthOptsMatch_FieldPath(strPath) 7589 if err != nil { 7590 return err 7591 } 7592 fieldMask.Paths = append(fieldMask.Paths, path) 7593 } 7594 return nil 7595 } 7596 7597 // implement methods required by customType 7598 func (fieldMask Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Marshal() ([]byte, error) { 7599 protoFieldMask := fieldMask.ToProtoFieldMask() 7600 return proto.Marshal(protoFieldMask) 7601 } 7602 7603 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Unmarshal(data []byte) error { 7604 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7605 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 7606 return err 7607 } 7608 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7609 return err 7610 } 7611 return nil 7612 } 7613 7614 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Size() int { 7615 return proto.Size(fieldMask.ToProtoFieldMask()) 7616 } 7617 7618 func (fieldMask Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) MarshalJSON() ([]byte, error) { 7619 return json.Marshal(fieldMask.ToProtoFieldMask()) 7620 } 7621 7622 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) UnmarshalJSON(data []byte) error { 7623 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7624 if err := json.Unmarshal(data, protoFieldMask); err != nil { 7625 return err 7626 } 7627 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7628 return err 7629 } 7630 return nil 7631 } 7632 7633 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) AppendPath(path DeviceSpecNetworkingConfigEthOptsMatch_FieldPath) { 7634 fieldMask.Paths = append(fieldMask.Paths, path) 7635 } 7636 7637 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 7638 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigEthOptsMatch_FieldPath)) 7639 } 7640 7641 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) GetPaths() []DeviceSpecNetworkingConfigEthOptsMatch_FieldPath { 7642 if fieldMask == nil { 7643 return nil 7644 } 7645 return fieldMask.Paths 7646 } 7647 7648 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) GetRawPaths() []gotenobject.FieldPath { 7649 if fieldMask == nil { 7650 return nil 7651 } 7652 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 7653 for _, path := range fieldMask.Paths { 7654 rawPaths = append(rawPaths, path) 7655 } 7656 return rawPaths 7657 } 7658 7659 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) SetFromCliFlag(raw string) error { 7660 path, err := ParseDeviceSpecNetworkingConfigEthOptsMatch_FieldPath(raw) 7661 if err != nil { 7662 return err 7663 } 7664 fieldMask.Paths = append(fieldMask.Paths, path) 7665 return nil 7666 } 7667 7668 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_EthOpts_Match) { 7669 for _, path := range fieldMask.Paths { 7670 val, _ := path.GetSingle(source) 7671 // if val is nil, then field does not exist in source, skip 7672 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 7673 if val != nil { 7674 path.WithIValue(val).SetTo(&target) 7675 } 7676 } 7677 } 7678 7679 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 7680 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_EthOpts_Match), source.(*Device_Spec_NetworkingConfig_EthOpts_Match)) 7681 } 7682 7683 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) Project(source *Device_Spec_NetworkingConfig_EthOpts_Match) *Device_Spec_NetworkingConfig_EthOpts_Match { 7684 if source == nil { 7685 return nil 7686 } 7687 if fieldMask == nil { 7688 return source 7689 } 7690 result := &Device_Spec_NetworkingConfig_EthOpts_Match{} 7691 7692 for _, p := range fieldMask.Paths { 7693 switch tp := p.(type) { 7694 case *DeviceSpecNetworkingConfigEthOptsMatch_FieldTerminalPath: 7695 switch tp.selector { 7696 case DeviceSpecNetworkingConfigEthOptsMatch_FieldPathSelectorName: 7697 result.Name = source.Name 7698 case DeviceSpecNetworkingConfigEthOptsMatch_FieldPathSelectorMacaddress: 7699 result.Macaddress = source.Macaddress 7700 case DeviceSpecNetworkingConfigEthOptsMatch_FieldPathSelectorDriver: 7701 result.Driver = source.Driver 7702 } 7703 } 7704 } 7705 return result 7706 } 7707 7708 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 7709 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_EthOpts_Match)) 7710 } 7711 7712 func (fieldMask *Device_Spec_NetworkingConfig_EthOpts_Match_FieldMask) PathsCount() int { 7713 if fieldMask == nil { 7714 return 0 7715 } 7716 return len(fieldMask.Paths) 7717 } 7718 7719 type Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask struct { 7720 Paths []DeviceSpecNetworkingConfigWifiOptsMatch_FieldPath 7721 } 7722 7723 func FullDevice_Spec_NetworkingConfig_WifiOpts_Match_FieldMask() *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask { 7724 res := &Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask{} 7725 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsMatch_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsMatch_FieldPathSelectorName}) 7726 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsMatch_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsMatch_FieldPathSelectorMacaddress}) 7727 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsMatch_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsMatch_FieldPathSelectorDriver}) 7728 return res 7729 } 7730 7731 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) String() string { 7732 if fieldMask == nil { 7733 return "<nil>" 7734 } 7735 pathsStr := make([]string, 0, len(fieldMask.Paths)) 7736 for _, path := range fieldMask.Paths { 7737 pathsStr = append(pathsStr, path.String()) 7738 } 7739 return strings.Join(pathsStr, ", ") 7740 } 7741 7742 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) IsFull() bool { 7743 if fieldMask == nil { 7744 return false 7745 } 7746 presentSelectors := make([]bool, 3) 7747 for _, path := range fieldMask.Paths { 7748 if asFinal, ok := path.(*DeviceSpecNetworkingConfigWifiOptsMatch_FieldTerminalPath); ok { 7749 presentSelectors[int(asFinal.selector)] = true 7750 } 7751 } 7752 for _, flag := range presentSelectors { 7753 if !flag { 7754 return false 7755 } 7756 } 7757 return true 7758 } 7759 7760 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) ProtoReflect() preflect.Message { 7761 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 7762 return ParseDeviceSpecNetworkingConfigWifiOptsMatch_FieldPath(raw) 7763 }) 7764 } 7765 7766 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) ProtoMessage() {} 7767 7768 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Reset() { 7769 if fieldMask != nil { 7770 fieldMask.Paths = nil 7771 } 7772 } 7773 7774 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask { 7775 result := &Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask{} 7776 removedSelectors := make([]bool, 3) 7777 7778 for _, path := range other.GetPaths() { 7779 switch tp := path.(type) { 7780 case *DeviceSpecNetworkingConfigWifiOptsMatch_FieldTerminalPath: 7781 removedSelectors[int(tp.selector)] = true 7782 } 7783 } 7784 for _, path := range fieldMask.GetPaths() { 7785 if !removedSelectors[int(path.Selector())] { 7786 result.Paths = append(result.Paths, path) 7787 } 7788 } 7789 7790 if len(result.Paths) == 0 { 7791 return nil 7792 } 7793 return result 7794 } 7795 7796 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 7797 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask)) 7798 } 7799 7800 // FilterInputFields generates copy of field paths with output_only field paths removed 7801 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask { 7802 result := &Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask{} 7803 result.Paths = append(result.Paths, fieldMask.Paths...) 7804 return result 7805 } 7806 7807 // ToFieldMask is used for proto conversions 7808 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 7809 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7810 for _, path := range fieldMask.Paths { 7811 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 7812 } 7813 return protoFieldMask 7814 } 7815 7816 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 7817 if fieldMask == nil { 7818 return status.Error(codes.Internal, "target field mask is nil") 7819 } 7820 fieldMask.Paths = make([]DeviceSpecNetworkingConfigWifiOptsMatch_FieldPath, 0, len(protoFieldMask.Paths)) 7821 for _, strPath := range protoFieldMask.Paths { 7822 path, err := ParseDeviceSpecNetworkingConfigWifiOptsMatch_FieldPath(strPath) 7823 if err != nil { 7824 return err 7825 } 7826 fieldMask.Paths = append(fieldMask.Paths, path) 7827 } 7828 return nil 7829 } 7830 7831 // implement methods required by customType 7832 func (fieldMask Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Marshal() ([]byte, error) { 7833 protoFieldMask := fieldMask.ToProtoFieldMask() 7834 return proto.Marshal(protoFieldMask) 7835 } 7836 7837 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Unmarshal(data []byte) error { 7838 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7839 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 7840 return err 7841 } 7842 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7843 return err 7844 } 7845 return nil 7846 } 7847 7848 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Size() int { 7849 return proto.Size(fieldMask.ToProtoFieldMask()) 7850 } 7851 7852 func (fieldMask Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) MarshalJSON() ([]byte, error) { 7853 return json.Marshal(fieldMask.ToProtoFieldMask()) 7854 } 7855 7856 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) UnmarshalJSON(data []byte) error { 7857 protoFieldMask := &googlefieldmaskpb.FieldMask{} 7858 if err := json.Unmarshal(data, protoFieldMask); err != nil { 7859 return err 7860 } 7861 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 7862 return err 7863 } 7864 return nil 7865 } 7866 7867 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) AppendPath(path DeviceSpecNetworkingConfigWifiOptsMatch_FieldPath) { 7868 fieldMask.Paths = append(fieldMask.Paths, path) 7869 } 7870 7871 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 7872 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigWifiOptsMatch_FieldPath)) 7873 } 7874 7875 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) GetPaths() []DeviceSpecNetworkingConfigWifiOptsMatch_FieldPath { 7876 if fieldMask == nil { 7877 return nil 7878 } 7879 return fieldMask.Paths 7880 } 7881 7882 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) GetRawPaths() []gotenobject.FieldPath { 7883 if fieldMask == nil { 7884 return nil 7885 } 7886 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 7887 for _, path := range fieldMask.Paths { 7888 rawPaths = append(rawPaths, path) 7889 } 7890 return rawPaths 7891 } 7892 7893 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) SetFromCliFlag(raw string) error { 7894 path, err := ParseDeviceSpecNetworkingConfigWifiOptsMatch_FieldPath(raw) 7895 if err != nil { 7896 return err 7897 } 7898 fieldMask.Paths = append(fieldMask.Paths, path) 7899 return nil 7900 } 7901 7902 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_WifiOpts_Match) { 7903 for _, path := range fieldMask.Paths { 7904 val, _ := path.GetSingle(source) 7905 // if val is nil, then field does not exist in source, skip 7906 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 7907 if val != nil { 7908 path.WithIValue(val).SetTo(&target) 7909 } 7910 } 7911 } 7912 7913 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 7914 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_WifiOpts_Match), source.(*Device_Spec_NetworkingConfig_WifiOpts_Match)) 7915 } 7916 7917 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) Project(source *Device_Spec_NetworkingConfig_WifiOpts_Match) *Device_Spec_NetworkingConfig_WifiOpts_Match { 7918 if source == nil { 7919 return nil 7920 } 7921 if fieldMask == nil { 7922 return source 7923 } 7924 result := &Device_Spec_NetworkingConfig_WifiOpts_Match{} 7925 7926 for _, p := range fieldMask.Paths { 7927 switch tp := p.(type) { 7928 case *DeviceSpecNetworkingConfigWifiOptsMatch_FieldTerminalPath: 7929 switch tp.selector { 7930 case DeviceSpecNetworkingConfigWifiOptsMatch_FieldPathSelectorName: 7931 result.Name = source.Name 7932 case DeviceSpecNetworkingConfigWifiOptsMatch_FieldPathSelectorMacaddress: 7933 result.Macaddress = source.Macaddress 7934 case DeviceSpecNetworkingConfigWifiOptsMatch_FieldPathSelectorDriver: 7935 result.Driver = source.Driver 7936 } 7937 } 7938 } 7939 return result 7940 } 7941 7942 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 7943 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_WifiOpts_Match)) 7944 } 7945 7946 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_Match_FieldMask) PathsCount() int { 7947 if fieldMask == nil { 7948 return 0 7949 } 7950 return len(fieldMask.Paths) 7951 } 7952 7953 type Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask struct { 7954 Paths []DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath 7955 } 7956 7957 func FullDevice_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask() *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask { 7958 res := &Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask{} 7959 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorPassword}) 7960 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorMode}) 7961 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorBssid}) 7962 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorBand}) 7963 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorChannel}) 7964 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorHidden}) 7965 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath{selector: DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth}) 7966 return res 7967 } 7968 7969 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) String() string { 7970 if fieldMask == nil { 7971 return "<nil>" 7972 } 7973 pathsStr := make([]string, 0, len(fieldMask.Paths)) 7974 for _, path := range fieldMask.Paths { 7975 pathsStr = append(pathsStr, path.String()) 7976 } 7977 return strings.Join(pathsStr, ", ") 7978 } 7979 7980 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) IsFull() bool { 7981 if fieldMask == nil { 7982 return false 7983 } 7984 presentSelectors := make([]bool, 7) 7985 for _, path := range fieldMask.Paths { 7986 if asFinal, ok := path.(*DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath); ok { 7987 presentSelectors[int(asFinal.selector)] = true 7988 } 7989 } 7990 for _, flag := range presentSelectors { 7991 if !flag { 7992 return false 7993 } 7994 } 7995 return true 7996 } 7997 7998 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) ProtoReflect() preflect.Message { 7999 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 8000 return ParseDeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath(raw) 8001 }) 8002 } 8003 8004 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) ProtoMessage() {} 8005 8006 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Reset() { 8007 if fieldMask != nil { 8008 fieldMask.Paths = nil 8009 } 8010 } 8011 8012 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask { 8013 result := &Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask{} 8014 removedSelectors := make([]bool, 7) 8015 otherSubMasks := map[DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelector]gotenobject.FieldMask{ 8016 DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 8017 } 8018 mySubMasks := map[DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelector]gotenobject.FieldMask{ 8019 DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth: &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{}, 8020 } 8021 8022 for _, path := range other.GetPaths() { 8023 switch tp := path.(type) { 8024 case *DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath: 8025 removedSelectors[int(tp.selector)] = true 8026 case *DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldSubPath: 8027 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 8028 } 8029 } 8030 for _, path := range fieldMask.GetPaths() { 8031 if !removedSelectors[int(path.Selector())] { 8032 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 8033 if tp, ok := path.(*DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath); ok { 8034 switch tp.selector { 8035 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth: 8036 mySubMasks[DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth] = FullDevice_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask() 8037 } 8038 } else if tp, ok := path.(*DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldSubPath); ok { 8039 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 8040 } 8041 } else { 8042 result.Paths = append(result.Paths, path) 8043 } 8044 } 8045 } 8046 for selector, mySubMask := range mySubMasks { 8047 if mySubMask.PathsCount() > 0 { 8048 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 8049 result.Paths = append(result.Paths, &DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldSubPath{selector: selector, subPath: allowedPath}) 8050 } 8051 } 8052 } 8053 8054 if len(result.Paths) == 0 { 8055 return nil 8056 } 8057 return result 8058 } 8059 8060 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 8061 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask)) 8062 } 8063 8064 // FilterInputFields generates copy of field paths with output_only field paths removed 8065 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask { 8066 result := &Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask{} 8067 result.Paths = append(result.Paths, fieldMask.Paths...) 8068 return result 8069 } 8070 8071 // ToFieldMask is used for proto conversions 8072 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 8073 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8074 for _, path := range fieldMask.Paths { 8075 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 8076 } 8077 return protoFieldMask 8078 } 8079 8080 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 8081 if fieldMask == nil { 8082 return status.Error(codes.Internal, "target field mask is nil") 8083 } 8084 fieldMask.Paths = make([]DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath, 0, len(protoFieldMask.Paths)) 8085 for _, strPath := range protoFieldMask.Paths { 8086 path, err := ParseDeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath(strPath) 8087 if err != nil { 8088 return err 8089 } 8090 fieldMask.Paths = append(fieldMask.Paths, path) 8091 } 8092 return nil 8093 } 8094 8095 // implement methods required by customType 8096 func (fieldMask Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Marshal() ([]byte, error) { 8097 protoFieldMask := fieldMask.ToProtoFieldMask() 8098 return proto.Marshal(protoFieldMask) 8099 } 8100 8101 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Unmarshal(data []byte) error { 8102 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8103 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 8104 return err 8105 } 8106 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8107 return err 8108 } 8109 return nil 8110 } 8111 8112 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Size() int { 8113 return proto.Size(fieldMask.ToProtoFieldMask()) 8114 } 8115 8116 func (fieldMask Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) MarshalJSON() ([]byte, error) { 8117 return json.Marshal(fieldMask.ToProtoFieldMask()) 8118 } 8119 8120 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) UnmarshalJSON(data []byte) error { 8121 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8122 if err := json.Unmarshal(data, protoFieldMask); err != nil { 8123 return err 8124 } 8125 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8126 return err 8127 } 8128 return nil 8129 } 8130 8131 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) AppendPath(path DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath) { 8132 fieldMask.Paths = append(fieldMask.Paths, path) 8133 } 8134 8135 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 8136 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath)) 8137 } 8138 8139 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) GetPaths() []DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath { 8140 if fieldMask == nil { 8141 return nil 8142 } 8143 return fieldMask.Paths 8144 } 8145 8146 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) GetRawPaths() []gotenobject.FieldPath { 8147 if fieldMask == nil { 8148 return nil 8149 } 8150 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 8151 for _, path := range fieldMask.Paths { 8152 rawPaths = append(rawPaths, path) 8153 } 8154 return rawPaths 8155 } 8156 8157 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) SetFromCliFlag(raw string) error { 8158 path, err := ParseDeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPath(raw) 8159 if err != nil { 8160 return err 8161 } 8162 fieldMask.Paths = append(fieldMask.Paths, path) 8163 return nil 8164 } 8165 8166 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint) { 8167 for _, path := range fieldMask.Paths { 8168 val, _ := path.GetSingle(source) 8169 // if val is nil, then field does not exist in source, skip 8170 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 8171 if val != nil { 8172 path.WithIValue(val).SetTo(&target) 8173 } 8174 } 8175 } 8176 8177 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 8178 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_WifiOpts_AccessPoint), source.(*Device_Spec_NetworkingConfig_WifiOpts_AccessPoint)) 8179 } 8180 8181 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) Project(source *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint) *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint { 8182 if source == nil { 8183 return nil 8184 } 8185 if fieldMask == nil { 8186 return source 8187 } 8188 result := &Device_Spec_NetworkingConfig_WifiOpts_AccessPoint{} 8189 authMask := &Device_Spec_NetworkingConfig_CommonOpts_Auth_FieldMask{} 8190 wholeAuthAccepted := false 8191 8192 for _, p := range fieldMask.Paths { 8193 switch tp := p.(type) { 8194 case *DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldTerminalPath: 8195 switch tp.selector { 8196 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorPassword: 8197 result.Password = source.Password 8198 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorMode: 8199 result.Mode = source.Mode 8200 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorBssid: 8201 result.Bssid = source.Bssid 8202 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorBand: 8203 result.Band = source.Band 8204 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorChannel: 8205 result.Channel = source.Channel 8206 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorHidden: 8207 result.Hidden = source.Hidden 8208 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth: 8209 result.Auth = source.Auth 8210 wholeAuthAccepted = true 8211 } 8212 case *DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldSubPath: 8213 switch tp.selector { 8214 case DeviceSpecNetworkingConfigWifiOptsAccessPoint_FieldPathSelectorAuth: 8215 authMask.AppendPath(tp.subPath.(DeviceSpecNetworkingConfigCommonOptsAuth_FieldPath)) 8216 } 8217 } 8218 } 8219 if wholeAuthAccepted == false && len(authMask.Paths) > 0 { 8220 result.Auth = authMask.Project(source.GetAuth()) 8221 } 8222 return result 8223 } 8224 8225 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 8226 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_WifiOpts_AccessPoint)) 8227 } 8228 8229 func (fieldMask *Device_Spec_NetworkingConfig_WifiOpts_AccessPoint_FieldMask) PathsCount() int { 8230 if fieldMask == nil { 8231 return 0 8232 } 8233 return len(fieldMask.Paths) 8234 } 8235 8236 type Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask struct { 8237 Paths []DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath 8238 } 8239 8240 func FullDevice_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask() *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask { 8241 res := &Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask{} 8242 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorAgeingTime}) 8243 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorPriority}) 8244 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorPortPriority}) 8245 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorForwardDelay}) 8246 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorHelloTime}) 8247 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorMaxAge}) 8248 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorPathCost}) 8249 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorStp}) 8250 return res 8251 } 8252 8253 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) String() string { 8254 if fieldMask == nil { 8255 return "<nil>" 8256 } 8257 pathsStr := make([]string, 0, len(fieldMask.Paths)) 8258 for _, path := range fieldMask.Paths { 8259 pathsStr = append(pathsStr, path.String()) 8260 } 8261 return strings.Join(pathsStr, ", ") 8262 } 8263 8264 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) IsFull() bool { 8265 if fieldMask == nil { 8266 return false 8267 } 8268 presentSelectors := make([]bool, 8) 8269 for _, path := range fieldMask.Paths { 8270 if asFinal, ok := path.(*DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath); ok { 8271 presentSelectors[int(asFinal.selector)] = true 8272 } 8273 } 8274 for _, flag := range presentSelectors { 8275 if !flag { 8276 return false 8277 } 8278 } 8279 return true 8280 } 8281 8282 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) ProtoReflect() preflect.Message { 8283 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 8284 return ParseDeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath(raw) 8285 }) 8286 } 8287 8288 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) ProtoMessage() {} 8289 8290 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Reset() { 8291 if fieldMask != nil { 8292 fieldMask.Paths = nil 8293 } 8294 } 8295 8296 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask { 8297 result := &Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask{} 8298 removedSelectors := make([]bool, 8) 8299 8300 for _, path := range other.GetPaths() { 8301 switch tp := path.(type) { 8302 case *DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath: 8303 removedSelectors[int(tp.selector)] = true 8304 } 8305 } 8306 for _, path := range fieldMask.GetPaths() { 8307 if !removedSelectors[int(path.Selector())] { 8308 result.Paths = append(result.Paths, path) 8309 } 8310 } 8311 8312 if len(result.Paths) == 0 { 8313 return nil 8314 } 8315 return result 8316 } 8317 8318 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 8319 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask)) 8320 } 8321 8322 // FilterInputFields generates copy of field paths with output_only field paths removed 8323 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask { 8324 result := &Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask{} 8325 result.Paths = append(result.Paths, fieldMask.Paths...) 8326 return result 8327 } 8328 8329 // ToFieldMask is used for proto conversions 8330 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 8331 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8332 for _, path := range fieldMask.Paths { 8333 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 8334 } 8335 return protoFieldMask 8336 } 8337 8338 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 8339 if fieldMask == nil { 8340 return status.Error(codes.Internal, "target field mask is nil") 8341 } 8342 fieldMask.Paths = make([]DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath, 0, len(protoFieldMask.Paths)) 8343 for _, strPath := range protoFieldMask.Paths { 8344 path, err := ParseDeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath(strPath) 8345 if err != nil { 8346 return err 8347 } 8348 fieldMask.Paths = append(fieldMask.Paths, path) 8349 } 8350 return nil 8351 } 8352 8353 // implement methods required by customType 8354 func (fieldMask Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Marshal() ([]byte, error) { 8355 protoFieldMask := fieldMask.ToProtoFieldMask() 8356 return proto.Marshal(protoFieldMask) 8357 } 8358 8359 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Unmarshal(data []byte) error { 8360 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8361 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 8362 return err 8363 } 8364 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8365 return err 8366 } 8367 return nil 8368 } 8369 8370 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Size() int { 8371 return proto.Size(fieldMask.ToProtoFieldMask()) 8372 } 8373 8374 func (fieldMask Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) MarshalJSON() ([]byte, error) { 8375 return json.Marshal(fieldMask.ToProtoFieldMask()) 8376 } 8377 8378 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) UnmarshalJSON(data []byte) error { 8379 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8380 if err := json.Unmarshal(data, protoFieldMask); err != nil { 8381 return err 8382 } 8383 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8384 return err 8385 } 8386 return nil 8387 } 8388 8389 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) AppendPath(path DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath) { 8390 fieldMask.Paths = append(fieldMask.Paths, path) 8391 } 8392 8393 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 8394 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath)) 8395 } 8396 8397 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) GetPaths() []DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath { 8398 if fieldMask == nil { 8399 return nil 8400 } 8401 return fieldMask.Paths 8402 } 8403 8404 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) GetRawPaths() []gotenobject.FieldPath { 8405 if fieldMask == nil { 8406 return nil 8407 } 8408 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 8409 for _, path := range fieldMask.Paths { 8410 rawPaths = append(rawPaths, path) 8411 } 8412 return rawPaths 8413 } 8414 8415 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) SetFromCliFlag(raw string) error { 8416 path, err := ParseDeviceSpecNetworkingConfigBridgesOptsParameters_FieldPath(raw) 8417 if err != nil { 8418 return err 8419 } 8420 fieldMask.Paths = append(fieldMask.Paths, path) 8421 return nil 8422 } 8423 8424 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_BridgesOpts_Parameters) { 8425 for _, path := range fieldMask.Paths { 8426 val, _ := path.GetSingle(source) 8427 // if val is nil, then field does not exist in source, skip 8428 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 8429 if val != nil { 8430 path.WithIValue(val).SetTo(&target) 8431 } 8432 } 8433 } 8434 8435 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 8436 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_BridgesOpts_Parameters), source.(*Device_Spec_NetworkingConfig_BridgesOpts_Parameters)) 8437 } 8438 8439 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) Project(source *Device_Spec_NetworkingConfig_BridgesOpts_Parameters) *Device_Spec_NetworkingConfig_BridgesOpts_Parameters { 8440 if source == nil { 8441 return nil 8442 } 8443 if fieldMask == nil { 8444 return source 8445 } 8446 result := &Device_Spec_NetworkingConfig_BridgesOpts_Parameters{} 8447 8448 for _, p := range fieldMask.Paths { 8449 switch tp := p.(type) { 8450 case *DeviceSpecNetworkingConfigBridgesOptsParameters_FieldTerminalPath: 8451 switch tp.selector { 8452 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorAgeingTime: 8453 result.AgeingTime = source.AgeingTime 8454 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorPriority: 8455 result.Priority = source.Priority 8456 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorPortPriority: 8457 result.PortPriority = source.PortPriority 8458 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorForwardDelay: 8459 result.ForwardDelay = source.ForwardDelay 8460 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorHelloTime: 8461 result.HelloTime = source.HelloTime 8462 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorMaxAge: 8463 result.MaxAge = source.MaxAge 8464 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorPathCost: 8465 result.PathCost = source.PathCost 8466 case DeviceSpecNetworkingConfigBridgesOptsParameters_FieldPathSelectorStp: 8467 result.Stp = source.Stp 8468 } 8469 } 8470 } 8471 return result 8472 } 8473 8474 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 8475 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_BridgesOpts_Parameters)) 8476 } 8477 8478 func (fieldMask *Device_Spec_NetworkingConfig_BridgesOpts_Parameters_FieldMask) PathsCount() int { 8479 if fieldMask == nil { 8480 return 0 8481 } 8482 return len(fieldMask.Paths) 8483 } 8484 8485 type Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask struct { 8486 Paths []DeviceSpecNetworkingConfigBondsOptsParameters_FieldPath 8487 } 8488 8489 func FullDevice_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask() *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask { 8490 res := &Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask{} 8491 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorMode}) 8492 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorLacpRate}) 8493 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorMiiMonitorInterval}) 8494 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorMinLinks}) 8495 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorTransmitHashPolicy}) 8496 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorAdSelect}) 8497 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorAllSlavesActive}) 8498 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorArpIpTargets}) 8499 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorArpValidate}) 8500 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorArpAllTargets}) 8501 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorUpDelay}) 8502 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorFailOverMacPolicy}) 8503 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorGratuitousArp}) 8504 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorPacketsPerSlave}) 8505 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorPrimaryReselectPolicy}) 8506 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorResendIgmp}) 8507 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorLearnPacketInterval}) 8508 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath{selector: DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorPrimary}) 8509 return res 8510 } 8511 8512 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) String() string { 8513 if fieldMask == nil { 8514 return "<nil>" 8515 } 8516 pathsStr := make([]string, 0, len(fieldMask.Paths)) 8517 for _, path := range fieldMask.Paths { 8518 pathsStr = append(pathsStr, path.String()) 8519 } 8520 return strings.Join(pathsStr, ", ") 8521 } 8522 8523 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) IsFull() bool { 8524 if fieldMask == nil { 8525 return false 8526 } 8527 presentSelectors := make([]bool, 18) 8528 for _, path := range fieldMask.Paths { 8529 if asFinal, ok := path.(*DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath); ok { 8530 presentSelectors[int(asFinal.selector)] = true 8531 } 8532 } 8533 for _, flag := range presentSelectors { 8534 if !flag { 8535 return false 8536 } 8537 } 8538 return true 8539 } 8540 8541 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) ProtoReflect() preflect.Message { 8542 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 8543 return ParseDeviceSpecNetworkingConfigBondsOptsParameters_FieldPath(raw) 8544 }) 8545 } 8546 8547 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) ProtoMessage() {} 8548 8549 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Reset() { 8550 if fieldMask != nil { 8551 fieldMask.Paths = nil 8552 } 8553 } 8554 8555 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask { 8556 result := &Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask{} 8557 removedSelectors := make([]bool, 18) 8558 8559 for _, path := range other.GetPaths() { 8560 switch tp := path.(type) { 8561 case *DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath: 8562 removedSelectors[int(tp.selector)] = true 8563 } 8564 } 8565 for _, path := range fieldMask.GetPaths() { 8566 if !removedSelectors[int(path.Selector())] { 8567 result.Paths = append(result.Paths, path) 8568 } 8569 } 8570 8571 if len(result.Paths) == 0 { 8572 return nil 8573 } 8574 return result 8575 } 8576 8577 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 8578 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask)) 8579 } 8580 8581 // FilterInputFields generates copy of field paths with output_only field paths removed 8582 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask { 8583 result := &Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask{} 8584 result.Paths = append(result.Paths, fieldMask.Paths...) 8585 return result 8586 } 8587 8588 // ToFieldMask is used for proto conversions 8589 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 8590 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8591 for _, path := range fieldMask.Paths { 8592 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 8593 } 8594 return protoFieldMask 8595 } 8596 8597 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 8598 if fieldMask == nil { 8599 return status.Error(codes.Internal, "target field mask is nil") 8600 } 8601 fieldMask.Paths = make([]DeviceSpecNetworkingConfigBondsOptsParameters_FieldPath, 0, len(protoFieldMask.Paths)) 8602 for _, strPath := range protoFieldMask.Paths { 8603 path, err := ParseDeviceSpecNetworkingConfigBondsOptsParameters_FieldPath(strPath) 8604 if err != nil { 8605 return err 8606 } 8607 fieldMask.Paths = append(fieldMask.Paths, path) 8608 } 8609 return nil 8610 } 8611 8612 // implement methods required by customType 8613 func (fieldMask Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Marshal() ([]byte, error) { 8614 protoFieldMask := fieldMask.ToProtoFieldMask() 8615 return proto.Marshal(protoFieldMask) 8616 } 8617 8618 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Unmarshal(data []byte) error { 8619 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8620 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 8621 return err 8622 } 8623 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8624 return err 8625 } 8626 return nil 8627 } 8628 8629 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Size() int { 8630 return proto.Size(fieldMask.ToProtoFieldMask()) 8631 } 8632 8633 func (fieldMask Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) MarshalJSON() ([]byte, error) { 8634 return json.Marshal(fieldMask.ToProtoFieldMask()) 8635 } 8636 8637 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) UnmarshalJSON(data []byte) error { 8638 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8639 if err := json.Unmarshal(data, protoFieldMask); err != nil { 8640 return err 8641 } 8642 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8643 return err 8644 } 8645 return nil 8646 } 8647 8648 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) AppendPath(path DeviceSpecNetworkingConfigBondsOptsParameters_FieldPath) { 8649 fieldMask.Paths = append(fieldMask.Paths, path) 8650 } 8651 8652 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 8653 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigBondsOptsParameters_FieldPath)) 8654 } 8655 8656 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) GetPaths() []DeviceSpecNetworkingConfigBondsOptsParameters_FieldPath { 8657 if fieldMask == nil { 8658 return nil 8659 } 8660 return fieldMask.Paths 8661 } 8662 8663 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) GetRawPaths() []gotenobject.FieldPath { 8664 if fieldMask == nil { 8665 return nil 8666 } 8667 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 8668 for _, path := range fieldMask.Paths { 8669 rawPaths = append(rawPaths, path) 8670 } 8671 return rawPaths 8672 } 8673 8674 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) SetFromCliFlag(raw string) error { 8675 path, err := ParseDeviceSpecNetworkingConfigBondsOptsParameters_FieldPath(raw) 8676 if err != nil { 8677 return err 8678 } 8679 fieldMask.Paths = append(fieldMask.Paths, path) 8680 return nil 8681 } 8682 8683 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_BondsOpts_Parameters) { 8684 for _, path := range fieldMask.Paths { 8685 val, _ := path.GetSingle(source) 8686 // if val is nil, then field does not exist in source, skip 8687 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 8688 if val != nil { 8689 path.WithIValue(val).SetTo(&target) 8690 } 8691 } 8692 } 8693 8694 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 8695 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_BondsOpts_Parameters), source.(*Device_Spec_NetworkingConfig_BondsOpts_Parameters)) 8696 } 8697 8698 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) Project(source *Device_Spec_NetworkingConfig_BondsOpts_Parameters) *Device_Spec_NetworkingConfig_BondsOpts_Parameters { 8699 if source == nil { 8700 return nil 8701 } 8702 if fieldMask == nil { 8703 return source 8704 } 8705 result := &Device_Spec_NetworkingConfig_BondsOpts_Parameters{} 8706 8707 for _, p := range fieldMask.Paths { 8708 switch tp := p.(type) { 8709 case *DeviceSpecNetworkingConfigBondsOptsParameters_FieldTerminalPath: 8710 switch tp.selector { 8711 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorMode: 8712 result.Mode = source.Mode 8713 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorLacpRate: 8714 result.LacpRate = source.LacpRate 8715 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorMiiMonitorInterval: 8716 result.MiiMonitorInterval = source.MiiMonitorInterval 8717 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorMinLinks: 8718 result.MinLinks = source.MinLinks 8719 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorTransmitHashPolicy: 8720 result.TransmitHashPolicy = source.TransmitHashPolicy 8721 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorAdSelect: 8722 result.AdSelect = source.AdSelect 8723 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorAllSlavesActive: 8724 result.AllSlavesActive = source.AllSlavesActive 8725 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorArpIpTargets: 8726 result.ArpIpTargets = source.ArpIpTargets 8727 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorArpValidate: 8728 result.ArpValidate = source.ArpValidate 8729 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorArpAllTargets: 8730 result.ArpAllTargets = source.ArpAllTargets 8731 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorUpDelay: 8732 result.UpDelay = source.UpDelay 8733 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorFailOverMacPolicy: 8734 result.FailOverMacPolicy = source.FailOverMacPolicy 8735 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorGratuitousArp: 8736 result.GratuitousArp = source.GratuitousArp 8737 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorPacketsPerSlave: 8738 result.PacketsPerSlave = source.PacketsPerSlave 8739 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorPrimaryReselectPolicy: 8740 result.PrimaryReselectPolicy = source.PrimaryReselectPolicy 8741 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorResendIgmp: 8742 result.ResendIgmp = source.ResendIgmp 8743 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorLearnPacketInterval: 8744 result.LearnPacketInterval = source.LearnPacketInterval 8745 case DeviceSpecNetworkingConfigBondsOptsParameters_FieldPathSelectorPrimary: 8746 result.Primary = source.Primary 8747 } 8748 } 8749 } 8750 return result 8751 } 8752 8753 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 8754 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_BondsOpts_Parameters)) 8755 } 8756 8757 func (fieldMask *Device_Spec_NetworkingConfig_BondsOpts_Parameters_FieldMask) PathsCount() int { 8758 if fieldMask == nil { 8759 return 0 8760 } 8761 return len(fieldMask.Paths) 8762 } 8763 8764 type Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask struct { 8765 Paths []DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath 8766 } 8767 8768 func FullDevice_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask() *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask { 8769 res := &Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask{} 8770 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOptsKey_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPathSelectorInput}) 8771 res.Paths = append(res.Paths, &DeviceSpecNetworkingConfigTunnelsOptsKey_FieldTerminalPath{selector: DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPathSelectorOutput}) 8772 return res 8773 } 8774 8775 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) String() string { 8776 if fieldMask == nil { 8777 return "<nil>" 8778 } 8779 pathsStr := make([]string, 0, len(fieldMask.Paths)) 8780 for _, path := range fieldMask.Paths { 8781 pathsStr = append(pathsStr, path.String()) 8782 } 8783 return strings.Join(pathsStr, ", ") 8784 } 8785 8786 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) IsFull() bool { 8787 if fieldMask == nil { 8788 return false 8789 } 8790 presentSelectors := make([]bool, 2) 8791 for _, path := range fieldMask.Paths { 8792 if asFinal, ok := path.(*DeviceSpecNetworkingConfigTunnelsOptsKey_FieldTerminalPath); ok { 8793 presentSelectors[int(asFinal.selector)] = true 8794 } 8795 } 8796 for _, flag := range presentSelectors { 8797 if !flag { 8798 return false 8799 } 8800 } 8801 return true 8802 } 8803 8804 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) ProtoReflect() preflect.Message { 8805 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 8806 return ParseDeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath(raw) 8807 }) 8808 } 8809 8810 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) ProtoMessage() {} 8811 8812 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Reset() { 8813 if fieldMask != nil { 8814 fieldMask.Paths = nil 8815 } 8816 } 8817 8818 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Subtract(other *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask { 8819 result := &Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask{} 8820 removedSelectors := make([]bool, 2) 8821 8822 for _, path := range other.GetPaths() { 8823 switch tp := path.(type) { 8824 case *DeviceSpecNetworkingConfigTunnelsOptsKey_FieldTerminalPath: 8825 removedSelectors[int(tp.selector)] = true 8826 } 8827 } 8828 for _, path := range fieldMask.GetPaths() { 8829 if !removedSelectors[int(path.Selector())] { 8830 result.Paths = append(result.Paths, path) 8831 } 8832 } 8833 8834 if len(result.Paths) == 0 { 8835 return nil 8836 } 8837 return result 8838 } 8839 8840 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 8841 return fieldMask.Subtract(other.(*Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask)) 8842 } 8843 8844 // FilterInputFields generates copy of field paths with output_only field paths removed 8845 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) FilterInputFields() *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask { 8846 result := &Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask{} 8847 result.Paths = append(result.Paths, fieldMask.Paths...) 8848 return result 8849 } 8850 8851 // ToFieldMask is used for proto conversions 8852 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 8853 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8854 for _, path := range fieldMask.Paths { 8855 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 8856 } 8857 return protoFieldMask 8858 } 8859 8860 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 8861 if fieldMask == nil { 8862 return status.Error(codes.Internal, "target field mask is nil") 8863 } 8864 fieldMask.Paths = make([]DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath, 0, len(protoFieldMask.Paths)) 8865 for _, strPath := range protoFieldMask.Paths { 8866 path, err := ParseDeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath(strPath) 8867 if err != nil { 8868 return err 8869 } 8870 fieldMask.Paths = append(fieldMask.Paths, path) 8871 } 8872 return nil 8873 } 8874 8875 // implement methods required by customType 8876 func (fieldMask Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Marshal() ([]byte, error) { 8877 protoFieldMask := fieldMask.ToProtoFieldMask() 8878 return proto.Marshal(protoFieldMask) 8879 } 8880 8881 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Unmarshal(data []byte) error { 8882 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8883 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 8884 return err 8885 } 8886 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8887 return err 8888 } 8889 return nil 8890 } 8891 8892 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Size() int { 8893 return proto.Size(fieldMask.ToProtoFieldMask()) 8894 } 8895 8896 func (fieldMask Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) MarshalJSON() ([]byte, error) { 8897 return json.Marshal(fieldMask.ToProtoFieldMask()) 8898 } 8899 8900 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) UnmarshalJSON(data []byte) error { 8901 protoFieldMask := &googlefieldmaskpb.FieldMask{} 8902 if err := json.Unmarshal(data, protoFieldMask); err != nil { 8903 return err 8904 } 8905 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 8906 return err 8907 } 8908 return nil 8909 } 8910 8911 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) AppendPath(path DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath) { 8912 fieldMask.Paths = append(fieldMask.Paths, path) 8913 } 8914 8915 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 8916 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath)) 8917 } 8918 8919 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) GetPaths() []DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath { 8920 if fieldMask == nil { 8921 return nil 8922 } 8923 return fieldMask.Paths 8924 } 8925 8926 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) GetRawPaths() []gotenobject.FieldPath { 8927 if fieldMask == nil { 8928 return nil 8929 } 8930 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 8931 for _, path := range fieldMask.Paths { 8932 rawPaths = append(rawPaths, path) 8933 } 8934 return rawPaths 8935 } 8936 8937 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) SetFromCliFlag(raw string) error { 8938 path, err := ParseDeviceSpecNetworkingConfigTunnelsOptsKey_FieldPath(raw) 8939 if err != nil { 8940 return err 8941 } 8942 fieldMask.Paths = append(fieldMask.Paths, path) 8943 return nil 8944 } 8945 8946 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Set(target, source *Device_Spec_NetworkingConfig_TunnelsOpts_Key) { 8947 for _, path := range fieldMask.Paths { 8948 val, _ := path.GetSingle(source) 8949 // if val is nil, then field does not exist in source, skip 8950 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 8951 if val != nil { 8952 path.WithIValue(val).SetTo(&target) 8953 } 8954 } 8955 } 8956 8957 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 8958 fieldMask.Set(target.(*Device_Spec_NetworkingConfig_TunnelsOpts_Key), source.(*Device_Spec_NetworkingConfig_TunnelsOpts_Key)) 8959 } 8960 8961 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) Project(source *Device_Spec_NetworkingConfig_TunnelsOpts_Key) *Device_Spec_NetworkingConfig_TunnelsOpts_Key { 8962 if source == nil { 8963 return nil 8964 } 8965 if fieldMask == nil { 8966 return source 8967 } 8968 result := &Device_Spec_NetworkingConfig_TunnelsOpts_Key{} 8969 8970 for _, p := range fieldMask.Paths { 8971 switch tp := p.(type) { 8972 case *DeviceSpecNetworkingConfigTunnelsOptsKey_FieldTerminalPath: 8973 switch tp.selector { 8974 case DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPathSelectorInput: 8975 result.Input = source.Input 8976 case DeviceSpecNetworkingConfigTunnelsOptsKey_FieldPathSelectorOutput: 8977 result.Output = source.Output 8978 } 8979 } 8980 } 8981 return result 8982 } 8983 8984 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 8985 return fieldMask.Project(source.(*Device_Spec_NetworkingConfig_TunnelsOpts_Key)) 8986 } 8987 8988 func (fieldMask *Device_Spec_NetworkingConfig_TunnelsOpts_Key_FieldMask) PathsCount() int { 8989 if fieldMask == nil { 8990 return 0 8991 } 8992 return len(fieldMask.Paths) 8993 } 8994 8995 type Device_Spec_SSHConfig_AuthKey_FieldMask struct { 8996 Paths []DeviceSpecSSHConfigAuthKey_FieldPath 8997 } 8998 8999 func FullDevice_Spec_SSHConfig_AuthKey_FieldMask() *Device_Spec_SSHConfig_AuthKey_FieldMask { 9000 res := &Device_Spec_SSHConfig_AuthKey_FieldMask{} 9001 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey}) 9002 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority}) 9003 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand}) 9004 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment}) 9005 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom}) 9006 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding}) 9007 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding}) 9008 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty}) 9009 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc}) 9010 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding}) 9011 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen}) 9012 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals}) 9013 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel}) 9014 res.Paths = append(res.Paths, &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict}) 9015 return res 9016 } 9017 9018 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) String() string { 9019 if fieldMask == nil { 9020 return "<nil>" 9021 } 9022 pathsStr := make([]string, 0, len(fieldMask.Paths)) 9023 for _, path := range fieldMask.Paths { 9024 pathsStr = append(pathsStr, path.String()) 9025 } 9026 return strings.Join(pathsStr, ", ") 9027 } 9028 9029 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) IsFull() bool { 9030 if fieldMask == nil { 9031 return false 9032 } 9033 presentSelectors := make([]bool, 14) 9034 for _, path := range fieldMask.Paths { 9035 if asFinal, ok := path.(*DeviceSpecSSHConfigAuthKey_FieldTerminalPath); ok { 9036 presentSelectors[int(asFinal.selector)] = true 9037 } 9038 } 9039 for _, flag := range presentSelectors { 9040 if !flag { 9041 return false 9042 } 9043 } 9044 return true 9045 } 9046 9047 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) ProtoReflect() preflect.Message { 9048 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 9049 return ParseDeviceSpecSSHConfigAuthKey_FieldPath(raw) 9050 }) 9051 } 9052 9053 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) ProtoMessage() {} 9054 9055 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) Reset() { 9056 if fieldMask != nil { 9057 fieldMask.Paths = nil 9058 } 9059 } 9060 9061 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) Subtract(other *Device_Spec_SSHConfig_AuthKey_FieldMask) *Device_Spec_SSHConfig_AuthKey_FieldMask { 9062 result := &Device_Spec_SSHConfig_AuthKey_FieldMask{} 9063 removedSelectors := make([]bool, 14) 9064 9065 for _, path := range other.GetPaths() { 9066 switch tp := path.(type) { 9067 case *DeviceSpecSSHConfigAuthKey_FieldTerminalPath: 9068 removedSelectors[int(tp.selector)] = true 9069 } 9070 } 9071 for _, path := range fieldMask.GetPaths() { 9072 if !removedSelectors[int(path.Selector())] { 9073 result.Paths = append(result.Paths, path) 9074 } 9075 } 9076 9077 if len(result.Paths) == 0 { 9078 return nil 9079 } 9080 return result 9081 } 9082 9083 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 9084 return fieldMask.Subtract(other.(*Device_Spec_SSHConfig_AuthKey_FieldMask)) 9085 } 9086 9087 // FilterInputFields generates copy of field paths with output_only field paths removed 9088 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) FilterInputFields() *Device_Spec_SSHConfig_AuthKey_FieldMask { 9089 result := &Device_Spec_SSHConfig_AuthKey_FieldMask{} 9090 result.Paths = append(result.Paths, fieldMask.Paths...) 9091 return result 9092 } 9093 9094 // ToFieldMask is used for proto conversions 9095 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 9096 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9097 for _, path := range fieldMask.Paths { 9098 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 9099 } 9100 return protoFieldMask 9101 } 9102 9103 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 9104 if fieldMask == nil { 9105 return status.Error(codes.Internal, "target field mask is nil") 9106 } 9107 fieldMask.Paths = make([]DeviceSpecSSHConfigAuthKey_FieldPath, 0, len(protoFieldMask.Paths)) 9108 for _, strPath := range protoFieldMask.Paths { 9109 path, err := ParseDeviceSpecSSHConfigAuthKey_FieldPath(strPath) 9110 if err != nil { 9111 return err 9112 } 9113 fieldMask.Paths = append(fieldMask.Paths, path) 9114 } 9115 return nil 9116 } 9117 9118 // implement methods required by customType 9119 func (fieldMask Device_Spec_SSHConfig_AuthKey_FieldMask) Marshal() ([]byte, error) { 9120 protoFieldMask := fieldMask.ToProtoFieldMask() 9121 return proto.Marshal(protoFieldMask) 9122 } 9123 9124 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) Unmarshal(data []byte) error { 9125 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9126 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 9127 return err 9128 } 9129 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9130 return err 9131 } 9132 return nil 9133 } 9134 9135 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) Size() int { 9136 return proto.Size(fieldMask.ToProtoFieldMask()) 9137 } 9138 9139 func (fieldMask Device_Spec_SSHConfig_AuthKey_FieldMask) MarshalJSON() ([]byte, error) { 9140 return json.Marshal(fieldMask.ToProtoFieldMask()) 9141 } 9142 9143 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) UnmarshalJSON(data []byte) error { 9144 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9145 if err := json.Unmarshal(data, protoFieldMask); err != nil { 9146 return err 9147 } 9148 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9149 return err 9150 } 9151 return nil 9152 } 9153 9154 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) AppendPath(path DeviceSpecSSHConfigAuthKey_FieldPath) { 9155 fieldMask.Paths = append(fieldMask.Paths, path) 9156 } 9157 9158 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 9159 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceSpecSSHConfigAuthKey_FieldPath)) 9160 } 9161 9162 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) GetPaths() []DeviceSpecSSHConfigAuthKey_FieldPath { 9163 if fieldMask == nil { 9164 return nil 9165 } 9166 return fieldMask.Paths 9167 } 9168 9169 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) GetRawPaths() []gotenobject.FieldPath { 9170 if fieldMask == nil { 9171 return nil 9172 } 9173 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 9174 for _, path := range fieldMask.Paths { 9175 rawPaths = append(rawPaths, path) 9176 } 9177 return rawPaths 9178 } 9179 9180 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) SetFromCliFlag(raw string) error { 9181 path, err := ParseDeviceSpecSSHConfigAuthKey_FieldPath(raw) 9182 if err != nil { 9183 return err 9184 } 9185 fieldMask.Paths = append(fieldMask.Paths, path) 9186 return nil 9187 } 9188 9189 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) Set(target, source *Device_Spec_SSHConfig_AuthKey) { 9190 for _, path := range fieldMask.Paths { 9191 val, _ := path.GetSingle(source) 9192 // if val is nil, then field does not exist in source, skip 9193 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 9194 if val != nil { 9195 path.WithIValue(val).SetTo(&target) 9196 } 9197 } 9198 } 9199 9200 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 9201 fieldMask.Set(target.(*Device_Spec_SSHConfig_AuthKey), source.(*Device_Spec_SSHConfig_AuthKey)) 9202 } 9203 9204 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) Project(source *Device_Spec_SSHConfig_AuthKey) *Device_Spec_SSHConfig_AuthKey { 9205 if source == nil { 9206 return nil 9207 } 9208 if fieldMask == nil { 9209 return source 9210 } 9211 result := &Device_Spec_SSHConfig_AuthKey{} 9212 9213 for _, p := range fieldMask.Paths { 9214 switch tp := p.(type) { 9215 case *DeviceSpecSSHConfigAuthKey_FieldTerminalPath: 9216 switch tp.selector { 9217 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 9218 result.SshaKey = source.SshaKey 9219 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 9220 result.CertAuthority = source.CertAuthority 9221 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 9222 result.Command = source.Command 9223 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 9224 result.Environment = source.Environment 9225 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 9226 result.From = source.From 9227 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 9228 result.NoAgentForwarding = source.NoAgentForwarding 9229 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 9230 result.NoPortForwarding = source.NoPortForwarding 9231 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 9232 result.NoPty = source.NoPty 9233 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 9234 result.NoUserRc = source.NoUserRc 9235 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 9236 result.NoX11Forwarding = source.NoX11Forwarding 9237 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 9238 result.Permitopen = source.Permitopen 9239 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 9240 result.Principals = source.Principals 9241 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 9242 result.Tunnel = source.Tunnel 9243 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 9244 result.Restrict = source.Restrict 9245 } 9246 } 9247 } 9248 return result 9249 } 9250 9251 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 9252 return fieldMask.Project(source.(*Device_Spec_SSHConfig_AuthKey)) 9253 } 9254 9255 func (fieldMask *Device_Spec_SSHConfig_AuthKey_FieldMask) PathsCount() int { 9256 if fieldMask == nil { 9257 return 0 9258 } 9259 return len(fieldMask.Paths) 9260 } 9261 9262 type Device_Status_Address_FieldMask struct { 9263 Paths []DeviceStatusAddress_FieldPath 9264 } 9265 9266 func FullDevice_Status_Address_FieldMask() *Device_Status_Address_FieldMask { 9267 res := &Device_Status_Address_FieldMask{} 9268 res.Paths = append(res.Paths, &DeviceStatusAddress_FieldTerminalPath{selector: DeviceStatusAddress_FieldPathSelectorAddress}) 9269 res.Paths = append(res.Paths, &DeviceStatusAddress_FieldTerminalPath{selector: DeviceStatusAddress_FieldPathSelectorType}) 9270 return res 9271 } 9272 9273 func (fieldMask *Device_Status_Address_FieldMask) String() string { 9274 if fieldMask == nil { 9275 return "<nil>" 9276 } 9277 pathsStr := make([]string, 0, len(fieldMask.Paths)) 9278 for _, path := range fieldMask.Paths { 9279 pathsStr = append(pathsStr, path.String()) 9280 } 9281 return strings.Join(pathsStr, ", ") 9282 } 9283 9284 func (fieldMask *Device_Status_Address_FieldMask) IsFull() bool { 9285 if fieldMask == nil { 9286 return false 9287 } 9288 presentSelectors := make([]bool, 2) 9289 for _, path := range fieldMask.Paths { 9290 if asFinal, ok := path.(*DeviceStatusAddress_FieldTerminalPath); ok { 9291 presentSelectors[int(asFinal.selector)] = true 9292 } 9293 } 9294 for _, flag := range presentSelectors { 9295 if !flag { 9296 return false 9297 } 9298 } 9299 return true 9300 } 9301 9302 func (fieldMask *Device_Status_Address_FieldMask) ProtoReflect() preflect.Message { 9303 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 9304 return ParseDeviceStatusAddress_FieldPath(raw) 9305 }) 9306 } 9307 9308 func (fieldMask *Device_Status_Address_FieldMask) ProtoMessage() {} 9309 9310 func (fieldMask *Device_Status_Address_FieldMask) Reset() { 9311 if fieldMask != nil { 9312 fieldMask.Paths = nil 9313 } 9314 } 9315 9316 func (fieldMask *Device_Status_Address_FieldMask) Subtract(other *Device_Status_Address_FieldMask) *Device_Status_Address_FieldMask { 9317 result := &Device_Status_Address_FieldMask{} 9318 removedSelectors := make([]bool, 2) 9319 9320 for _, path := range other.GetPaths() { 9321 switch tp := path.(type) { 9322 case *DeviceStatusAddress_FieldTerminalPath: 9323 removedSelectors[int(tp.selector)] = true 9324 } 9325 } 9326 for _, path := range fieldMask.GetPaths() { 9327 if !removedSelectors[int(path.Selector())] { 9328 result.Paths = append(result.Paths, path) 9329 } 9330 } 9331 9332 if len(result.Paths) == 0 { 9333 return nil 9334 } 9335 return result 9336 } 9337 9338 func (fieldMask *Device_Status_Address_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 9339 return fieldMask.Subtract(other.(*Device_Status_Address_FieldMask)) 9340 } 9341 9342 // FilterInputFields generates copy of field paths with output_only field paths removed 9343 func (fieldMask *Device_Status_Address_FieldMask) FilterInputFields() *Device_Status_Address_FieldMask { 9344 result := &Device_Status_Address_FieldMask{} 9345 result.Paths = append(result.Paths, fieldMask.Paths...) 9346 return result 9347 } 9348 9349 // ToFieldMask is used for proto conversions 9350 func (fieldMask *Device_Status_Address_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 9351 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9352 for _, path := range fieldMask.Paths { 9353 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 9354 } 9355 return protoFieldMask 9356 } 9357 9358 func (fieldMask *Device_Status_Address_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 9359 if fieldMask == nil { 9360 return status.Error(codes.Internal, "target field mask is nil") 9361 } 9362 fieldMask.Paths = make([]DeviceStatusAddress_FieldPath, 0, len(protoFieldMask.Paths)) 9363 for _, strPath := range protoFieldMask.Paths { 9364 path, err := ParseDeviceStatusAddress_FieldPath(strPath) 9365 if err != nil { 9366 return err 9367 } 9368 fieldMask.Paths = append(fieldMask.Paths, path) 9369 } 9370 return nil 9371 } 9372 9373 // implement methods required by customType 9374 func (fieldMask Device_Status_Address_FieldMask) Marshal() ([]byte, error) { 9375 protoFieldMask := fieldMask.ToProtoFieldMask() 9376 return proto.Marshal(protoFieldMask) 9377 } 9378 9379 func (fieldMask *Device_Status_Address_FieldMask) Unmarshal(data []byte) error { 9380 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9381 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 9382 return err 9383 } 9384 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9385 return err 9386 } 9387 return nil 9388 } 9389 9390 func (fieldMask *Device_Status_Address_FieldMask) Size() int { 9391 return proto.Size(fieldMask.ToProtoFieldMask()) 9392 } 9393 9394 func (fieldMask Device_Status_Address_FieldMask) MarshalJSON() ([]byte, error) { 9395 return json.Marshal(fieldMask.ToProtoFieldMask()) 9396 } 9397 9398 func (fieldMask *Device_Status_Address_FieldMask) UnmarshalJSON(data []byte) error { 9399 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9400 if err := json.Unmarshal(data, protoFieldMask); err != nil { 9401 return err 9402 } 9403 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9404 return err 9405 } 9406 return nil 9407 } 9408 9409 func (fieldMask *Device_Status_Address_FieldMask) AppendPath(path DeviceStatusAddress_FieldPath) { 9410 fieldMask.Paths = append(fieldMask.Paths, path) 9411 } 9412 9413 func (fieldMask *Device_Status_Address_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 9414 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusAddress_FieldPath)) 9415 } 9416 9417 func (fieldMask *Device_Status_Address_FieldMask) GetPaths() []DeviceStatusAddress_FieldPath { 9418 if fieldMask == nil { 9419 return nil 9420 } 9421 return fieldMask.Paths 9422 } 9423 9424 func (fieldMask *Device_Status_Address_FieldMask) GetRawPaths() []gotenobject.FieldPath { 9425 if fieldMask == nil { 9426 return nil 9427 } 9428 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 9429 for _, path := range fieldMask.Paths { 9430 rawPaths = append(rawPaths, path) 9431 } 9432 return rawPaths 9433 } 9434 9435 func (fieldMask *Device_Status_Address_FieldMask) SetFromCliFlag(raw string) error { 9436 path, err := ParseDeviceStatusAddress_FieldPath(raw) 9437 if err != nil { 9438 return err 9439 } 9440 fieldMask.Paths = append(fieldMask.Paths, path) 9441 return nil 9442 } 9443 9444 func (fieldMask *Device_Status_Address_FieldMask) Set(target, source *Device_Status_Address) { 9445 for _, path := range fieldMask.Paths { 9446 val, _ := path.GetSingle(source) 9447 // if val is nil, then field does not exist in source, skip 9448 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 9449 if val != nil { 9450 path.WithIValue(val).SetTo(&target) 9451 } 9452 } 9453 } 9454 9455 func (fieldMask *Device_Status_Address_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 9456 fieldMask.Set(target.(*Device_Status_Address), source.(*Device_Status_Address)) 9457 } 9458 9459 func (fieldMask *Device_Status_Address_FieldMask) Project(source *Device_Status_Address) *Device_Status_Address { 9460 if source == nil { 9461 return nil 9462 } 9463 if fieldMask == nil { 9464 return source 9465 } 9466 result := &Device_Status_Address{} 9467 9468 for _, p := range fieldMask.Paths { 9469 switch tp := p.(type) { 9470 case *DeviceStatusAddress_FieldTerminalPath: 9471 switch tp.selector { 9472 case DeviceStatusAddress_FieldPathSelectorAddress: 9473 result.Address = source.Address 9474 case DeviceStatusAddress_FieldPathSelectorType: 9475 result.Type = source.Type 9476 } 9477 } 9478 } 9479 return result 9480 } 9481 9482 func (fieldMask *Device_Status_Address_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 9483 return fieldMask.Project(source.(*Device_Status_Address)) 9484 } 9485 9486 func (fieldMask *Device_Status_Address_FieldMask) PathsCount() int { 9487 if fieldMask == nil { 9488 return 0 9489 } 9490 return len(fieldMask.Paths) 9491 } 9492 9493 type Device_Status_Condition_FieldMask struct { 9494 Paths []DeviceStatusCondition_FieldPath 9495 } 9496 9497 func FullDevice_Status_Condition_FieldMask() *Device_Status_Condition_FieldMask { 9498 res := &Device_Status_Condition_FieldMask{} 9499 res.Paths = append(res.Paths, &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorMessage}) 9500 res.Paths = append(res.Paths, &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorReason}) 9501 res.Paths = append(res.Paths, &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorStatus}) 9502 res.Paths = append(res.Paths, &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorType}) 9503 res.Paths = append(res.Paths, &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime}) 9504 res.Paths = append(res.Paths, &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorLastTransitionTime}) 9505 return res 9506 } 9507 9508 func (fieldMask *Device_Status_Condition_FieldMask) String() string { 9509 if fieldMask == nil { 9510 return "<nil>" 9511 } 9512 pathsStr := make([]string, 0, len(fieldMask.Paths)) 9513 for _, path := range fieldMask.Paths { 9514 pathsStr = append(pathsStr, path.String()) 9515 } 9516 return strings.Join(pathsStr, ", ") 9517 } 9518 9519 func (fieldMask *Device_Status_Condition_FieldMask) IsFull() bool { 9520 if fieldMask == nil { 9521 return false 9522 } 9523 presentSelectors := make([]bool, 6) 9524 for _, path := range fieldMask.Paths { 9525 if asFinal, ok := path.(*DeviceStatusCondition_FieldTerminalPath); ok { 9526 presentSelectors[int(asFinal.selector)] = true 9527 } 9528 } 9529 for _, flag := range presentSelectors { 9530 if !flag { 9531 return false 9532 } 9533 } 9534 return true 9535 } 9536 9537 func (fieldMask *Device_Status_Condition_FieldMask) ProtoReflect() preflect.Message { 9538 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 9539 return ParseDeviceStatusCondition_FieldPath(raw) 9540 }) 9541 } 9542 9543 func (fieldMask *Device_Status_Condition_FieldMask) ProtoMessage() {} 9544 9545 func (fieldMask *Device_Status_Condition_FieldMask) Reset() { 9546 if fieldMask != nil { 9547 fieldMask.Paths = nil 9548 } 9549 } 9550 9551 func (fieldMask *Device_Status_Condition_FieldMask) Subtract(other *Device_Status_Condition_FieldMask) *Device_Status_Condition_FieldMask { 9552 result := &Device_Status_Condition_FieldMask{} 9553 removedSelectors := make([]bool, 6) 9554 9555 for _, path := range other.GetPaths() { 9556 switch tp := path.(type) { 9557 case *DeviceStatusCondition_FieldTerminalPath: 9558 removedSelectors[int(tp.selector)] = true 9559 } 9560 } 9561 for _, path := range fieldMask.GetPaths() { 9562 if !removedSelectors[int(path.Selector())] { 9563 result.Paths = append(result.Paths, path) 9564 } 9565 } 9566 9567 if len(result.Paths) == 0 { 9568 return nil 9569 } 9570 return result 9571 } 9572 9573 func (fieldMask *Device_Status_Condition_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 9574 return fieldMask.Subtract(other.(*Device_Status_Condition_FieldMask)) 9575 } 9576 9577 // FilterInputFields generates copy of field paths with output_only field paths removed 9578 func (fieldMask *Device_Status_Condition_FieldMask) FilterInputFields() *Device_Status_Condition_FieldMask { 9579 result := &Device_Status_Condition_FieldMask{} 9580 result.Paths = append(result.Paths, fieldMask.Paths...) 9581 return result 9582 } 9583 9584 // ToFieldMask is used for proto conversions 9585 func (fieldMask *Device_Status_Condition_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 9586 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9587 for _, path := range fieldMask.Paths { 9588 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 9589 } 9590 return protoFieldMask 9591 } 9592 9593 func (fieldMask *Device_Status_Condition_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 9594 if fieldMask == nil { 9595 return status.Error(codes.Internal, "target field mask is nil") 9596 } 9597 fieldMask.Paths = make([]DeviceStatusCondition_FieldPath, 0, len(protoFieldMask.Paths)) 9598 for _, strPath := range protoFieldMask.Paths { 9599 path, err := ParseDeviceStatusCondition_FieldPath(strPath) 9600 if err != nil { 9601 return err 9602 } 9603 fieldMask.Paths = append(fieldMask.Paths, path) 9604 } 9605 return nil 9606 } 9607 9608 // implement methods required by customType 9609 func (fieldMask Device_Status_Condition_FieldMask) Marshal() ([]byte, error) { 9610 protoFieldMask := fieldMask.ToProtoFieldMask() 9611 return proto.Marshal(protoFieldMask) 9612 } 9613 9614 func (fieldMask *Device_Status_Condition_FieldMask) Unmarshal(data []byte) error { 9615 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9616 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 9617 return err 9618 } 9619 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9620 return err 9621 } 9622 return nil 9623 } 9624 9625 func (fieldMask *Device_Status_Condition_FieldMask) Size() int { 9626 return proto.Size(fieldMask.ToProtoFieldMask()) 9627 } 9628 9629 func (fieldMask Device_Status_Condition_FieldMask) MarshalJSON() ([]byte, error) { 9630 return json.Marshal(fieldMask.ToProtoFieldMask()) 9631 } 9632 9633 func (fieldMask *Device_Status_Condition_FieldMask) UnmarshalJSON(data []byte) error { 9634 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9635 if err := json.Unmarshal(data, protoFieldMask); err != nil { 9636 return err 9637 } 9638 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9639 return err 9640 } 9641 return nil 9642 } 9643 9644 func (fieldMask *Device_Status_Condition_FieldMask) AppendPath(path DeviceStatusCondition_FieldPath) { 9645 fieldMask.Paths = append(fieldMask.Paths, path) 9646 } 9647 9648 func (fieldMask *Device_Status_Condition_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 9649 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusCondition_FieldPath)) 9650 } 9651 9652 func (fieldMask *Device_Status_Condition_FieldMask) GetPaths() []DeviceStatusCondition_FieldPath { 9653 if fieldMask == nil { 9654 return nil 9655 } 9656 return fieldMask.Paths 9657 } 9658 9659 func (fieldMask *Device_Status_Condition_FieldMask) GetRawPaths() []gotenobject.FieldPath { 9660 if fieldMask == nil { 9661 return nil 9662 } 9663 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 9664 for _, path := range fieldMask.Paths { 9665 rawPaths = append(rawPaths, path) 9666 } 9667 return rawPaths 9668 } 9669 9670 func (fieldMask *Device_Status_Condition_FieldMask) SetFromCliFlag(raw string) error { 9671 path, err := ParseDeviceStatusCondition_FieldPath(raw) 9672 if err != nil { 9673 return err 9674 } 9675 fieldMask.Paths = append(fieldMask.Paths, path) 9676 return nil 9677 } 9678 9679 func (fieldMask *Device_Status_Condition_FieldMask) Set(target, source *Device_Status_Condition) { 9680 for _, path := range fieldMask.Paths { 9681 val, _ := path.GetSingle(source) 9682 // if val is nil, then field does not exist in source, skip 9683 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 9684 if val != nil { 9685 path.WithIValue(val).SetTo(&target) 9686 } 9687 } 9688 } 9689 9690 func (fieldMask *Device_Status_Condition_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 9691 fieldMask.Set(target.(*Device_Status_Condition), source.(*Device_Status_Condition)) 9692 } 9693 9694 func (fieldMask *Device_Status_Condition_FieldMask) Project(source *Device_Status_Condition) *Device_Status_Condition { 9695 if source == nil { 9696 return nil 9697 } 9698 if fieldMask == nil { 9699 return source 9700 } 9701 result := &Device_Status_Condition{} 9702 9703 for _, p := range fieldMask.Paths { 9704 switch tp := p.(type) { 9705 case *DeviceStatusCondition_FieldTerminalPath: 9706 switch tp.selector { 9707 case DeviceStatusCondition_FieldPathSelectorMessage: 9708 result.Message = source.Message 9709 case DeviceStatusCondition_FieldPathSelectorReason: 9710 result.Reason = source.Reason 9711 case DeviceStatusCondition_FieldPathSelectorStatus: 9712 result.Status = source.Status 9713 case DeviceStatusCondition_FieldPathSelectorType: 9714 result.Type = source.Type 9715 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 9716 result.LastHeartBeatTime = source.LastHeartBeatTime 9717 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 9718 result.LastTransitionTime = source.LastTransitionTime 9719 } 9720 } 9721 } 9722 return result 9723 } 9724 9725 func (fieldMask *Device_Status_Condition_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 9726 return fieldMask.Project(source.(*Device_Status_Condition)) 9727 } 9728 9729 func (fieldMask *Device_Status_Condition_FieldMask) PathsCount() int { 9730 if fieldMask == nil { 9731 return 0 9732 } 9733 return len(fieldMask.Paths) 9734 } 9735 9736 type Device_Status_NetworkConfigState_FieldMask struct { 9737 Paths []DeviceStatusNetworkConfigState_FieldPath 9738 } 9739 9740 func FullDevice_Status_NetworkConfigState_FieldMask() *Device_Status_NetworkConfigState_FieldMask { 9741 res := &Device_Status_NetworkConfigState_FieldMask{} 9742 res.Paths = append(res.Paths, &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource}) 9743 res.Paths = append(res.Paths, &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource}) 9744 res.Paths = append(res.Paths, &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError}) 9745 res.Paths = append(res.Paths, &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig}) 9746 res.Paths = append(res.Paths, &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig}) 9747 res.Paths = append(res.Paths, &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig}) 9748 return res 9749 } 9750 9751 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) String() string { 9752 if fieldMask == nil { 9753 return "<nil>" 9754 } 9755 pathsStr := make([]string, 0, len(fieldMask.Paths)) 9756 for _, path := range fieldMask.Paths { 9757 pathsStr = append(pathsStr, path.String()) 9758 } 9759 return strings.Join(pathsStr, ", ") 9760 } 9761 9762 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) IsFull() bool { 9763 if fieldMask == nil { 9764 return false 9765 } 9766 presentSelectors := make([]bool, 6) 9767 for _, path := range fieldMask.Paths { 9768 if asFinal, ok := path.(*DeviceStatusNetworkConfigState_FieldTerminalPath); ok { 9769 presentSelectors[int(asFinal.selector)] = true 9770 } 9771 } 9772 for _, flag := range presentSelectors { 9773 if !flag { 9774 return false 9775 } 9776 } 9777 return true 9778 } 9779 9780 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) ProtoReflect() preflect.Message { 9781 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 9782 return ParseDeviceStatusNetworkConfigState_FieldPath(raw) 9783 }) 9784 } 9785 9786 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) ProtoMessage() {} 9787 9788 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) Reset() { 9789 if fieldMask != nil { 9790 fieldMask.Paths = nil 9791 } 9792 } 9793 9794 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) Subtract(other *Device_Status_NetworkConfigState_FieldMask) *Device_Status_NetworkConfigState_FieldMask { 9795 result := &Device_Status_NetworkConfigState_FieldMask{} 9796 removedSelectors := make([]bool, 6) 9797 otherSubMasks := map[DeviceStatusNetworkConfigState_FieldPathSelector]gotenobject.FieldMask{ 9798 DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig: &Device_Spec_NetplanConfig_FieldMask{}, 9799 DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig: &Device_Spec_NetplanConfig_FieldMask{}, 9800 DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig: &Device_Spec_NetplanConfig_FieldMask{}, 9801 } 9802 mySubMasks := map[DeviceStatusNetworkConfigState_FieldPathSelector]gotenobject.FieldMask{ 9803 DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig: &Device_Spec_NetplanConfig_FieldMask{}, 9804 DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig: &Device_Spec_NetplanConfig_FieldMask{}, 9805 DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig: &Device_Spec_NetplanConfig_FieldMask{}, 9806 } 9807 9808 for _, path := range other.GetPaths() { 9809 switch tp := path.(type) { 9810 case *DeviceStatusNetworkConfigState_FieldTerminalPath: 9811 removedSelectors[int(tp.selector)] = true 9812 case *DeviceStatusNetworkConfigState_FieldSubPath: 9813 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 9814 } 9815 } 9816 for _, path := range fieldMask.GetPaths() { 9817 if !removedSelectors[int(path.Selector())] { 9818 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 9819 if tp, ok := path.(*DeviceStatusNetworkConfigState_FieldTerminalPath); ok { 9820 switch tp.selector { 9821 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig: 9822 mySubMasks[DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig] = FullDevice_Spec_NetplanConfig_FieldMask() 9823 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig: 9824 mySubMasks[DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig] = FullDevice_Spec_NetplanConfig_FieldMask() 9825 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig: 9826 mySubMasks[DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig] = FullDevice_Spec_NetplanConfig_FieldMask() 9827 } 9828 } else if tp, ok := path.(*DeviceStatusNetworkConfigState_FieldSubPath); ok { 9829 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 9830 } 9831 } else { 9832 result.Paths = append(result.Paths, path) 9833 } 9834 } 9835 } 9836 for selector, mySubMask := range mySubMasks { 9837 if mySubMask.PathsCount() > 0 { 9838 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 9839 result.Paths = append(result.Paths, &DeviceStatusNetworkConfigState_FieldSubPath{selector: selector, subPath: allowedPath}) 9840 } 9841 } 9842 } 9843 9844 if len(result.Paths) == 0 { 9845 return nil 9846 } 9847 return result 9848 } 9849 9850 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 9851 return fieldMask.Subtract(other.(*Device_Status_NetworkConfigState_FieldMask)) 9852 } 9853 9854 // FilterInputFields generates copy of field paths with output_only field paths removed 9855 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) FilterInputFields() *Device_Status_NetworkConfigState_FieldMask { 9856 result := &Device_Status_NetworkConfigState_FieldMask{} 9857 result.Paths = append(result.Paths, fieldMask.Paths...) 9858 return result 9859 } 9860 9861 // ToFieldMask is used for proto conversions 9862 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 9863 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9864 for _, path := range fieldMask.Paths { 9865 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 9866 } 9867 return protoFieldMask 9868 } 9869 9870 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 9871 if fieldMask == nil { 9872 return status.Error(codes.Internal, "target field mask is nil") 9873 } 9874 fieldMask.Paths = make([]DeviceStatusNetworkConfigState_FieldPath, 0, len(protoFieldMask.Paths)) 9875 for _, strPath := range protoFieldMask.Paths { 9876 path, err := ParseDeviceStatusNetworkConfigState_FieldPath(strPath) 9877 if err != nil { 9878 return err 9879 } 9880 fieldMask.Paths = append(fieldMask.Paths, path) 9881 } 9882 return nil 9883 } 9884 9885 // implement methods required by customType 9886 func (fieldMask Device_Status_NetworkConfigState_FieldMask) Marshal() ([]byte, error) { 9887 protoFieldMask := fieldMask.ToProtoFieldMask() 9888 return proto.Marshal(protoFieldMask) 9889 } 9890 9891 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) Unmarshal(data []byte) error { 9892 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9893 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 9894 return err 9895 } 9896 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9897 return err 9898 } 9899 return nil 9900 } 9901 9902 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) Size() int { 9903 return proto.Size(fieldMask.ToProtoFieldMask()) 9904 } 9905 9906 func (fieldMask Device_Status_NetworkConfigState_FieldMask) MarshalJSON() ([]byte, error) { 9907 return json.Marshal(fieldMask.ToProtoFieldMask()) 9908 } 9909 9910 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) UnmarshalJSON(data []byte) error { 9911 protoFieldMask := &googlefieldmaskpb.FieldMask{} 9912 if err := json.Unmarshal(data, protoFieldMask); err != nil { 9913 return err 9914 } 9915 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 9916 return err 9917 } 9918 return nil 9919 } 9920 9921 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) AppendPath(path DeviceStatusNetworkConfigState_FieldPath) { 9922 fieldMask.Paths = append(fieldMask.Paths, path) 9923 } 9924 9925 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 9926 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusNetworkConfigState_FieldPath)) 9927 } 9928 9929 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) GetPaths() []DeviceStatusNetworkConfigState_FieldPath { 9930 if fieldMask == nil { 9931 return nil 9932 } 9933 return fieldMask.Paths 9934 } 9935 9936 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) GetRawPaths() []gotenobject.FieldPath { 9937 if fieldMask == nil { 9938 return nil 9939 } 9940 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 9941 for _, path := range fieldMask.Paths { 9942 rawPaths = append(rawPaths, path) 9943 } 9944 return rawPaths 9945 } 9946 9947 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) SetFromCliFlag(raw string) error { 9948 path, err := ParseDeviceStatusNetworkConfigState_FieldPath(raw) 9949 if err != nil { 9950 return err 9951 } 9952 fieldMask.Paths = append(fieldMask.Paths, path) 9953 return nil 9954 } 9955 9956 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) Set(target, source *Device_Status_NetworkConfigState) { 9957 for _, path := range fieldMask.Paths { 9958 val, _ := path.GetSingle(source) 9959 // if val is nil, then field does not exist in source, skip 9960 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 9961 if val != nil { 9962 path.WithIValue(val).SetTo(&target) 9963 } 9964 } 9965 } 9966 9967 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 9968 fieldMask.Set(target.(*Device_Status_NetworkConfigState), source.(*Device_Status_NetworkConfigState)) 9969 } 9970 9971 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) Project(source *Device_Status_NetworkConfigState) *Device_Status_NetworkConfigState { 9972 if source == nil { 9973 return nil 9974 } 9975 if fieldMask == nil { 9976 return source 9977 } 9978 result := &Device_Status_NetworkConfigState{} 9979 defaultConfigMask := &Device_Spec_NetplanConfig_FieldMask{} 9980 wholeDefaultConfigAccepted := false 9981 activeConfigMask := &Device_Spec_NetplanConfig_FieldMask{} 9982 wholeActiveConfigAccepted := false 9983 desiredConfigMask := &Device_Spec_NetplanConfig_FieldMask{} 9984 wholeDesiredConfigAccepted := false 9985 9986 for _, p := range fieldMask.Paths { 9987 switch tp := p.(type) { 9988 case *DeviceStatusNetworkConfigState_FieldTerminalPath: 9989 switch tp.selector { 9990 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 9991 result.ActiveNetworkConfigSource = source.ActiveNetworkConfigSource 9992 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 9993 result.DesiredNetworkConfigSource = source.DesiredNetworkConfigSource 9994 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 9995 result.DesiredNetworkConfigError = source.DesiredNetworkConfigError 9996 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig: 9997 result.DefaultConfig = source.DefaultConfig 9998 wholeDefaultConfigAccepted = true 9999 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig: 10000 result.ActiveConfig = source.ActiveConfig 10001 wholeActiveConfigAccepted = true 10002 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig: 10003 result.DesiredConfig = source.DesiredConfig 10004 wholeDesiredConfigAccepted = true 10005 } 10006 case *DeviceStatusNetworkConfigState_FieldSubPath: 10007 switch tp.selector { 10008 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultConfig: 10009 defaultConfigMask.AppendPath(tp.subPath.(DeviceSpecNetplanConfig_FieldPath)) 10010 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveConfig: 10011 activeConfigMask.AppendPath(tp.subPath.(DeviceSpecNetplanConfig_FieldPath)) 10012 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredConfig: 10013 desiredConfigMask.AppendPath(tp.subPath.(DeviceSpecNetplanConfig_FieldPath)) 10014 } 10015 } 10016 } 10017 if wholeDefaultConfigAccepted == false && len(defaultConfigMask.Paths) > 0 { 10018 result.DefaultConfig = defaultConfigMask.Project(source.GetDefaultConfig()) 10019 } 10020 if wholeActiveConfigAccepted == false && len(activeConfigMask.Paths) > 0 { 10021 result.ActiveConfig = activeConfigMask.Project(source.GetActiveConfig()) 10022 } 10023 if wholeDesiredConfigAccepted == false && len(desiredConfigMask.Paths) > 0 { 10024 result.DesiredConfig = desiredConfigMask.Project(source.GetDesiredConfig()) 10025 } 10026 return result 10027 } 10028 10029 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 10030 return fieldMask.Project(source.(*Device_Status_NetworkConfigState)) 10031 } 10032 10033 func (fieldMask *Device_Status_NetworkConfigState_FieldMask) PathsCount() int { 10034 if fieldMask == nil { 10035 return 0 10036 } 10037 return len(fieldMask.Paths) 10038 } 10039 10040 type Device_Status_ProxyConfigStatus_FieldMask struct { 10041 Paths []DeviceStatusProxyConfigStatus_FieldPath 10042 } 10043 10044 func FullDevice_Status_ProxyConfigStatus_FieldMask() *Device_Status_ProxyConfigStatus_FieldMask { 10045 res := &Device_Status_ProxyConfigStatus_FieldMask{} 10046 res.Paths = append(res.Paths, &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource}) 10047 res.Paths = append(res.Paths, &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource}) 10048 res.Paths = append(res.Paths, &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError}) 10049 res.Paths = append(res.Paths, &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig}) 10050 res.Paths = append(res.Paths, &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig}) 10051 res.Paths = append(res.Paths, &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig}) 10052 return res 10053 } 10054 10055 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) String() string { 10056 if fieldMask == nil { 10057 return "<nil>" 10058 } 10059 pathsStr := make([]string, 0, len(fieldMask.Paths)) 10060 for _, path := range fieldMask.Paths { 10061 pathsStr = append(pathsStr, path.String()) 10062 } 10063 return strings.Join(pathsStr, ", ") 10064 } 10065 10066 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) IsFull() bool { 10067 if fieldMask == nil { 10068 return false 10069 } 10070 presentSelectors := make([]bool, 6) 10071 for _, path := range fieldMask.Paths { 10072 if asFinal, ok := path.(*DeviceStatusProxyConfigStatus_FieldTerminalPath); ok { 10073 presentSelectors[int(asFinal.selector)] = true 10074 } 10075 } 10076 for _, flag := range presentSelectors { 10077 if !flag { 10078 return false 10079 } 10080 } 10081 return true 10082 } 10083 10084 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) ProtoReflect() preflect.Message { 10085 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 10086 return ParseDeviceStatusProxyConfigStatus_FieldPath(raw) 10087 }) 10088 } 10089 10090 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) ProtoMessage() {} 10091 10092 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) Reset() { 10093 if fieldMask != nil { 10094 fieldMask.Paths = nil 10095 } 10096 } 10097 10098 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) Subtract(other *Device_Status_ProxyConfigStatus_FieldMask) *Device_Status_ProxyConfigStatus_FieldMask { 10099 result := &Device_Status_ProxyConfigStatus_FieldMask{} 10100 removedSelectors := make([]bool, 6) 10101 otherSubMasks := map[DeviceStatusProxyConfigStatus_FieldPathSelector]gotenobject.FieldMask{ 10102 DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: &Device_Spec_ProxyConfig_FieldMask{}, 10103 DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: &Device_Spec_ProxyConfig_FieldMask{}, 10104 DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: &Device_Spec_ProxyConfig_FieldMask{}, 10105 } 10106 mySubMasks := map[DeviceStatusProxyConfigStatus_FieldPathSelector]gotenobject.FieldMask{ 10107 DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: &Device_Spec_ProxyConfig_FieldMask{}, 10108 DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: &Device_Spec_ProxyConfig_FieldMask{}, 10109 DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: &Device_Spec_ProxyConfig_FieldMask{}, 10110 } 10111 10112 for _, path := range other.GetPaths() { 10113 switch tp := path.(type) { 10114 case *DeviceStatusProxyConfigStatus_FieldTerminalPath: 10115 removedSelectors[int(tp.selector)] = true 10116 case *DeviceStatusProxyConfigStatus_FieldSubPath: 10117 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 10118 } 10119 } 10120 for _, path := range fieldMask.GetPaths() { 10121 if !removedSelectors[int(path.Selector())] { 10122 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 10123 if tp, ok := path.(*DeviceStatusProxyConfigStatus_FieldTerminalPath); ok { 10124 switch tp.selector { 10125 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 10126 mySubMasks[DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig] = FullDevice_Spec_ProxyConfig_FieldMask() 10127 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 10128 mySubMasks[DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig] = FullDevice_Spec_ProxyConfig_FieldMask() 10129 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 10130 mySubMasks[DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig] = FullDevice_Spec_ProxyConfig_FieldMask() 10131 } 10132 } else if tp, ok := path.(*DeviceStatusProxyConfigStatus_FieldSubPath); ok { 10133 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 10134 } 10135 } else { 10136 result.Paths = append(result.Paths, path) 10137 } 10138 } 10139 } 10140 for selector, mySubMask := range mySubMasks { 10141 if mySubMask.PathsCount() > 0 { 10142 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 10143 result.Paths = append(result.Paths, &DeviceStatusProxyConfigStatus_FieldSubPath{selector: selector, subPath: allowedPath}) 10144 } 10145 } 10146 } 10147 10148 if len(result.Paths) == 0 { 10149 return nil 10150 } 10151 return result 10152 } 10153 10154 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 10155 return fieldMask.Subtract(other.(*Device_Status_ProxyConfigStatus_FieldMask)) 10156 } 10157 10158 // FilterInputFields generates copy of field paths with output_only field paths removed 10159 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) FilterInputFields() *Device_Status_ProxyConfigStatus_FieldMask { 10160 result := &Device_Status_ProxyConfigStatus_FieldMask{} 10161 result.Paths = append(result.Paths, fieldMask.Paths...) 10162 return result 10163 } 10164 10165 // ToFieldMask is used for proto conversions 10166 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 10167 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10168 for _, path := range fieldMask.Paths { 10169 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 10170 } 10171 return protoFieldMask 10172 } 10173 10174 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 10175 if fieldMask == nil { 10176 return status.Error(codes.Internal, "target field mask is nil") 10177 } 10178 fieldMask.Paths = make([]DeviceStatusProxyConfigStatus_FieldPath, 0, len(protoFieldMask.Paths)) 10179 for _, strPath := range protoFieldMask.Paths { 10180 path, err := ParseDeviceStatusProxyConfigStatus_FieldPath(strPath) 10181 if err != nil { 10182 return err 10183 } 10184 fieldMask.Paths = append(fieldMask.Paths, path) 10185 } 10186 return nil 10187 } 10188 10189 // implement methods required by customType 10190 func (fieldMask Device_Status_ProxyConfigStatus_FieldMask) Marshal() ([]byte, error) { 10191 protoFieldMask := fieldMask.ToProtoFieldMask() 10192 return proto.Marshal(protoFieldMask) 10193 } 10194 10195 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) Unmarshal(data []byte) error { 10196 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10197 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 10198 return err 10199 } 10200 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 10201 return err 10202 } 10203 return nil 10204 } 10205 10206 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) Size() int { 10207 return proto.Size(fieldMask.ToProtoFieldMask()) 10208 } 10209 10210 func (fieldMask Device_Status_ProxyConfigStatus_FieldMask) MarshalJSON() ([]byte, error) { 10211 return json.Marshal(fieldMask.ToProtoFieldMask()) 10212 } 10213 10214 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) UnmarshalJSON(data []byte) error { 10215 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10216 if err := json.Unmarshal(data, protoFieldMask); err != nil { 10217 return err 10218 } 10219 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 10220 return err 10221 } 10222 return nil 10223 } 10224 10225 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) AppendPath(path DeviceStatusProxyConfigStatus_FieldPath) { 10226 fieldMask.Paths = append(fieldMask.Paths, path) 10227 } 10228 10229 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 10230 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusProxyConfigStatus_FieldPath)) 10231 } 10232 10233 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) GetPaths() []DeviceStatusProxyConfigStatus_FieldPath { 10234 if fieldMask == nil { 10235 return nil 10236 } 10237 return fieldMask.Paths 10238 } 10239 10240 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) GetRawPaths() []gotenobject.FieldPath { 10241 if fieldMask == nil { 10242 return nil 10243 } 10244 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 10245 for _, path := range fieldMask.Paths { 10246 rawPaths = append(rawPaths, path) 10247 } 10248 return rawPaths 10249 } 10250 10251 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) SetFromCliFlag(raw string) error { 10252 path, err := ParseDeviceStatusProxyConfigStatus_FieldPath(raw) 10253 if err != nil { 10254 return err 10255 } 10256 fieldMask.Paths = append(fieldMask.Paths, path) 10257 return nil 10258 } 10259 10260 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) Set(target, source *Device_Status_ProxyConfigStatus) { 10261 for _, path := range fieldMask.Paths { 10262 val, _ := path.GetSingle(source) 10263 // if val is nil, then field does not exist in source, skip 10264 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 10265 if val != nil { 10266 path.WithIValue(val).SetTo(&target) 10267 } 10268 } 10269 } 10270 10271 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 10272 fieldMask.Set(target.(*Device_Status_ProxyConfigStatus), source.(*Device_Status_ProxyConfigStatus)) 10273 } 10274 10275 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) Project(source *Device_Status_ProxyConfigStatus) *Device_Status_ProxyConfigStatus { 10276 if source == nil { 10277 return nil 10278 } 10279 if fieldMask == nil { 10280 return source 10281 } 10282 result := &Device_Status_ProxyConfigStatus{} 10283 defaultConfigMask := &Device_Spec_ProxyConfig_FieldMask{} 10284 wholeDefaultConfigAccepted := false 10285 activeConfigMask := &Device_Spec_ProxyConfig_FieldMask{} 10286 wholeActiveConfigAccepted := false 10287 apiConfigMask := &Device_Spec_ProxyConfig_FieldMask{} 10288 wholeApiConfigAccepted := false 10289 10290 for _, p := range fieldMask.Paths { 10291 switch tp := p.(type) { 10292 case *DeviceStatusProxyConfigStatus_FieldTerminalPath: 10293 switch tp.selector { 10294 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 10295 result.ActiveConfigSource = source.ActiveConfigSource 10296 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 10297 result.DesiredConfigSource = source.DesiredConfigSource 10298 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 10299 result.ProxyConfigError = source.ProxyConfigError 10300 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 10301 result.DefaultConfig = source.DefaultConfig 10302 wholeDefaultConfigAccepted = true 10303 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 10304 result.ActiveConfig = source.ActiveConfig 10305 wholeActiveConfigAccepted = true 10306 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 10307 result.ApiConfig = source.ApiConfig 10308 wholeApiConfigAccepted = true 10309 } 10310 case *DeviceStatusProxyConfigStatus_FieldSubPath: 10311 switch tp.selector { 10312 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 10313 defaultConfigMask.AppendPath(tp.subPath.(DeviceSpecProxyConfig_FieldPath)) 10314 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 10315 activeConfigMask.AppendPath(tp.subPath.(DeviceSpecProxyConfig_FieldPath)) 10316 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 10317 apiConfigMask.AppendPath(tp.subPath.(DeviceSpecProxyConfig_FieldPath)) 10318 } 10319 } 10320 } 10321 if wholeDefaultConfigAccepted == false && len(defaultConfigMask.Paths) > 0 { 10322 result.DefaultConfig = defaultConfigMask.Project(source.GetDefaultConfig()) 10323 } 10324 if wholeActiveConfigAccepted == false && len(activeConfigMask.Paths) > 0 { 10325 result.ActiveConfig = activeConfigMask.Project(source.GetActiveConfig()) 10326 } 10327 if wholeApiConfigAccepted == false && len(apiConfigMask.Paths) > 0 { 10328 result.ApiConfig = apiConfigMask.Project(source.GetApiConfig()) 10329 } 10330 return result 10331 } 10332 10333 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 10334 return fieldMask.Project(source.(*Device_Status_ProxyConfigStatus)) 10335 } 10336 10337 func (fieldMask *Device_Status_ProxyConfigStatus_FieldMask) PathsCount() int { 10338 if fieldMask == nil { 10339 return 0 10340 } 10341 return len(fieldMask.Paths) 10342 } 10343 10344 type Device_Status_DeviceInfo_FieldMask struct { 10345 Paths []DeviceStatusDeviceInfo_FieldPath 10346 } 10347 10348 func FullDevice_Status_DeviceInfo_FieldMask() *Device_Status_DeviceInfo_FieldMask { 10349 res := &Device_Status_DeviceInfo_FieldMask{} 10350 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorArchitecture}) 10351 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem}) 10352 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion}) 10353 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorOsImage}) 10354 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion}) 10355 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorOsVersion}) 10356 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorDriver}) 10357 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation}) 10358 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces}) 10359 res.Paths = append(res.Paths, &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo}) 10360 return res 10361 } 10362 10363 func (fieldMask *Device_Status_DeviceInfo_FieldMask) String() string { 10364 if fieldMask == nil { 10365 return "<nil>" 10366 } 10367 pathsStr := make([]string, 0, len(fieldMask.Paths)) 10368 for _, path := range fieldMask.Paths { 10369 pathsStr = append(pathsStr, path.String()) 10370 } 10371 return strings.Join(pathsStr, ", ") 10372 } 10373 10374 func (fieldMask *Device_Status_DeviceInfo_FieldMask) IsFull() bool { 10375 if fieldMask == nil { 10376 return false 10377 } 10378 presentSelectors := make([]bool, 10) 10379 for _, path := range fieldMask.Paths { 10380 if asFinal, ok := path.(*DeviceStatusDeviceInfo_FieldTerminalPath); ok { 10381 presentSelectors[int(asFinal.selector)] = true 10382 } 10383 } 10384 for _, flag := range presentSelectors { 10385 if !flag { 10386 return false 10387 } 10388 } 10389 return true 10390 } 10391 10392 func (fieldMask *Device_Status_DeviceInfo_FieldMask) ProtoReflect() preflect.Message { 10393 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 10394 return ParseDeviceStatusDeviceInfo_FieldPath(raw) 10395 }) 10396 } 10397 10398 func (fieldMask *Device_Status_DeviceInfo_FieldMask) ProtoMessage() {} 10399 10400 func (fieldMask *Device_Status_DeviceInfo_FieldMask) Reset() { 10401 if fieldMask != nil { 10402 fieldMask.Paths = nil 10403 } 10404 } 10405 10406 func (fieldMask *Device_Status_DeviceInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_FieldMask) *Device_Status_DeviceInfo_FieldMask { 10407 result := &Device_Status_DeviceInfo_FieldMask{} 10408 removedSelectors := make([]bool, 10) 10409 otherSubMasks := map[DeviceStatusDeviceInfo_FieldPathSelector]gotenobject.FieldMask{ 10410 DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: &Device_Status_DeviceInfo_HardwareInformation_FieldMask{}, 10411 DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask{}, 10412 } 10413 mySubMasks := map[DeviceStatusDeviceInfo_FieldPathSelector]gotenobject.FieldMask{ 10414 DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: &Device_Status_DeviceInfo_HardwareInformation_FieldMask{}, 10415 DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask{}, 10416 } 10417 10418 for _, path := range other.GetPaths() { 10419 switch tp := path.(type) { 10420 case *DeviceStatusDeviceInfo_FieldTerminalPath: 10421 removedSelectors[int(tp.selector)] = true 10422 case *DeviceStatusDeviceInfo_FieldSubPath: 10423 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 10424 } 10425 } 10426 for _, path := range fieldMask.GetPaths() { 10427 if !removedSelectors[int(path.Selector())] { 10428 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 10429 if tp, ok := path.(*DeviceStatusDeviceInfo_FieldTerminalPath); ok { 10430 switch tp.selector { 10431 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 10432 mySubMasks[DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation] = FullDevice_Status_DeviceInfo_HardwareInformation_FieldMask() 10433 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 10434 mySubMasks[DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo] = FullDevice_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask() 10435 } 10436 } else if tp, ok := path.(*DeviceStatusDeviceInfo_FieldSubPath); ok { 10437 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 10438 } 10439 } else { 10440 result.Paths = append(result.Paths, path) 10441 } 10442 } 10443 } 10444 for selector, mySubMask := range mySubMasks { 10445 if mySubMask.PathsCount() > 0 { 10446 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 10447 result.Paths = append(result.Paths, &DeviceStatusDeviceInfo_FieldSubPath{selector: selector, subPath: allowedPath}) 10448 } 10449 } 10450 } 10451 10452 if len(result.Paths) == 0 { 10453 return nil 10454 } 10455 return result 10456 } 10457 10458 func (fieldMask *Device_Status_DeviceInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 10459 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_FieldMask)) 10460 } 10461 10462 // FilterInputFields generates copy of field paths with output_only field paths removed 10463 func (fieldMask *Device_Status_DeviceInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_FieldMask { 10464 result := &Device_Status_DeviceInfo_FieldMask{} 10465 result.Paths = append(result.Paths, fieldMask.Paths...) 10466 return result 10467 } 10468 10469 // ToFieldMask is used for proto conversions 10470 func (fieldMask *Device_Status_DeviceInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 10471 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10472 for _, path := range fieldMask.Paths { 10473 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 10474 } 10475 return protoFieldMask 10476 } 10477 10478 func (fieldMask *Device_Status_DeviceInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 10479 if fieldMask == nil { 10480 return status.Error(codes.Internal, "target field mask is nil") 10481 } 10482 fieldMask.Paths = make([]DeviceStatusDeviceInfo_FieldPath, 0, len(protoFieldMask.Paths)) 10483 for _, strPath := range protoFieldMask.Paths { 10484 path, err := ParseDeviceStatusDeviceInfo_FieldPath(strPath) 10485 if err != nil { 10486 return err 10487 } 10488 fieldMask.Paths = append(fieldMask.Paths, path) 10489 } 10490 return nil 10491 } 10492 10493 // implement methods required by customType 10494 func (fieldMask Device_Status_DeviceInfo_FieldMask) Marshal() ([]byte, error) { 10495 protoFieldMask := fieldMask.ToProtoFieldMask() 10496 return proto.Marshal(protoFieldMask) 10497 } 10498 10499 func (fieldMask *Device_Status_DeviceInfo_FieldMask) Unmarshal(data []byte) error { 10500 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10501 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 10502 return err 10503 } 10504 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 10505 return err 10506 } 10507 return nil 10508 } 10509 10510 func (fieldMask *Device_Status_DeviceInfo_FieldMask) Size() int { 10511 return proto.Size(fieldMask.ToProtoFieldMask()) 10512 } 10513 10514 func (fieldMask Device_Status_DeviceInfo_FieldMask) MarshalJSON() ([]byte, error) { 10515 return json.Marshal(fieldMask.ToProtoFieldMask()) 10516 } 10517 10518 func (fieldMask *Device_Status_DeviceInfo_FieldMask) UnmarshalJSON(data []byte) error { 10519 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10520 if err := json.Unmarshal(data, protoFieldMask); err != nil { 10521 return err 10522 } 10523 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 10524 return err 10525 } 10526 return nil 10527 } 10528 10529 func (fieldMask *Device_Status_DeviceInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfo_FieldPath) { 10530 fieldMask.Paths = append(fieldMask.Paths, path) 10531 } 10532 10533 func (fieldMask *Device_Status_DeviceInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 10534 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfo_FieldPath)) 10535 } 10536 10537 func (fieldMask *Device_Status_DeviceInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfo_FieldPath { 10538 if fieldMask == nil { 10539 return nil 10540 } 10541 return fieldMask.Paths 10542 } 10543 10544 func (fieldMask *Device_Status_DeviceInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 10545 if fieldMask == nil { 10546 return nil 10547 } 10548 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 10549 for _, path := range fieldMask.Paths { 10550 rawPaths = append(rawPaths, path) 10551 } 10552 return rawPaths 10553 } 10554 10555 func (fieldMask *Device_Status_DeviceInfo_FieldMask) SetFromCliFlag(raw string) error { 10556 path, err := ParseDeviceStatusDeviceInfo_FieldPath(raw) 10557 if err != nil { 10558 return err 10559 } 10560 fieldMask.Paths = append(fieldMask.Paths, path) 10561 return nil 10562 } 10563 10564 func (fieldMask *Device_Status_DeviceInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo) { 10565 for _, path := range fieldMask.Paths { 10566 val, _ := path.GetSingle(source) 10567 // if val is nil, then field does not exist in source, skip 10568 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 10569 if val != nil { 10570 path.WithIValue(val).SetTo(&target) 10571 } 10572 } 10573 } 10574 10575 func (fieldMask *Device_Status_DeviceInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 10576 fieldMask.Set(target.(*Device_Status_DeviceInfo), source.(*Device_Status_DeviceInfo)) 10577 } 10578 10579 func (fieldMask *Device_Status_DeviceInfo_FieldMask) Project(source *Device_Status_DeviceInfo) *Device_Status_DeviceInfo { 10580 if source == nil { 10581 return nil 10582 } 10583 if fieldMask == nil { 10584 return source 10585 } 10586 result := &Device_Status_DeviceInfo{} 10587 hardwareInformationMask := &Device_Status_DeviceInfo_HardwareInformation_FieldMask{} 10588 wholeHardwareInformationAccepted := false 10589 controlPlaneInterfaceInfoMask := &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask{} 10590 wholeControlPlaneInterfaceInfoAccepted := false 10591 var networkInterfacesMapKeys []string 10592 wholeNetworkInterfacesAccepted := false 10593 10594 for _, p := range fieldMask.Paths { 10595 switch tp := p.(type) { 10596 case *DeviceStatusDeviceInfo_FieldTerminalPath: 10597 switch tp.selector { 10598 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 10599 result.Architecture = source.Architecture 10600 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 10601 result.OperatingSystem = source.OperatingSystem 10602 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 10603 result.KernelVersion = source.KernelVersion 10604 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 10605 result.OsImage = source.OsImage 10606 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 10607 result.ContainerRuntimeVersion = source.ContainerRuntimeVersion 10608 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 10609 result.OsVersion = source.OsVersion 10610 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 10611 result.Driver = source.Driver 10612 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 10613 result.HardwareInformation = source.HardwareInformation 10614 wholeHardwareInformationAccepted = true 10615 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 10616 result.NetworkInterfaces = source.NetworkInterfaces 10617 wholeNetworkInterfacesAccepted = true 10618 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 10619 result.ControlPlaneInterfaceInfo = source.ControlPlaneInterfaceInfo 10620 wholeControlPlaneInterfaceInfoAccepted = true 10621 } 10622 case *DeviceStatusDeviceInfo_FieldSubPath: 10623 switch tp.selector { 10624 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 10625 hardwareInformationMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformation_FieldPath)) 10626 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 10627 controlPlaneInterfaceInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath)) 10628 } 10629 case *DeviceStatusDeviceInfo_FieldPathMap: 10630 switch tp.selector { 10631 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 10632 networkInterfacesMapKeys = append(networkInterfacesMapKeys, tp.key) 10633 } 10634 } 10635 } 10636 if wholeHardwareInformationAccepted == false && len(hardwareInformationMask.Paths) > 0 { 10637 result.HardwareInformation = hardwareInformationMask.Project(source.GetHardwareInformation()) 10638 } 10639 if wholeNetworkInterfacesAccepted == false && len(networkInterfacesMapKeys) > 0 && source.GetNetworkInterfaces() != nil { 10640 copiedMap := map[string]*Device_Status_DeviceInfo_NetworkInterface{} 10641 sourceMap := source.GetNetworkInterfaces() 10642 for _, key := range networkInterfacesMapKeys { 10643 copiedMap[key] = sourceMap[key] 10644 } 10645 result.NetworkInterfaces = copiedMap 10646 } 10647 if wholeControlPlaneInterfaceInfoAccepted == false && len(controlPlaneInterfaceInfoMask.Paths) > 0 { 10648 result.ControlPlaneInterfaceInfo = controlPlaneInterfaceInfoMask.Project(source.GetControlPlaneInterfaceInfo()) 10649 } 10650 return result 10651 } 10652 10653 func (fieldMask *Device_Status_DeviceInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 10654 return fieldMask.Project(source.(*Device_Status_DeviceInfo)) 10655 } 10656 10657 func (fieldMask *Device_Status_DeviceInfo_FieldMask) PathsCount() int { 10658 if fieldMask == nil { 10659 return 0 10660 } 10661 return len(fieldMask.Paths) 10662 } 10663 10664 type Device_Status_NormalizedAddress_FieldMask struct { 10665 Paths []DeviceStatusNormalizedAddress_FieldPath 10666 } 10667 10668 func FullDevice_Status_NormalizedAddress_FieldMask() *Device_Status_NormalizedAddress_FieldMask { 10669 res := &Device_Status_NormalizedAddress_FieldMask{} 10670 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode}) 10671 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode}) 10672 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorContinent}) 10673 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorContinentId}) 10674 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCountry}) 10675 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCountryId}) 10676 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1}) 10677 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id}) 10678 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2}) 10679 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id}) 10680 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3}) 10681 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id}) 10682 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4}) 10683 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id}) 10684 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAddress}) 10685 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates}) 10686 res.Paths = append(res.Paths, &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy}) 10687 return res 10688 } 10689 10690 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) String() string { 10691 if fieldMask == nil { 10692 return "<nil>" 10693 } 10694 pathsStr := make([]string, 0, len(fieldMask.Paths)) 10695 for _, path := range fieldMask.Paths { 10696 pathsStr = append(pathsStr, path.String()) 10697 } 10698 return strings.Join(pathsStr, ", ") 10699 } 10700 10701 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) IsFull() bool { 10702 if fieldMask == nil { 10703 return false 10704 } 10705 presentSelectors := make([]bool, 17) 10706 for _, path := range fieldMask.Paths { 10707 if asFinal, ok := path.(*DeviceStatusNormalizedAddress_FieldTerminalPath); ok { 10708 presentSelectors[int(asFinal.selector)] = true 10709 } 10710 } 10711 for _, flag := range presentSelectors { 10712 if !flag { 10713 return false 10714 } 10715 } 10716 return true 10717 } 10718 10719 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) ProtoReflect() preflect.Message { 10720 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 10721 return ParseDeviceStatusNormalizedAddress_FieldPath(raw) 10722 }) 10723 } 10724 10725 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) ProtoMessage() {} 10726 10727 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) Reset() { 10728 if fieldMask != nil { 10729 fieldMask.Paths = nil 10730 } 10731 } 10732 10733 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) Subtract(other *Device_Status_NormalizedAddress_FieldMask) *Device_Status_NormalizedAddress_FieldMask { 10734 result := &Device_Status_NormalizedAddress_FieldMask{} 10735 removedSelectors := make([]bool, 17) 10736 10737 for _, path := range other.GetPaths() { 10738 switch tp := path.(type) { 10739 case *DeviceStatusNormalizedAddress_FieldTerminalPath: 10740 removedSelectors[int(tp.selector)] = true 10741 } 10742 } 10743 for _, path := range fieldMask.GetPaths() { 10744 if !removedSelectors[int(path.Selector())] { 10745 result.Paths = append(result.Paths, path) 10746 } 10747 } 10748 10749 if len(result.Paths) == 0 { 10750 return nil 10751 } 10752 return result 10753 } 10754 10755 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 10756 return fieldMask.Subtract(other.(*Device_Status_NormalizedAddress_FieldMask)) 10757 } 10758 10759 // FilterInputFields generates copy of field paths with output_only field paths removed 10760 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) FilterInputFields() *Device_Status_NormalizedAddress_FieldMask { 10761 result := &Device_Status_NormalizedAddress_FieldMask{} 10762 result.Paths = append(result.Paths, fieldMask.Paths...) 10763 return result 10764 } 10765 10766 // ToFieldMask is used for proto conversions 10767 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 10768 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10769 for _, path := range fieldMask.Paths { 10770 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 10771 } 10772 return protoFieldMask 10773 } 10774 10775 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 10776 if fieldMask == nil { 10777 return status.Error(codes.Internal, "target field mask is nil") 10778 } 10779 fieldMask.Paths = make([]DeviceStatusNormalizedAddress_FieldPath, 0, len(protoFieldMask.Paths)) 10780 for _, strPath := range protoFieldMask.Paths { 10781 path, err := ParseDeviceStatusNormalizedAddress_FieldPath(strPath) 10782 if err != nil { 10783 return err 10784 } 10785 fieldMask.Paths = append(fieldMask.Paths, path) 10786 } 10787 return nil 10788 } 10789 10790 // implement methods required by customType 10791 func (fieldMask Device_Status_NormalizedAddress_FieldMask) Marshal() ([]byte, error) { 10792 protoFieldMask := fieldMask.ToProtoFieldMask() 10793 return proto.Marshal(protoFieldMask) 10794 } 10795 10796 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) Unmarshal(data []byte) error { 10797 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10798 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 10799 return err 10800 } 10801 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 10802 return err 10803 } 10804 return nil 10805 } 10806 10807 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) Size() int { 10808 return proto.Size(fieldMask.ToProtoFieldMask()) 10809 } 10810 10811 func (fieldMask Device_Status_NormalizedAddress_FieldMask) MarshalJSON() ([]byte, error) { 10812 return json.Marshal(fieldMask.ToProtoFieldMask()) 10813 } 10814 10815 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) UnmarshalJSON(data []byte) error { 10816 protoFieldMask := &googlefieldmaskpb.FieldMask{} 10817 if err := json.Unmarshal(data, protoFieldMask); err != nil { 10818 return err 10819 } 10820 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 10821 return err 10822 } 10823 return nil 10824 } 10825 10826 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) AppendPath(path DeviceStatusNormalizedAddress_FieldPath) { 10827 fieldMask.Paths = append(fieldMask.Paths, path) 10828 } 10829 10830 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 10831 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusNormalizedAddress_FieldPath)) 10832 } 10833 10834 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) GetPaths() []DeviceStatusNormalizedAddress_FieldPath { 10835 if fieldMask == nil { 10836 return nil 10837 } 10838 return fieldMask.Paths 10839 } 10840 10841 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) GetRawPaths() []gotenobject.FieldPath { 10842 if fieldMask == nil { 10843 return nil 10844 } 10845 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 10846 for _, path := range fieldMask.Paths { 10847 rawPaths = append(rawPaths, path) 10848 } 10849 return rawPaths 10850 } 10851 10852 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) SetFromCliFlag(raw string) error { 10853 path, err := ParseDeviceStatusNormalizedAddress_FieldPath(raw) 10854 if err != nil { 10855 return err 10856 } 10857 fieldMask.Paths = append(fieldMask.Paths, path) 10858 return nil 10859 } 10860 10861 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) Set(target, source *Device_Status_NormalizedAddress) { 10862 for _, path := range fieldMask.Paths { 10863 val, _ := path.GetSingle(source) 10864 // if val is nil, then field does not exist in source, skip 10865 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 10866 if val != nil { 10867 path.WithIValue(val).SetTo(&target) 10868 } 10869 } 10870 } 10871 10872 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 10873 fieldMask.Set(target.(*Device_Status_NormalizedAddress), source.(*Device_Status_NormalizedAddress)) 10874 } 10875 10876 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) Project(source *Device_Status_NormalizedAddress) *Device_Status_NormalizedAddress { 10877 if source == nil { 10878 return nil 10879 } 10880 if fieldMask == nil { 10881 return source 10882 } 10883 result := &Device_Status_NormalizedAddress{} 10884 10885 for _, p := range fieldMask.Paths { 10886 switch tp := p.(type) { 10887 case *DeviceStatusNormalizedAddress_FieldTerminalPath: 10888 switch tp.selector { 10889 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 10890 result.PostalCode = source.PostalCode 10891 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 10892 result.CountryCode = source.CountryCode 10893 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 10894 result.Continent = source.Continent 10895 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 10896 result.ContinentId = source.ContinentId 10897 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 10898 result.Country = source.Country 10899 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 10900 result.CountryId = source.CountryId 10901 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 10902 result.AdminArea1 = source.AdminArea1 10903 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 10904 result.AdminArea1Id = source.AdminArea1Id 10905 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 10906 result.AdminArea2 = source.AdminArea2 10907 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 10908 result.AdminArea2Id = source.AdminArea2Id 10909 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 10910 result.AdminArea3 = source.AdminArea3 10911 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 10912 result.AdminArea3Id = source.AdminArea3Id 10913 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 10914 result.AdminArea4 = source.AdminArea4 10915 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 10916 result.AdminArea4Id = source.AdminArea4Id 10917 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 10918 result.Address = source.Address 10919 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 10920 result.Coordinates = source.Coordinates 10921 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 10922 result.Accuracy = source.Accuracy 10923 } 10924 } 10925 } 10926 return result 10927 } 10928 10929 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 10930 return fieldMask.Project(source.(*Device_Status_NormalizedAddress)) 10931 } 10932 10933 func (fieldMask *Device_Status_NormalizedAddress_FieldMask) PathsCount() int { 10934 if fieldMask == nil { 10935 return 0 10936 } 10937 return len(fieldMask.Paths) 10938 } 10939 10940 type Device_Status_DeviceInfo_HardwareInformation_FieldMask struct { 10941 Paths []DeviceStatusDeviceInfoHardwareInformation_FieldPath 10942 } 10943 10944 func FullDevice_Status_DeviceInfo_HardwareInformation_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_FieldMask { 10945 res := &Device_Status_DeviceInfo_HardwareInformation_FieldMask{} 10946 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs}) 10947 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios}) 10948 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem}) 10949 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu}) 10950 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock}) 10951 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork}) 10952 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu}) 10953 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo}) 10954 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo}) 10955 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo}) 10956 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus}) 10957 return res 10958 } 10959 10960 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) String() string { 10961 if fieldMask == nil { 10962 return "<nil>" 10963 } 10964 pathsStr := make([]string, 0, len(fieldMask.Paths)) 10965 for _, path := range fieldMask.Paths { 10966 pathsStr = append(pathsStr, path.String()) 10967 } 10968 return strings.Join(pathsStr, ", ") 10969 } 10970 10971 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) IsFull() bool { 10972 if fieldMask == nil { 10973 return false 10974 } 10975 presentSelectors := make([]bool, 11) 10976 for _, path := range fieldMask.Paths { 10977 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath); ok { 10978 presentSelectors[int(asFinal.selector)] = true 10979 } 10980 } 10981 for _, flag := range presentSelectors { 10982 if !flag { 10983 return false 10984 } 10985 } 10986 return true 10987 } 10988 10989 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) ProtoReflect() preflect.Message { 10990 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 10991 return ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(raw) 10992 }) 10993 } 10994 10995 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) ProtoMessage() {} 10996 10997 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) Reset() { 10998 if fieldMask != nil { 10999 fieldMask.Paths = nil 11000 } 11001 } 11002 11003 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_FieldMask { 11004 result := &Device_Status_DeviceInfo_HardwareInformation_FieldMask{} 11005 removedSelectors := make([]bool, 11) 11006 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector]gotenobject.FieldMask{ 11007 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: &Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask{}, 11008 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: &Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask{}, 11009 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: &Device_Status_DeviceInfo_HardwareInformation_System_FieldMask{}, 11010 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: &Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask{}, 11011 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: &Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask{}, 11012 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: &Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask{}, 11013 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: &Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask{}, 11014 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask{}, 11015 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask{}, 11016 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask{}, 11017 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask{}, 11018 } 11019 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector]gotenobject.FieldMask{ 11020 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: &Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask{}, 11021 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: &Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask{}, 11022 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: &Device_Status_DeviceInfo_HardwareInformation_System_FieldMask{}, 11023 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: &Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask{}, 11024 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: &Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask{}, 11025 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: &Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask{}, 11026 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: &Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask{}, 11027 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask{}, 11028 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask{}, 11029 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask{}, 11030 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask{}, 11031 } 11032 11033 for _, path := range other.GetPaths() { 11034 switch tp := path.(type) { 11035 case *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: 11036 removedSelectors[int(tp.selector)] = true 11037 case *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath: 11038 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 11039 } 11040 } 11041 for _, path := range fieldMask.GetPaths() { 11042 if !removedSelectors[int(path.Selector())] { 11043 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 11044 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath); ok { 11045 switch tp.selector { 11046 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 11047 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs] = FullDevice_Status_DeviceInfo_HardwareInformation_OS_FieldMask() 11048 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 11049 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios] = FullDevice_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask() 11050 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 11051 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem] = FullDevice_Status_DeviceInfo_HardwareInformation_System_FieldMask() 11052 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 11053 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu] = FullDevice_Status_DeviceInfo_HardwareInformation_CPU_FieldMask() 11054 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 11055 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock] = FullDevice_Status_DeviceInfo_HardwareInformation_Block_FieldMask() 11056 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 11057 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork] = FullDevice_Status_DeviceInfo_HardwareInformation_Network_FieldMask() 11058 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 11059 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu] = FullDevice_Status_DeviceInfo_HardwareInformation_GPU_FieldMask() 11060 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 11061 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo] = FullDevice_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask() 11062 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 11063 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo] = FullDevice_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask() 11064 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 11065 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo] = FullDevice_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask() 11066 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 11067 mySubMasks[DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask() 11068 } 11069 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformation_FieldSubPath); ok { 11070 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 11071 } 11072 } else { 11073 result.Paths = append(result.Paths, path) 11074 } 11075 } 11076 } 11077 for selector, mySubMask := range mySubMasks { 11078 if mySubMask.PathsCount() > 0 { 11079 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 11080 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: selector, subPath: allowedPath}) 11081 } 11082 } 11083 } 11084 11085 if len(result.Paths) == 0 { 11086 return nil 11087 } 11088 return result 11089 } 11090 11091 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 11092 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_FieldMask)) 11093 } 11094 11095 // FilterInputFields generates copy of field paths with output_only field paths removed 11096 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_FieldMask { 11097 result := &Device_Status_DeviceInfo_HardwareInformation_FieldMask{} 11098 result.Paths = append(result.Paths, fieldMask.Paths...) 11099 return result 11100 } 11101 11102 // ToFieldMask is used for proto conversions 11103 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 11104 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11105 for _, path := range fieldMask.Paths { 11106 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 11107 } 11108 return protoFieldMask 11109 } 11110 11111 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 11112 if fieldMask == nil { 11113 return status.Error(codes.Internal, "target field mask is nil") 11114 } 11115 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformation_FieldPath, 0, len(protoFieldMask.Paths)) 11116 for _, strPath := range protoFieldMask.Paths { 11117 path, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(strPath) 11118 if err != nil { 11119 return err 11120 } 11121 fieldMask.Paths = append(fieldMask.Paths, path) 11122 } 11123 return nil 11124 } 11125 11126 // implement methods required by customType 11127 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_FieldMask) Marshal() ([]byte, error) { 11128 protoFieldMask := fieldMask.ToProtoFieldMask() 11129 return proto.Marshal(protoFieldMask) 11130 } 11131 11132 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) Unmarshal(data []byte) error { 11133 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11134 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 11135 return err 11136 } 11137 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 11138 return err 11139 } 11140 return nil 11141 } 11142 11143 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) Size() int { 11144 return proto.Size(fieldMask.ToProtoFieldMask()) 11145 } 11146 11147 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_FieldMask) MarshalJSON() ([]byte, error) { 11148 return json.Marshal(fieldMask.ToProtoFieldMask()) 11149 } 11150 11151 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) UnmarshalJSON(data []byte) error { 11152 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11153 if err := json.Unmarshal(data, protoFieldMask); err != nil { 11154 return err 11155 } 11156 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 11157 return err 11158 } 11159 return nil 11160 } 11161 11162 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformation_FieldPath) { 11163 fieldMask.Paths = append(fieldMask.Paths, path) 11164 } 11165 11166 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 11167 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformation_FieldPath)) 11168 } 11169 11170 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformation_FieldPath { 11171 if fieldMask == nil { 11172 return nil 11173 } 11174 return fieldMask.Paths 11175 } 11176 11177 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) GetRawPaths() []gotenobject.FieldPath { 11178 if fieldMask == nil { 11179 return nil 11180 } 11181 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 11182 for _, path := range fieldMask.Paths { 11183 rawPaths = append(rawPaths, path) 11184 } 11185 return rawPaths 11186 } 11187 11188 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) SetFromCliFlag(raw string) error { 11189 path, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(raw) 11190 if err != nil { 11191 return err 11192 } 11193 fieldMask.Paths = append(fieldMask.Paths, path) 11194 return nil 11195 } 11196 11197 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation) { 11198 for _, path := range fieldMask.Paths { 11199 val, _ := path.GetSingle(source) 11200 // if val is nil, then field does not exist in source, skip 11201 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 11202 if val != nil { 11203 path.WithIValue(val).SetTo(&target) 11204 } 11205 } 11206 } 11207 11208 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 11209 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation), source.(*Device_Status_DeviceInfo_HardwareInformation)) 11210 } 11211 11212 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation) *Device_Status_DeviceInfo_HardwareInformation { 11213 if source == nil { 11214 return nil 11215 } 11216 if fieldMask == nil { 11217 return source 11218 } 11219 result := &Device_Status_DeviceInfo_HardwareInformation{} 11220 osMask := &Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask{} 11221 wholeOsAccepted := false 11222 biosMask := &Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask{} 11223 wholeBiosAccepted := false 11224 systemMask := &Device_Status_DeviceInfo_HardwareInformation_System_FieldMask{} 11225 wholeSystemAccepted := false 11226 cpuMask := &Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask{} 11227 wholeCpuAccepted := false 11228 blockMask := &Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask{} 11229 wholeBlockAccepted := false 11230 networkMask := &Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask{} 11231 wholeNetworkAccepted := false 11232 gpuMask := &Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask{} 11233 wholeGpuAccepted := false 11234 memoryInfoMask := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask{} 11235 wholeMemoryInfoAccepted := false 11236 hailoInfoMask := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask{} 11237 wholeHailoInfoAccepted := false 11238 nvidiaInfoMask := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask{} 11239 wholeNvidiaInfoAccepted := false 11240 modemStatusMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask{} 11241 wholeModemStatusAccepted := false 11242 11243 for _, p := range fieldMask.Paths { 11244 switch tp := p.(type) { 11245 case *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: 11246 switch tp.selector { 11247 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 11248 result.Os = source.Os 11249 wholeOsAccepted = true 11250 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 11251 result.Bios = source.Bios 11252 wholeBiosAccepted = true 11253 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 11254 result.System = source.System 11255 wholeSystemAccepted = true 11256 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 11257 result.Cpu = source.Cpu 11258 wholeCpuAccepted = true 11259 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 11260 result.Block = source.Block 11261 wholeBlockAccepted = true 11262 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 11263 result.Network = source.Network 11264 wholeNetworkAccepted = true 11265 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 11266 result.Gpu = source.Gpu 11267 wholeGpuAccepted = true 11268 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 11269 result.MemoryInfo = source.MemoryInfo 11270 wholeMemoryInfoAccepted = true 11271 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 11272 result.HailoInfo = source.HailoInfo 11273 wholeHailoInfoAccepted = true 11274 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 11275 result.NvidiaInfo = source.NvidiaInfo 11276 wholeNvidiaInfoAccepted = true 11277 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 11278 result.ModemStatus = source.ModemStatus 11279 wholeModemStatusAccepted = true 11280 } 11281 case *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath: 11282 switch tp.selector { 11283 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 11284 osMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPath)) 11285 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 11286 biosMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath)) 11287 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 11288 systemMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath)) 11289 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 11290 cpuMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath)) 11291 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 11292 blockMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath)) 11293 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 11294 networkMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath)) 11295 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 11296 gpuMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath)) 11297 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 11298 memoryInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath)) 11299 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 11300 hailoInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath)) 11301 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 11302 nvidiaInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath)) 11303 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 11304 modemStatusMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath)) 11305 } 11306 } 11307 } 11308 if wholeOsAccepted == false && len(osMask.Paths) > 0 { 11309 result.Os = osMask.Project(source.GetOs()) 11310 } 11311 if wholeBiosAccepted == false && len(biosMask.Paths) > 0 { 11312 result.Bios = biosMask.Project(source.GetBios()) 11313 } 11314 if wholeSystemAccepted == false && len(systemMask.Paths) > 0 { 11315 result.System = systemMask.Project(source.GetSystem()) 11316 } 11317 if wholeCpuAccepted == false && len(cpuMask.Paths) > 0 { 11318 result.Cpu = cpuMask.Project(source.GetCpu()) 11319 } 11320 if wholeBlockAccepted == false && len(blockMask.Paths) > 0 { 11321 result.Block = blockMask.Project(source.GetBlock()) 11322 } 11323 if wholeNetworkAccepted == false && len(networkMask.Paths) > 0 { 11324 result.Network = networkMask.Project(source.GetNetwork()) 11325 } 11326 if wholeGpuAccepted == false && len(gpuMask.Paths) > 0 { 11327 result.Gpu = gpuMask.Project(source.GetGpu()) 11328 } 11329 if wholeMemoryInfoAccepted == false && len(memoryInfoMask.Paths) > 0 { 11330 result.MemoryInfo = memoryInfoMask.Project(source.GetMemoryInfo()) 11331 } 11332 if wholeHailoInfoAccepted == false && len(hailoInfoMask.Paths) > 0 { 11333 result.HailoInfo = hailoInfoMask.Project(source.GetHailoInfo()) 11334 } 11335 if wholeNvidiaInfoAccepted == false && len(nvidiaInfoMask.Paths) > 0 { 11336 result.NvidiaInfo = nvidiaInfoMask.Project(source.GetNvidiaInfo()) 11337 } 11338 if wholeModemStatusAccepted == false && len(modemStatusMask.Paths) > 0 { 11339 for _, sourceItem := range source.GetModemStatus() { 11340 result.ModemStatus = append(result.ModemStatus, modemStatusMask.Project(sourceItem)) 11341 } 11342 } 11343 return result 11344 } 11345 11346 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 11347 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation)) 11348 } 11349 11350 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_FieldMask) PathsCount() int { 11351 if fieldMask == nil { 11352 return 0 11353 } 11354 return len(fieldMask.Paths) 11355 } 11356 11357 type Device_Status_DeviceInfo_NetworkInterface_FieldMask struct { 11358 Paths []DeviceStatusDeviceInfoNetworkInterface_FieldPath 11359 } 11360 11361 func FullDevice_Status_DeviceInfo_NetworkInterface_FieldMask() *Device_Status_DeviceInfo_NetworkInterface_FieldMask { 11362 res := &Device_Status_DeviceInfo_NetworkInterface_FieldMask{} 11363 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName}) 11364 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4}) 11365 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4}) 11366 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6}) 11367 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6}) 11368 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo}) 11369 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier}) 11370 return res 11371 } 11372 11373 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) String() string { 11374 if fieldMask == nil { 11375 return "<nil>" 11376 } 11377 pathsStr := make([]string, 0, len(fieldMask.Paths)) 11378 for _, path := range fieldMask.Paths { 11379 pathsStr = append(pathsStr, path.String()) 11380 } 11381 return strings.Join(pathsStr, ", ") 11382 } 11383 11384 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) IsFull() bool { 11385 if fieldMask == nil { 11386 return false 11387 } 11388 presentSelectors := make([]bool, 7) 11389 for _, path := range fieldMask.Paths { 11390 if asFinal, ok := path.(*DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath); ok { 11391 presentSelectors[int(asFinal.selector)] = true 11392 } 11393 } 11394 for _, flag := range presentSelectors { 11395 if !flag { 11396 return false 11397 } 11398 } 11399 return true 11400 } 11401 11402 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) ProtoReflect() preflect.Message { 11403 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 11404 return ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(raw) 11405 }) 11406 } 11407 11408 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) ProtoMessage() {} 11409 11410 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) Reset() { 11411 if fieldMask != nil { 11412 fieldMask.Paths = nil 11413 } 11414 } 11415 11416 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) Subtract(other *Device_Status_DeviceInfo_NetworkInterface_FieldMask) *Device_Status_DeviceInfo_NetworkInterface_FieldMask { 11417 result := &Device_Status_DeviceInfo_NetworkInterface_FieldMask{} 11418 removedSelectors := make([]bool, 7) 11419 otherSubMasks := map[DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector]gotenobject.FieldMask{ 11420 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: &Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask{}, 11421 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: &Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask{}, 11422 } 11423 mySubMasks := map[DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector]gotenobject.FieldMask{ 11424 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: &Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask{}, 11425 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: &Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask{}, 11426 } 11427 11428 for _, path := range other.GetPaths() { 11429 switch tp := path.(type) { 11430 case *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: 11431 removedSelectors[int(tp.selector)] = true 11432 case *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath: 11433 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 11434 } 11435 } 11436 for _, path := range fieldMask.GetPaths() { 11437 if !removedSelectors[int(path.Selector())] { 11438 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 11439 if tp, ok := path.(*DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath); ok { 11440 switch tp.selector { 11441 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 11442 mySubMasks[DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo] = FullDevice_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask() 11443 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 11444 mySubMasks[DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier] = FullDevice_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask() 11445 } 11446 } else if tp, ok := path.(*DeviceStatusDeviceInfoNetworkInterface_FieldSubPath); ok { 11447 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 11448 } 11449 } else { 11450 result.Paths = append(result.Paths, path) 11451 } 11452 } 11453 } 11454 for selector, mySubMask := range mySubMasks { 11455 if mySubMask.PathsCount() > 0 { 11456 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 11457 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoNetworkInterface_FieldSubPath{selector: selector, subPath: allowedPath}) 11458 } 11459 } 11460 } 11461 11462 if len(result.Paths) == 0 { 11463 return nil 11464 } 11465 return result 11466 } 11467 11468 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 11469 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_NetworkInterface_FieldMask)) 11470 } 11471 11472 // FilterInputFields generates copy of field paths with output_only field paths removed 11473 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_NetworkInterface_FieldMask { 11474 result := &Device_Status_DeviceInfo_NetworkInterface_FieldMask{} 11475 result.Paths = append(result.Paths, fieldMask.Paths...) 11476 return result 11477 } 11478 11479 // ToFieldMask is used for proto conversions 11480 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 11481 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11482 for _, path := range fieldMask.Paths { 11483 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 11484 } 11485 return protoFieldMask 11486 } 11487 11488 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 11489 if fieldMask == nil { 11490 return status.Error(codes.Internal, "target field mask is nil") 11491 } 11492 fieldMask.Paths = make([]DeviceStatusDeviceInfoNetworkInterface_FieldPath, 0, len(protoFieldMask.Paths)) 11493 for _, strPath := range protoFieldMask.Paths { 11494 path, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(strPath) 11495 if err != nil { 11496 return err 11497 } 11498 fieldMask.Paths = append(fieldMask.Paths, path) 11499 } 11500 return nil 11501 } 11502 11503 // implement methods required by customType 11504 func (fieldMask Device_Status_DeviceInfo_NetworkInterface_FieldMask) Marshal() ([]byte, error) { 11505 protoFieldMask := fieldMask.ToProtoFieldMask() 11506 return proto.Marshal(protoFieldMask) 11507 } 11508 11509 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) Unmarshal(data []byte) error { 11510 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11511 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 11512 return err 11513 } 11514 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 11515 return err 11516 } 11517 return nil 11518 } 11519 11520 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) Size() int { 11521 return proto.Size(fieldMask.ToProtoFieldMask()) 11522 } 11523 11524 func (fieldMask Device_Status_DeviceInfo_NetworkInterface_FieldMask) MarshalJSON() ([]byte, error) { 11525 return json.Marshal(fieldMask.ToProtoFieldMask()) 11526 } 11527 11528 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) UnmarshalJSON(data []byte) error { 11529 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11530 if err := json.Unmarshal(data, protoFieldMask); err != nil { 11531 return err 11532 } 11533 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 11534 return err 11535 } 11536 return nil 11537 } 11538 11539 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) AppendPath(path DeviceStatusDeviceInfoNetworkInterface_FieldPath) { 11540 fieldMask.Paths = append(fieldMask.Paths, path) 11541 } 11542 11543 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 11544 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoNetworkInterface_FieldPath)) 11545 } 11546 11547 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) GetPaths() []DeviceStatusDeviceInfoNetworkInterface_FieldPath { 11548 if fieldMask == nil { 11549 return nil 11550 } 11551 return fieldMask.Paths 11552 } 11553 11554 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) GetRawPaths() []gotenobject.FieldPath { 11555 if fieldMask == nil { 11556 return nil 11557 } 11558 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 11559 for _, path := range fieldMask.Paths { 11560 rawPaths = append(rawPaths, path) 11561 } 11562 return rawPaths 11563 } 11564 11565 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) SetFromCliFlag(raw string) error { 11566 path, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(raw) 11567 if err != nil { 11568 return err 11569 } 11570 fieldMask.Paths = append(fieldMask.Paths, path) 11571 return nil 11572 } 11573 11574 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) Set(target, source *Device_Status_DeviceInfo_NetworkInterface) { 11575 for _, path := range fieldMask.Paths { 11576 val, _ := path.GetSingle(source) 11577 // if val is nil, then field does not exist in source, skip 11578 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 11579 if val != nil { 11580 path.WithIValue(val).SetTo(&target) 11581 } 11582 } 11583 } 11584 11585 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 11586 fieldMask.Set(target.(*Device_Status_DeviceInfo_NetworkInterface), source.(*Device_Status_DeviceInfo_NetworkInterface)) 11587 } 11588 11589 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) Project(source *Device_Status_DeviceInfo_NetworkInterface) *Device_Status_DeviceInfo_NetworkInterface { 11590 if source == nil { 11591 return nil 11592 } 11593 if fieldMask == nil { 11594 return source 11595 } 11596 result := &Device_Status_DeviceInfo_NetworkInterface{} 11597 asInfoMask := &Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask{} 11598 wholeAsInfoAccepted := false 11599 carrierMask := &Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask{} 11600 wholeCarrierAccepted := false 11601 11602 for _, p := range fieldMask.Paths { 11603 switch tp := p.(type) { 11604 case *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: 11605 switch tp.selector { 11606 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 11607 result.InterfaceName = source.InterfaceName 11608 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 11609 result.IpAddressV4 = source.IpAddressV4 11610 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 11611 result.ExternalIpAddressV4 = source.ExternalIpAddressV4 11612 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 11613 result.IpAddressV6 = source.IpAddressV6 11614 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 11615 result.ExternalIpAddressV6 = source.ExternalIpAddressV6 11616 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 11617 result.AsInfo = source.AsInfo 11618 wholeAsInfoAccepted = true 11619 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 11620 result.Carrier = source.Carrier 11621 wholeCarrierAccepted = true 11622 } 11623 case *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath: 11624 switch tp.selector { 11625 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 11626 asInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath)) 11627 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 11628 carrierMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath)) 11629 } 11630 } 11631 } 11632 if wholeAsInfoAccepted == false && len(asInfoMask.Paths) > 0 { 11633 result.AsInfo = asInfoMask.Project(source.GetAsInfo()) 11634 } 11635 if wholeCarrierAccepted == false && len(carrierMask.Paths) > 0 { 11636 result.Carrier = carrierMask.Project(source.GetCarrier()) 11637 } 11638 return result 11639 } 11640 11641 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 11642 return fieldMask.Project(source.(*Device_Status_DeviceInfo_NetworkInterface)) 11643 } 11644 11645 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_FieldMask) PathsCount() int { 11646 if fieldMask == nil { 11647 return 0 11648 } 11649 return len(fieldMask.Paths) 11650 } 11651 11652 type Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask struct { 11653 Paths []DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath 11654 } 11655 11656 func FullDevice_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask() *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask { 11657 res := &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask{} 11658 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface}) 11659 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy}) 11660 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback}) 11661 return res 11662 } 11663 11664 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) String() string { 11665 if fieldMask == nil { 11666 return "<nil>" 11667 } 11668 pathsStr := make([]string, 0, len(fieldMask.Paths)) 11669 for _, path := range fieldMask.Paths { 11670 pathsStr = append(pathsStr, path.String()) 11671 } 11672 return strings.Join(pathsStr, ", ") 11673 } 11674 11675 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) IsFull() bool { 11676 if fieldMask == nil { 11677 return false 11678 } 11679 presentSelectors := make([]bool, 3) 11680 for _, path := range fieldMask.Paths { 11681 if asFinal, ok := path.(*DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath); ok { 11682 presentSelectors[int(asFinal.selector)] = true 11683 } 11684 } 11685 for _, flag := range presentSelectors { 11686 if !flag { 11687 return false 11688 } 11689 } 11690 return true 11691 } 11692 11693 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) ProtoReflect() preflect.Message { 11694 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 11695 return ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(raw) 11696 }) 11697 } 11698 11699 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) ProtoMessage() {} 11700 11701 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Reset() { 11702 if fieldMask != nil { 11703 fieldMask.Paths = nil 11704 } 11705 } 11706 11707 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask { 11708 result := &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask{} 11709 removedSelectors := make([]bool, 3) 11710 11711 for _, path := range other.GetPaths() { 11712 switch tp := path.(type) { 11713 case *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: 11714 removedSelectors[int(tp.selector)] = true 11715 } 11716 } 11717 for _, path := range fieldMask.GetPaths() { 11718 if !removedSelectors[int(path.Selector())] { 11719 result.Paths = append(result.Paths, path) 11720 } 11721 } 11722 11723 if len(result.Paths) == 0 { 11724 return nil 11725 } 11726 return result 11727 } 11728 11729 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 11730 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask)) 11731 } 11732 11733 // FilterInputFields generates copy of field paths with output_only field paths removed 11734 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask { 11735 result := &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask{} 11736 result.Paths = append(result.Paths, fieldMask.Paths...) 11737 return result 11738 } 11739 11740 // ToFieldMask is used for proto conversions 11741 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 11742 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11743 for _, path := range fieldMask.Paths { 11744 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 11745 } 11746 return protoFieldMask 11747 } 11748 11749 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 11750 if fieldMask == nil { 11751 return status.Error(codes.Internal, "target field mask is nil") 11752 } 11753 fieldMask.Paths = make([]DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath, 0, len(protoFieldMask.Paths)) 11754 for _, strPath := range protoFieldMask.Paths { 11755 path, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(strPath) 11756 if err != nil { 11757 return err 11758 } 11759 fieldMask.Paths = append(fieldMask.Paths, path) 11760 } 11761 return nil 11762 } 11763 11764 // implement methods required by customType 11765 func (fieldMask Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Marshal() ([]byte, error) { 11766 protoFieldMask := fieldMask.ToProtoFieldMask() 11767 return proto.Marshal(protoFieldMask) 11768 } 11769 11770 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Unmarshal(data []byte) error { 11771 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11772 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 11773 return err 11774 } 11775 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 11776 return err 11777 } 11778 return nil 11779 } 11780 11781 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Size() int { 11782 return proto.Size(fieldMask.ToProtoFieldMask()) 11783 } 11784 11785 func (fieldMask Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) MarshalJSON() ([]byte, error) { 11786 return json.Marshal(fieldMask.ToProtoFieldMask()) 11787 } 11788 11789 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) UnmarshalJSON(data []byte) error { 11790 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11791 if err := json.Unmarshal(data, protoFieldMask); err != nil { 11792 return err 11793 } 11794 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 11795 return err 11796 } 11797 return nil 11798 } 11799 11800 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath) { 11801 fieldMask.Paths = append(fieldMask.Paths, path) 11802 } 11803 11804 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 11805 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath)) 11806 } 11807 11808 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath { 11809 if fieldMask == nil { 11810 return nil 11811 } 11812 return fieldMask.Paths 11813 } 11814 11815 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 11816 if fieldMask == nil { 11817 return nil 11818 } 11819 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 11820 for _, path := range fieldMask.Paths { 11821 rawPaths = append(rawPaths, path) 11822 } 11823 return rawPaths 11824 } 11825 11826 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) SetFromCliFlag(raw string) error { 11827 path, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(raw) 11828 if err != nil { 11829 return err 11830 } 11831 fieldMask.Paths = append(fieldMask.Paths, path) 11832 return nil 11833 } 11834 11835 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) { 11836 for _, path := range fieldMask.Paths { 11837 val, _ := path.GetSingle(source) 11838 // if val is nil, then field does not exist in source, skip 11839 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 11840 if val != nil { 11841 path.WithIValue(val).SetTo(&target) 11842 } 11843 } 11844 } 11845 11846 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 11847 fieldMask.Set(target.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo), source.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 11848 } 11849 11850 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) Project(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo { 11851 if source == nil { 11852 return nil 11853 } 11854 if fieldMask == nil { 11855 return source 11856 } 11857 result := &Device_Status_DeviceInfo_ControlPlaneInterfaceInfo{} 11858 11859 for _, p := range fieldMask.Paths { 11860 switch tp := p.(type) { 11861 case *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: 11862 switch tp.selector { 11863 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 11864 result.ActiveControlPlaneInterface = source.ActiveControlPlaneInterface 11865 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 11866 result.UsesProxy = source.UsesProxy 11867 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 11868 result.IsFallback = source.IsFallback 11869 } 11870 } 11871 } 11872 return result 11873 } 11874 11875 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 11876 return fieldMask.Project(source.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 11877 } 11878 11879 func (fieldMask *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo_FieldMask) PathsCount() int { 11880 if fieldMask == nil { 11881 return 0 11882 } 11883 return len(fieldMask.Paths) 11884 } 11885 11886 type Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask struct { 11887 Paths []DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath 11888 } 11889 11890 func FullDevice_Status_DeviceInfo_HardwareInformation_Capability_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask { 11891 res := &Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask{} 11892 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName}) 11893 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription}) 11894 return res 11895 } 11896 11897 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) String() string { 11898 if fieldMask == nil { 11899 return "<nil>" 11900 } 11901 pathsStr := make([]string, 0, len(fieldMask.Paths)) 11902 for _, path := range fieldMask.Paths { 11903 pathsStr = append(pathsStr, path.String()) 11904 } 11905 return strings.Join(pathsStr, ", ") 11906 } 11907 11908 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) IsFull() bool { 11909 if fieldMask == nil { 11910 return false 11911 } 11912 presentSelectors := make([]bool, 2) 11913 for _, path := range fieldMask.Paths { 11914 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath); ok { 11915 presentSelectors[int(asFinal.selector)] = true 11916 } 11917 } 11918 for _, flag := range presentSelectors { 11919 if !flag { 11920 return false 11921 } 11922 } 11923 return true 11924 } 11925 11926 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) ProtoReflect() preflect.Message { 11927 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 11928 return ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(raw) 11929 }) 11930 } 11931 11932 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) ProtoMessage() {} 11933 11934 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Reset() { 11935 if fieldMask != nil { 11936 fieldMask.Paths = nil 11937 } 11938 } 11939 11940 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask { 11941 result := &Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask{} 11942 removedSelectors := make([]bool, 2) 11943 11944 for _, path := range other.GetPaths() { 11945 switch tp := path.(type) { 11946 case *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: 11947 removedSelectors[int(tp.selector)] = true 11948 } 11949 } 11950 for _, path := range fieldMask.GetPaths() { 11951 if !removedSelectors[int(path.Selector())] { 11952 result.Paths = append(result.Paths, path) 11953 } 11954 } 11955 11956 if len(result.Paths) == 0 { 11957 return nil 11958 } 11959 return result 11960 } 11961 11962 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 11963 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask)) 11964 } 11965 11966 // FilterInputFields generates copy of field paths with output_only field paths removed 11967 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask { 11968 result := &Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask{} 11969 result.Paths = append(result.Paths, fieldMask.Paths...) 11970 return result 11971 } 11972 11973 // ToFieldMask is used for proto conversions 11974 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 11975 protoFieldMask := &googlefieldmaskpb.FieldMask{} 11976 for _, path := range fieldMask.Paths { 11977 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 11978 } 11979 return protoFieldMask 11980 } 11981 11982 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 11983 if fieldMask == nil { 11984 return status.Error(codes.Internal, "target field mask is nil") 11985 } 11986 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath, 0, len(protoFieldMask.Paths)) 11987 for _, strPath := range protoFieldMask.Paths { 11988 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(strPath) 11989 if err != nil { 11990 return err 11991 } 11992 fieldMask.Paths = append(fieldMask.Paths, path) 11993 } 11994 return nil 11995 } 11996 11997 // implement methods required by customType 11998 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Marshal() ([]byte, error) { 11999 protoFieldMask := fieldMask.ToProtoFieldMask() 12000 return proto.Marshal(protoFieldMask) 12001 } 12002 12003 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Unmarshal(data []byte) error { 12004 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12005 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 12006 return err 12007 } 12008 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12009 return err 12010 } 12011 return nil 12012 } 12013 12014 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Size() int { 12015 return proto.Size(fieldMask.ToProtoFieldMask()) 12016 } 12017 12018 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) MarshalJSON() ([]byte, error) { 12019 return json.Marshal(fieldMask.ToProtoFieldMask()) 12020 } 12021 12022 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) UnmarshalJSON(data []byte) error { 12023 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12024 if err := json.Unmarshal(data, protoFieldMask); err != nil { 12025 return err 12026 } 12027 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12028 return err 12029 } 12030 return nil 12031 } 12032 12033 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath) { 12034 fieldMask.Paths = append(fieldMask.Paths, path) 12035 } 12036 12037 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 12038 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath)) 12039 } 12040 12041 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath { 12042 if fieldMask == nil { 12043 return nil 12044 } 12045 return fieldMask.Paths 12046 } 12047 12048 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) GetRawPaths() []gotenobject.FieldPath { 12049 if fieldMask == nil { 12050 return nil 12051 } 12052 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 12053 for _, path := range fieldMask.Paths { 12054 rawPaths = append(rawPaths, path) 12055 } 12056 return rawPaths 12057 } 12058 12059 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) SetFromCliFlag(raw string) error { 12060 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(raw) 12061 if err != nil { 12062 return err 12063 } 12064 fieldMask.Paths = append(fieldMask.Paths, path) 12065 return nil 12066 } 12067 12068 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_Capability) { 12069 for _, path := range fieldMask.Paths { 12070 val, _ := path.GetSingle(source) 12071 // if val is nil, then field does not exist in source, skip 12072 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 12073 if val != nil { 12074 path.WithIValue(val).SetTo(&target) 12075 } 12076 } 12077 } 12078 12079 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 12080 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_Capability), source.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 12081 } 12082 12083 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_Capability) *Device_Status_DeviceInfo_HardwareInformation_Capability { 12084 if source == nil { 12085 return nil 12086 } 12087 if fieldMask == nil { 12088 return source 12089 } 12090 result := &Device_Status_DeviceInfo_HardwareInformation_Capability{} 12091 12092 for _, p := range fieldMask.Paths { 12093 switch tp := p.(type) { 12094 case *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: 12095 switch tp.selector { 12096 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 12097 result.Name = source.Name 12098 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 12099 result.Description = source.Description 12100 } 12101 } 12102 } 12103 return result 12104 } 12105 12106 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 12107 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 12108 } 12109 12110 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask) PathsCount() int { 12111 if fieldMask == nil { 12112 return 0 12113 } 12114 return len(fieldMask.Paths) 12115 } 12116 12117 type Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask struct { 12118 Paths []DeviceStatusDeviceInfoHardwareInformationOS_FieldPath 12119 } 12120 12121 func FullDevice_Status_DeviceInfo_HardwareInformation_OS_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask { 12122 res := &Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask{} 12123 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem}) 12124 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion}) 12125 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage}) 12126 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion}) 12127 return res 12128 } 12129 12130 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) String() string { 12131 if fieldMask == nil { 12132 return "<nil>" 12133 } 12134 pathsStr := make([]string, 0, len(fieldMask.Paths)) 12135 for _, path := range fieldMask.Paths { 12136 pathsStr = append(pathsStr, path.String()) 12137 } 12138 return strings.Join(pathsStr, ", ") 12139 } 12140 12141 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) IsFull() bool { 12142 if fieldMask == nil { 12143 return false 12144 } 12145 presentSelectors := make([]bool, 4) 12146 for _, path := range fieldMask.Paths { 12147 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath); ok { 12148 presentSelectors[int(asFinal.selector)] = true 12149 } 12150 } 12151 for _, flag := range presentSelectors { 12152 if !flag { 12153 return false 12154 } 12155 } 12156 return true 12157 } 12158 12159 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) ProtoReflect() preflect.Message { 12160 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 12161 return ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(raw) 12162 }) 12163 } 12164 12165 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) ProtoMessage() {} 12166 12167 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Reset() { 12168 if fieldMask != nil { 12169 fieldMask.Paths = nil 12170 } 12171 } 12172 12173 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask { 12174 result := &Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask{} 12175 removedSelectors := make([]bool, 4) 12176 12177 for _, path := range other.GetPaths() { 12178 switch tp := path.(type) { 12179 case *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: 12180 removedSelectors[int(tp.selector)] = true 12181 } 12182 } 12183 for _, path := range fieldMask.GetPaths() { 12184 if !removedSelectors[int(path.Selector())] { 12185 result.Paths = append(result.Paths, path) 12186 } 12187 } 12188 12189 if len(result.Paths) == 0 { 12190 return nil 12191 } 12192 return result 12193 } 12194 12195 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 12196 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask)) 12197 } 12198 12199 // FilterInputFields generates copy of field paths with output_only field paths removed 12200 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask { 12201 result := &Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask{} 12202 result.Paths = append(result.Paths, fieldMask.Paths...) 12203 return result 12204 } 12205 12206 // ToFieldMask is used for proto conversions 12207 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 12208 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12209 for _, path := range fieldMask.Paths { 12210 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 12211 } 12212 return protoFieldMask 12213 } 12214 12215 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 12216 if fieldMask == nil { 12217 return status.Error(codes.Internal, "target field mask is nil") 12218 } 12219 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationOS_FieldPath, 0, len(protoFieldMask.Paths)) 12220 for _, strPath := range protoFieldMask.Paths { 12221 path, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(strPath) 12222 if err != nil { 12223 return err 12224 } 12225 fieldMask.Paths = append(fieldMask.Paths, path) 12226 } 12227 return nil 12228 } 12229 12230 // implement methods required by customType 12231 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Marshal() ([]byte, error) { 12232 protoFieldMask := fieldMask.ToProtoFieldMask() 12233 return proto.Marshal(protoFieldMask) 12234 } 12235 12236 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Unmarshal(data []byte) error { 12237 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12238 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 12239 return err 12240 } 12241 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12242 return err 12243 } 12244 return nil 12245 } 12246 12247 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Size() int { 12248 return proto.Size(fieldMask.ToProtoFieldMask()) 12249 } 12250 12251 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) MarshalJSON() ([]byte, error) { 12252 return json.Marshal(fieldMask.ToProtoFieldMask()) 12253 } 12254 12255 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) UnmarshalJSON(data []byte) error { 12256 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12257 if err := json.Unmarshal(data, protoFieldMask); err != nil { 12258 return err 12259 } 12260 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12261 return err 12262 } 12263 return nil 12264 } 12265 12266 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationOS_FieldPath) { 12267 fieldMask.Paths = append(fieldMask.Paths, path) 12268 } 12269 12270 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 12271 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPath)) 12272 } 12273 12274 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationOS_FieldPath { 12275 if fieldMask == nil { 12276 return nil 12277 } 12278 return fieldMask.Paths 12279 } 12280 12281 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) GetRawPaths() []gotenobject.FieldPath { 12282 if fieldMask == nil { 12283 return nil 12284 } 12285 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 12286 for _, path := range fieldMask.Paths { 12287 rawPaths = append(rawPaths, path) 12288 } 12289 return rawPaths 12290 } 12291 12292 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) SetFromCliFlag(raw string) error { 12293 path, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(raw) 12294 if err != nil { 12295 return err 12296 } 12297 fieldMask.Paths = append(fieldMask.Paths, path) 12298 return nil 12299 } 12300 12301 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_OS) { 12302 for _, path := range fieldMask.Paths { 12303 val, _ := path.GetSingle(source) 12304 // if val is nil, then field does not exist in source, skip 12305 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 12306 if val != nil { 12307 path.WithIValue(val).SetTo(&target) 12308 } 12309 } 12310 } 12311 12312 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 12313 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_OS), source.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 12314 } 12315 12316 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_OS) *Device_Status_DeviceInfo_HardwareInformation_OS { 12317 if source == nil { 12318 return nil 12319 } 12320 if fieldMask == nil { 12321 return source 12322 } 12323 result := &Device_Status_DeviceInfo_HardwareInformation_OS{} 12324 12325 for _, p := range fieldMask.Paths { 12326 switch tp := p.(type) { 12327 case *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: 12328 switch tp.selector { 12329 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 12330 result.OperatingSystem = source.OperatingSystem 12331 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 12332 result.KernelVersion = source.KernelVersion 12333 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 12334 result.OsImage = source.OsImage 12335 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 12336 result.ContainerRuntimeVersion = source.ContainerRuntimeVersion 12337 } 12338 } 12339 } 12340 return result 12341 } 12342 12343 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 12344 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 12345 } 12346 12347 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_OS_FieldMask) PathsCount() int { 12348 if fieldMask == nil { 12349 return 0 12350 } 12351 return len(fieldMask.Paths) 12352 } 12353 12354 type Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask struct { 12355 Paths []DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath 12356 } 12357 12358 func FullDevice_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask { 12359 res := &Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask{} 12360 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor}) 12361 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion}) 12362 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate}) 12363 return res 12364 } 12365 12366 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) String() string { 12367 if fieldMask == nil { 12368 return "<nil>" 12369 } 12370 pathsStr := make([]string, 0, len(fieldMask.Paths)) 12371 for _, path := range fieldMask.Paths { 12372 pathsStr = append(pathsStr, path.String()) 12373 } 12374 return strings.Join(pathsStr, ", ") 12375 } 12376 12377 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) IsFull() bool { 12378 if fieldMask == nil { 12379 return false 12380 } 12381 presentSelectors := make([]bool, 3) 12382 for _, path := range fieldMask.Paths { 12383 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath); ok { 12384 presentSelectors[int(asFinal.selector)] = true 12385 } 12386 } 12387 for _, flag := range presentSelectors { 12388 if !flag { 12389 return false 12390 } 12391 } 12392 return true 12393 } 12394 12395 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) ProtoReflect() preflect.Message { 12396 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 12397 return ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(raw) 12398 }) 12399 } 12400 12401 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) ProtoMessage() {} 12402 12403 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Reset() { 12404 if fieldMask != nil { 12405 fieldMask.Paths = nil 12406 } 12407 } 12408 12409 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask { 12410 result := &Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask{} 12411 removedSelectors := make([]bool, 3) 12412 12413 for _, path := range other.GetPaths() { 12414 switch tp := path.(type) { 12415 case *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: 12416 removedSelectors[int(tp.selector)] = true 12417 } 12418 } 12419 for _, path := range fieldMask.GetPaths() { 12420 if !removedSelectors[int(path.Selector())] { 12421 result.Paths = append(result.Paths, path) 12422 } 12423 } 12424 12425 if len(result.Paths) == 0 { 12426 return nil 12427 } 12428 return result 12429 } 12430 12431 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 12432 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask)) 12433 } 12434 12435 // FilterInputFields generates copy of field paths with output_only field paths removed 12436 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask { 12437 result := &Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask{} 12438 result.Paths = append(result.Paths, fieldMask.Paths...) 12439 return result 12440 } 12441 12442 // ToFieldMask is used for proto conversions 12443 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 12444 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12445 for _, path := range fieldMask.Paths { 12446 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 12447 } 12448 return protoFieldMask 12449 } 12450 12451 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 12452 if fieldMask == nil { 12453 return status.Error(codes.Internal, "target field mask is nil") 12454 } 12455 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath, 0, len(protoFieldMask.Paths)) 12456 for _, strPath := range protoFieldMask.Paths { 12457 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(strPath) 12458 if err != nil { 12459 return err 12460 } 12461 fieldMask.Paths = append(fieldMask.Paths, path) 12462 } 12463 return nil 12464 } 12465 12466 // implement methods required by customType 12467 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Marshal() ([]byte, error) { 12468 protoFieldMask := fieldMask.ToProtoFieldMask() 12469 return proto.Marshal(protoFieldMask) 12470 } 12471 12472 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Unmarshal(data []byte) error { 12473 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12474 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 12475 return err 12476 } 12477 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12478 return err 12479 } 12480 return nil 12481 } 12482 12483 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Size() int { 12484 return proto.Size(fieldMask.ToProtoFieldMask()) 12485 } 12486 12487 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) MarshalJSON() ([]byte, error) { 12488 return json.Marshal(fieldMask.ToProtoFieldMask()) 12489 } 12490 12491 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) UnmarshalJSON(data []byte) error { 12492 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12493 if err := json.Unmarshal(data, protoFieldMask); err != nil { 12494 return err 12495 } 12496 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12497 return err 12498 } 12499 return nil 12500 } 12501 12502 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath) { 12503 fieldMask.Paths = append(fieldMask.Paths, path) 12504 } 12505 12506 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 12507 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath)) 12508 } 12509 12510 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath { 12511 if fieldMask == nil { 12512 return nil 12513 } 12514 return fieldMask.Paths 12515 } 12516 12517 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) GetRawPaths() []gotenobject.FieldPath { 12518 if fieldMask == nil { 12519 return nil 12520 } 12521 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 12522 for _, path := range fieldMask.Paths { 12523 rawPaths = append(rawPaths, path) 12524 } 12525 return rawPaths 12526 } 12527 12528 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) SetFromCliFlag(raw string) error { 12529 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(raw) 12530 if err != nil { 12531 return err 12532 } 12533 fieldMask.Paths = append(fieldMask.Paths, path) 12534 return nil 12535 } 12536 12537 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_BIOS) { 12538 for _, path := range fieldMask.Paths { 12539 val, _ := path.GetSingle(source) 12540 // if val is nil, then field does not exist in source, skip 12541 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 12542 if val != nil { 12543 path.WithIValue(val).SetTo(&target) 12544 } 12545 } 12546 } 12547 12548 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 12549 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_BIOS), source.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 12550 } 12551 12552 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) *Device_Status_DeviceInfo_HardwareInformation_BIOS { 12553 if source == nil { 12554 return nil 12555 } 12556 if fieldMask == nil { 12557 return source 12558 } 12559 result := &Device_Status_DeviceInfo_HardwareInformation_BIOS{} 12560 12561 for _, p := range fieldMask.Paths { 12562 switch tp := p.(type) { 12563 case *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: 12564 switch tp.selector { 12565 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 12566 result.Vendor = source.Vendor 12567 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 12568 result.BiosVersion = source.BiosVersion 12569 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 12570 result.ReleaseDate = source.ReleaseDate 12571 } 12572 } 12573 } 12574 return result 12575 } 12576 12577 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 12578 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 12579 } 12580 12581 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_BIOS_FieldMask) PathsCount() int { 12582 if fieldMask == nil { 12583 return 0 12584 } 12585 return len(fieldMask.Paths) 12586 } 12587 12588 type Device_Status_DeviceInfo_HardwareInformation_System_FieldMask struct { 12589 Paths []DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 12590 } 12591 12592 func FullDevice_Status_DeviceInfo_HardwareInformation_System_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask { 12593 res := &Device_Status_DeviceInfo_HardwareInformation_System_FieldMask{} 12594 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer}) 12595 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName}) 12596 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion}) 12597 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber}) 12598 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration}) 12599 return res 12600 } 12601 12602 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) String() string { 12603 if fieldMask == nil { 12604 return "<nil>" 12605 } 12606 pathsStr := make([]string, 0, len(fieldMask.Paths)) 12607 for _, path := range fieldMask.Paths { 12608 pathsStr = append(pathsStr, path.String()) 12609 } 12610 return strings.Join(pathsStr, ", ") 12611 } 12612 12613 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) IsFull() bool { 12614 if fieldMask == nil { 12615 return false 12616 } 12617 presentSelectors := make([]bool, 5) 12618 for _, path := range fieldMask.Paths { 12619 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath); ok { 12620 presentSelectors[int(asFinal.selector)] = true 12621 } 12622 } 12623 for _, flag := range presentSelectors { 12624 if !flag { 12625 return false 12626 } 12627 } 12628 return true 12629 } 12630 12631 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) ProtoReflect() preflect.Message { 12632 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 12633 return ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(raw) 12634 }) 12635 } 12636 12637 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) ProtoMessage() {} 12638 12639 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Reset() { 12640 if fieldMask != nil { 12641 fieldMask.Paths = nil 12642 } 12643 } 12644 12645 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask { 12646 result := &Device_Status_DeviceInfo_HardwareInformation_System_FieldMask{} 12647 removedSelectors := make([]bool, 5) 12648 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector]gotenobject.FieldMask{ 12649 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: &Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask{}, 12650 } 12651 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector]gotenobject.FieldMask{ 12652 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: &Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask{}, 12653 } 12654 12655 for _, path := range other.GetPaths() { 12656 switch tp := path.(type) { 12657 case *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: 12658 removedSelectors[int(tp.selector)] = true 12659 case *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath: 12660 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 12661 } 12662 } 12663 for _, path := range fieldMask.GetPaths() { 12664 if !removedSelectors[int(path.Selector())] { 12665 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 12666 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath); ok { 12667 switch tp.selector { 12668 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 12669 mySubMasks[DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration] = FullDevice_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask() 12670 } 12671 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath); ok { 12672 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 12673 } 12674 } else { 12675 result.Paths = append(result.Paths, path) 12676 } 12677 } 12678 } 12679 for selector, mySubMask := range mySubMasks { 12680 if mySubMask.PathsCount() > 0 { 12681 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 12682 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath{selector: selector, subPath: allowedPath}) 12683 } 12684 } 12685 } 12686 12687 if len(result.Paths) == 0 { 12688 return nil 12689 } 12690 return result 12691 } 12692 12693 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 12694 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_System_FieldMask)) 12695 } 12696 12697 // FilterInputFields generates copy of field paths with output_only field paths removed 12698 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask { 12699 result := &Device_Status_DeviceInfo_HardwareInformation_System_FieldMask{} 12700 result.Paths = append(result.Paths, fieldMask.Paths...) 12701 return result 12702 } 12703 12704 // ToFieldMask is used for proto conversions 12705 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 12706 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12707 for _, path := range fieldMask.Paths { 12708 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 12709 } 12710 return protoFieldMask 12711 } 12712 12713 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 12714 if fieldMask == nil { 12715 return status.Error(codes.Internal, "target field mask is nil") 12716 } 12717 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath, 0, len(protoFieldMask.Paths)) 12718 for _, strPath := range protoFieldMask.Paths { 12719 path, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(strPath) 12720 if err != nil { 12721 return err 12722 } 12723 fieldMask.Paths = append(fieldMask.Paths, path) 12724 } 12725 return nil 12726 } 12727 12728 // implement methods required by customType 12729 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Marshal() ([]byte, error) { 12730 protoFieldMask := fieldMask.ToProtoFieldMask() 12731 return proto.Marshal(protoFieldMask) 12732 } 12733 12734 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Unmarshal(data []byte) error { 12735 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12736 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 12737 return err 12738 } 12739 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12740 return err 12741 } 12742 return nil 12743 } 12744 12745 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Size() int { 12746 return proto.Size(fieldMask.ToProtoFieldMask()) 12747 } 12748 12749 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) MarshalJSON() ([]byte, error) { 12750 return json.Marshal(fieldMask.ToProtoFieldMask()) 12751 } 12752 12753 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) UnmarshalJSON(data []byte) error { 12754 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12755 if err := json.Unmarshal(data, protoFieldMask); err != nil { 12756 return err 12757 } 12758 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 12759 return err 12760 } 12761 return nil 12762 } 12763 12764 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath) { 12765 fieldMask.Paths = append(fieldMask.Paths, path) 12766 } 12767 12768 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 12769 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath)) 12770 } 12771 12772 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath { 12773 if fieldMask == nil { 12774 return nil 12775 } 12776 return fieldMask.Paths 12777 } 12778 12779 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) GetRawPaths() []gotenobject.FieldPath { 12780 if fieldMask == nil { 12781 return nil 12782 } 12783 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 12784 for _, path := range fieldMask.Paths { 12785 rawPaths = append(rawPaths, path) 12786 } 12787 return rawPaths 12788 } 12789 12790 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) SetFromCliFlag(raw string) error { 12791 path, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(raw) 12792 if err != nil { 12793 return err 12794 } 12795 fieldMask.Paths = append(fieldMask.Paths, path) 12796 return nil 12797 } 12798 12799 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_System) { 12800 for _, path := range fieldMask.Paths { 12801 val, _ := path.GetSingle(source) 12802 // if val is nil, then field does not exist in source, skip 12803 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 12804 if val != nil { 12805 path.WithIValue(val).SetTo(&target) 12806 } 12807 } 12808 } 12809 12810 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 12811 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_System), source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 12812 } 12813 12814 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_System) *Device_Status_DeviceInfo_HardwareInformation_System { 12815 if source == nil { 12816 return nil 12817 } 12818 if fieldMask == nil { 12819 return source 12820 } 12821 result := &Device_Status_DeviceInfo_HardwareInformation_System{} 12822 configurationMask := &Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask{} 12823 wholeConfigurationAccepted := false 12824 12825 for _, p := range fieldMask.Paths { 12826 switch tp := p.(type) { 12827 case *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: 12828 switch tp.selector { 12829 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 12830 result.Manufacturer = source.Manufacturer 12831 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 12832 result.ProductName = source.ProductName 12833 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 12834 result.Version = source.Version 12835 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 12836 result.SerialNumber = source.SerialNumber 12837 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 12838 result.Configuration = source.Configuration 12839 wholeConfigurationAccepted = true 12840 } 12841 case *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath: 12842 switch tp.selector { 12843 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 12844 configurationMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath)) 12845 } 12846 } 12847 } 12848 if wholeConfigurationAccepted == false && len(configurationMask.Paths) > 0 { 12849 result.Configuration = configurationMask.Project(source.GetConfiguration()) 12850 } 12851 return result 12852 } 12853 12854 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 12855 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 12856 } 12857 12858 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_FieldMask) PathsCount() int { 12859 if fieldMask == nil { 12860 return 0 12861 } 12862 return len(fieldMask.Paths) 12863 } 12864 12865 type Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask struct { 12866 Paths []DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 12867 } 12868 12869 func FullDevice_Status_DeviceInfo_HardwareInformation_CPU_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask { 12870 res := &Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask{} 12871 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors}) 12872 return res 12873 } 12874 12875 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) String() string { 12876 if fieldMask == nil { 12877 return "<nil>" 12878 } 12879 pathsStr := make([]string, 0, len(fieldMask.Paths)) 12880 for _, path := range fieldMask.Paths { 12881 pathsStr = append(pathsStr, path.String()) 12882 } 12883 return strings.Join(pathsStr, ", ") 12884 } 12885 12886 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) IsFull() bool { 12887 if fieldMask == nil { 12888 return false 12889 } 12890 presentSelectors := make([]bool, 1) 12891 for _, path := range fieldMask.Paths { 12892 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath); ok { 12893 presentSelectors[int(asFinal.selector)] = true 12894 } 12895 } 12896 for _, flag := range presentSelectors { 12897 if !flag { 12898 return false 12899 } 12900 } 12901 return true 12902 } 12903 12904 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) ProtoReflect() preflect.Message { 12905 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 12906 return ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(raw) 12907 }) 12908 } 12909 12910 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) ProtoMessage() {} 12911 12912 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Reset() { 12913 if fieldMask != nil { 12914 fieldMask.Paths = nil 12915 } 12916 } 12917 12918 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask { 12919 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask{} 12920 removedSelectors := make([]bool, 1) 12921 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector]gotenobject.FieldMask{ 12922 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask{}, 12923 } 12924 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector]gotenobject.FieldMask{ 12925 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask{}, 12926 } 12927 12928 for _, path := range other.GetPaths() { 12929 switch tp := path.(type) { 12930 case *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath: 12931 removedSelectors[int(tp.selector)] = true 12932 case *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath: 12933 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 12934 } 12935 } 12936 for _, path := range fieldMask.GetPaths() { 12937 if !removedSelectors[int(path.Selector())] { 12938 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 12939 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath); ok { 12940 switch tp.selector { 12941 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 12942 mySubMasks[DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors] = FullDevice_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask() 12943 } 12944 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath); ok { 12945 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 12946 } 12947 } else { 12948 result.Paths = append(result.Paths, path) 12949 } 12950 } 12951 } 12952 for selector, mySubMask := range mySubMasks { 12953 if mySubMask.PathsCount() > 0 { 12954 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 12955 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath{selector: selector, subPath: allowedPath}) 12956 } 12957 } 12958 } 12959 12960 if len(result.Paths) == 0 { 12961 return nil 12962 } 12963 return result 12964 } 12965 12966 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 12967 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask)) 12968 } 12969 12970 // FilterInputFields generates copy of field paths with output_only field paths removed 12971 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask { 12972 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask{} 12973 result.Paths = append(result.Paths, fieldMask.Paths...) 12974 return result 12975 } 12976 12977 // ToFieldMask is used for proto conversions 12978 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 12979 protoFieldMask := &googlefieldmaskpb.FieldMask{} 12980 for _, path := range fieldMask.Paths { 12981 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 12982 } 12983 return protoFieldMask 12984 } 12985 12986 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 12987 if fieldMask == nil { 12988 return status.Error(codes.Internal, "target field mask is nil") 12989 } 12990 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath, 0, len(protoFieldMask.Paths)) 12991 for _, strPath := range protoFieldMask.Paths { 12992 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(strPath) 12993 if err != nil { 12994 return err 12995 } 12996 fieldMask.Paths = append(fieldMask.Paths, path) 12997 } 12998 return nil 12999 } 13000 13001 // implement methods required by customType 13002 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Marshal() ([]byte, error) { 13003 protoFieldMask := fieldMask.ToProtoFieldMask() 13004 return proto.Marshal(protoFieldMask) 13005 } 13006 13007 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Unmarshal(data []byte) error { 13008 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13009 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 13010 return err 13011 } 13012 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13013 return err 13014 } 13015 return nil 13016 } 13017 13018 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Size() int { 13019 return proto.Size(fieldMask.ToProtoFieldMask()) 13020 } 13021 13022 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) MarshalJSON() ([]byte, error) { 13023 return json.Marshal(fieldMask.ToProtoFieldMask()) 13024 } 13025 13026 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) UnmarshalJSON(data []byte) error { 13027 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13028 if err := json.Unmarshal(data, protoFieldMask); err != nil { 13029 return err 13030 } 13031 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13032 return err 13033 } 13034 return nil 13035 } 13036 13037 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath) { 13038 fieldMask.Paths = append(fieldMask.Paths, path) 13039 } 13040 13041 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 13042 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath)) 13043 } 13044 13045 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath { 13046 if fieldMask == nil { 13047 return nil 13048 } 13049 return fieldMask.Paths 13050 } 13051 13052 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) GetRawPaths() []gotenobject.FieldPath { 13053 if fieldMask == nil { 13054 return nil 13055 } 13056 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 13057 for _, path := range fieldMask.Paths { 13058 rawPaths = append(rawPaths, path) 13059 } 13060 return rawPaths 13061 } 13062 13063 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) SetFromCliFlag(raw string) error { 13064 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(raw) 13065 if err != nil { 13066 return err 13067 } 13068 fieldMask.Paths = append(fieldMask.Paths, path) 13069 return nil 13070 } 13071 13072 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_CPU) { 13073 for _, path := range fieldMask.Paths { 13074 val, _ := path.GetSingle(source) 13075 // if val is nil, then field does not exist in source, skip 13076 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 13077 if val != nil { 13078 path.WithIValue(val).SetTo(&target) 13079 } 13080 } 13081 } 13082 13083 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 13084 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_CPU), source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 13085 } 13086 13087 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_CPU) *Device_Status_DeviceInfo_HardwareInformation_CPU { 13088 if source == nil { 13089 return nil 13090 } 13091 if fieldMask == nil { 13092 return source 13093 } 13094 result := &Device_Status_DeviceInfo_HardwareInformation_CPU{} 13095 processorsMask := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask{} 13096 wholeProcessorsAccepted := false 13097 13098 for _, p := range fieldMask.Paths { 13099 switch tp := p.(type) { 13100 case *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath: 13101 switch tp.selector { 13102 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 13103 result.Processors = source.Processors 13104 wholeProcessorsAccepted = true 13105 } 13106 case *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath: 13107 switch tp.selector { 13108 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 13109 processorsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath)) 13110 } 13111 } 13112 } 13113 if wholeProcessorsAccepted == false && len(processorsMask.Paths) > 0 { 13114 for _, sourceItem := range source.GetProcessors() { 13115 result.Processors = append(result.Processors, processorsMask.Project(sourceItem)) 13116 } 13117 } 13118 return result 13119 } 13120 13121 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 13122 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 13123 } 13124 13125 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_FieldMask) PathsCount() int { 13126 if fieldMask == nil { 13127 return 0 13128 } 13129 return len(fieldMask.Paths) 13130 } 13131 13132 type Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask struct { 13133 Paths []DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 13134 } 13135 13136 func FullDevice_Status_DeviceInfo_HardwareInformation_Block_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask { 13137 res := &Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask{} 13138 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks}) 13139 return res 13140 } 13141 13142 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) String() string { 13143 if fieldMask == nil { 13144 return "<nil>" 13145 } 13146 pathsStr := make([]string, 0, len(fieldMask.Paths)) 13147 for _, path := range fieldMask.Paths { 13148 pathsStr = append(pathsStr, path.String()) 13149 } 13150 return strings.Join(pathsStr, ", ") 13151 } 13152 13153 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) IsFull() bool { 13154 if fieldMask == nil { 13155 return false 13156 } 13157 presentSelectors := make([]bool, 1) 13158 for _, path := range fieldMask.Paths { 13159 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath); ok { 13160 presentSelectors[int(asFinal.selector)] = true 13161 } 13162 } 13163 for _, flag := range presentSelectors { 13164 if !flag { 13165 return false 13166 } 13167 } 13168 return true 13169 } 13170 13171 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) ProtoReflect() preflect.Message { 13172 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 13173 return ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(raw) 13174 }) 13175 } 13176 13177 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) ProtoMessage() {} 13178 13179 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Reset() { 13180 if fieldMask != nil { 13181 fieldMask.Paths = nil 13182 } 13183 } 13184 13185 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask { 13186 result := &Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask{} 13187 removedSelectors := make([]bool, 1) 13188 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector]gotenobject.FieldMask{ 13189 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask{}, 13190 } 13191 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector]gotenobject.FieldMask{ 13192 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask{}, 13193 } 13194 13195 for _, path := range other.GetPaths() { 13196 switch tp := path.(type) { 13197 case *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath: 13198 removedSelectors[int(tp.selector)] = true 13199 case *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath: 13200 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 13201 } 13202 } 13203 for _, path := range fieldMask.GetPaths() { 13204 if !removedSelectors[int(path.Selector())] { 13205 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 13206 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath); ok { 13207 switch tp.selector { 13208 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 13209 mySubMasks[DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks] = FullDevice_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask() 13210 } 13211 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath); ok { 13212 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 13213 } 13214 } else { 13215 result.Paths = append(result.Paths, path) 13216 } 13217 } 13218 } 13219 for selector, mySubMask := range mySubMasks { 13220 if mySubMask.PathsCount() > 0 { 13221 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 13222 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath{selector: selector, subPath: allowedPath}) 13223 } 13224 } 13225 } 13226 13227 if len(result.Paths) == 0 { 13228 return nil 13229 } 13230 return result 13231 } 13232 13233 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 13234 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask)) 13235 } 13236 13237 // FilterInputFields generates copy of field paths with output_only field paths removed 13238 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask { 13239 result := &Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask{} 13240 result.Paths = append(result.Paths, fieldMask.Paths...) 13241 return result 13242 } 13243 13244 // ToFieldMask is used for proto conversions 13245 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 13246 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13247 for _, path := range fieldMask.Paths { 13248 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 13249 } 13250 return protoFieldMask 13251 } 13252 13253 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 13254 if fieldMask == nil { 13255 return status.Error(codes.Internal, "target field mask is nil") 13256 } 13257 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath, 0, len(protoFieldMask.Paths)) 13258 for _, strPath := range protoFieldMask.Paths { 13259 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(strPath) 13260 if err != nil { 13261 return err 13262 } 13263 fieldMask.Paths = append(fieldMask.Paths, path) 13264 } 13265 return nil 13266 } 13267 13268 // implement methods required by customType 13269 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Marshal() ([]byte, error) { 13270 protoFieldMask := fieldMask.ToProtoFieldMask() 13271 return proto.Marshal(protoFieldMask) 13272 } 13273 13274 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Unmarshal(data []byte) error { 13275 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13276 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 13277 return err 13278 } 13279 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13280 return err 13281 } 13282 return nil 13283 } 13284 13285 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Size() int { 13286 return proto.Size(fieldMask.ToProtoFieldMask()) 13287 } 13288 13289 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) MarshalJSON() ([]byte, error) { 13290 return json.Marshal(fieldMask.ToProtoFieldMask()) 13291 } 13292 13293 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) UnmarshalJSON(data []byte) error { 13294 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13295 if err := json.Unmarshal(data, protoFieldMask); err != nil { 13296 return err 13297 } 13298 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13299 return err 13300 } 13301 return nil 13302 } 13303 13304 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath) { 13305 fieldMask.Paths = append(fieldMask.Paths, path) 13306 } 13307 13308 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 13309 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath)) 13310 } 13311 13312 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath { 13313 if fieldMask == nil { 13314 return nil 13315 } 13316 return fieldMask.Paths 13317 } 13318 13319 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) GetRawPaths() []gotenobject.FieldPath { 13320 if fieldMask == nil { 13321 return nil 13322 } 13323 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 13324 for _, path := range fieldMask.Paths { 13325 rawPaths = append(rawPaths, path) 13326 } 13327 return rawPaths 13328 } 13329 13330 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) SetFromCliFlag(raw string) error { 13331 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(raw) 13332 if err != nil { 13333 return err 13334 } 13335 fieldMask.Paths = append(fieldMask.Paths, path) 13336 return nil 13337 } 13338 13339 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_Block) { 13340 for _, path := range fieldMask.Paths { 13341 val, _ := path.GetSingle(source) 13342 // if val is nil, then field does not exist in source, skip 13343 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 13344 if val != nil { 13345 path.WithIValue(val).SetTo(&target) 13346 } 13347 } 13348 } 13349 13350 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 13351 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_Block), source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 13352 } 13353 13354 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_Block) *Device_Status_DeviceInfo_HardwareInformation_Block { 13355 if source == nil { 13356 return nil 13357 } 13358 if fieldMask == nil { 13359 return source 13360 } 13361 result := &Device_Status_DeviceInfo_HardwareInformation_Block{} 13362 disksMask := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask{} 13363 wholeDisksAccepted := false 13364 13365 for _, p := range fieldMask.Paths { 13366 switch tp := p.(type) { 13367 case *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath: 13368 switch tp.selector { 13369 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 13370 result.Disks = source.Disks 13371 wholeDisksAccepted = true 13372 } 13373 case *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath: 13374 switch tp.selector { 13375 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 13376 disksMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath)) 13377 } 13378 } 13379 } 13380 if wholeDisksAccepted == false && len(disksMask.Paths) > 0 { 13381 for _, sourceItem := range source.GetDisks() { 13382 result.Disks = append(result.Disks, disksMask.Project(sourceItem)) 13383 } 13384 } 13385 return result 13386 } 13387 13388 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 13389 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 13390 } 13391 13392 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_FieldMask) PathsCount() int { 13393 if fieldMask == nil { 13394 return 0 13395 } 13396 return len(fieldMask.Paths) 13397 } 13398 13399 type Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask struct { 13400 Paths []DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 13401 } 13402 13403 func FullDevice_Status_DeviceInfo_HardwareInformation_Network_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask { 13404 res := &Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask{} 13405 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics}) 13406 return res 13407 } 13408 13409 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) String() string { 13410 if fieldMask == nil { 13411 return "<nil>" 13412 } 13413 pathsStr := make([]string, 0, len(fieldMask.Paths)) 13414 for _, path := range fieldMask.Paths { 13415 pathsStr = append(pathsStr, path.String()) 13416 } 13417 return strings.Join(pathsStr, ", ") 13418 } 13419 13420 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) IsFull() bool { 13421 if fieldMask == nil { 13422 return false 13423 } 13424 presentSelectors := make([]bool, 1) 13425 for _, path := range fieldMask.Paths { 13426 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath); ok { 13427 presentSelectors[int(asFinal.selector)] = true 13428 } 13429 } 13430 for _, flag := range presentSelectors { 13431 if !flag { 13432 return false 13433 } 13434 } 13435 return true 13436 } 13437 13438 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) ProtoReflect() preflect.Message { 13439 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 13440 return ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(raw) 13441 }) 13442 } 13443 13444 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) ProtoMessage() {} 13445 13446 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Reset() { 13447 if fieldMask != nil { 13448 fieldMask.Paths = nil 13449 } 13450 } 13451 13452 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask { 13453 result := &Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask{} 13454 removedSelectors := make([]bool, 1) 13455 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector]gotenobject.FieldMask{ 13456 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: &Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask{}, 13457 } 13458 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector]gotenobject.FieldMask{ 13459 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: &Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask{}, 13460 } 13461 13462 for _, path := range other.GetPaths() { 13463 switch tp := path.(type) { 13464 case *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath: 13465 removedSelectors[int(tp.selector)] = true 13466 case *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath: 13467 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 13468 } 13469 } 13470 for _, path := range fieldMask.GetPaths() { 13471 if !removedSelectors[int(path.Selector())] { 13472 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 13473 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath); ok { 13474 switch tp.selector { 13475 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 13476 mySubMasks[DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics] = FullDevice_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask() 13477 } 13478 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath); ok { 13479 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 13480 } 13481 } else { 13482 result.Paths = append(result.Paths, path) 13483 } 13484 } 13485 } 13486 for selector, mySubMask := range mySubMasks { 13487 if mySubMask.PathsCount() > 0 { 13488 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 13489 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath{selector: selector, subPath: allowedPath}) 13490 } 13491 } 13492 } 13493 13494 if len(result.Paths) == 0 { 13495 return nil 13496 } 13497 return result 13498 } 13499 13500 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 13501 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask)) 13502 } 13503 13504 // FilterInputFields generates copy of field paths with output_only field paths removed 13505 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask { 13506 result := &Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask{} 13507 result.Paths = append(result.Paths, fieldMask.Paths...) 13508 return result 13509 } 13510 13511 // ToFieldMask is used for proto conversions 13512 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 13513 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13514 for _, path := range fieldMask.Paths { 13515 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 13516 } 13517 return protoFieldMask 13518 } 13519 13520 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 13521 if fieldMask == nil { 13522 return status.Error(codes.Internal, "target field mask is nil") 13523 } 13524 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath, 0, len(protoFieldMask.Paths)) 13525 for _, strPath := range protoFieldMask.Paths { 13526 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(strPath) 13527 if err != nil { 13528 return err 13529 } 13530 fieldMask.Paths = append(fieldMask.Paths, path) 13531 } 13532 return nil 13533 } 13534 13535 // implement methods required by customType 13536 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Marshal() ([]byte, error) { 13537 protoFieldMask := fieldMask.ToProtoFieldMask() 13538 return proto.Marshal(protoFieldMask) 13539 } 13540 13541 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Unmarshal(data []byte) error { 13542 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13543 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 13544 return err 13545 } 13546 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13547 return err 13548 } 13549 return nil 13550 } 13551 13552 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Size() int { 13553 return proto.Size(fieldMask.ToProtoFieldMask()) 13554 } 13555 13556 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) MarshalJSON() ([]byte, error) { 13557 return json.Marshal(fieldMask.ToProtoFieldMask()) 13558 } 13559 13560 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) UnmarshalJSON(data []byte) error { 13561 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13562 if err := json.Unmarshal(data, protoFieldMask); err != nil { 13563 return err 13564 } 13565 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13566 return err 13567 } 13568 return nil 13569 } 13570 13571 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath) { 13572 fieldMask.Paths = append(fieldMask.Paths, path) 13573 } 13574 13575 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 13576 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath)) 13577 } 13578 13579 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath { 13580 if fieldMask == nil { 13581 return nil 13582 } 13583 return fieldMask.Paths 13584 } 13585 13586 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) GetRawPaths() []gotenobject.FieldPath { 13587 if fieldMask == nil { 13588 return nil 13589 } 13590 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 13591 for _, path := range fieldMask.Paths { 13592 rawPaths = append(rawPaths, path) 13593 } 13594 return rawPaths 13595 } 13596 13597 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) SetFromCliFlag(raw string) error { 13598 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(raw) 13599 if err != nil { 13600 return err 13601 } 13602 fieldMask.Paths = append(fieldMask.Paths, path) 13603 return nil 13604 } 13605 13606 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_Network) { 13607 for _, path := range fieldMask.Paths { 13608 val, _ := path.GetSingle(source) 13609 // if val is nil, then field does not exist in source, skip 13610 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 13611 if val != nil { 13612 path.WithIValue(val).SetTo(&target) 13613 } 13614 } 13615 } 13616 13617 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 13618 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_Network), source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 13619 } 13620 13621 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_Network) *Device_Status_DeviceInfo_HardwareInformation_Network { 13622 if source == nil { 13623 return nil 13624 } 13625 if fieldMask == nil { 13626 return source 13627 } 13628 result := &Device_Status_DeviceInfo_HardwareInformation_Network{} 13629 nicsMask := &Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask{} 13630 wholeNicsAccepted := false 13631 13632 for _, p := range fieldMask.Paths { 13633 switch tp := p.(type) { 13634 case *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath: 13635 switch tp.selector { 13636 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 13637 result.Nics = source.Nics 13638 wholeNicsAccepted = true 13639 } 13640 case *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath: 13641 switch tp.selector { 13642 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 13643 nicsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath)) 13644 } 13645 } 13646 } 13647 if wholeNicsAccepted == false && len(nicsMask.Paths) > 0 { 13648 for _, sourceItem := range source.GetNics() { 13649 result.Nics = append(result.Nics, nicsMask.Project(sourceItem)) 13650 } 13651 } 13652 return result 13653 } 13654 13655 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 13656 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 13657 } 13658 13659 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_FieldMask) PathsCount() int { 13660 if fieldMask == nil { 13661 return 0 13662 } 13663 return len(fieldMask.Paths) 13664 } 13665 13666 type Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask struct { 13667 Paths []DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 13668 } 13669 13670 func FullDevice_Status_DeviceInfo_HardwareInformation_GPU_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask { 13671 res := &Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask{} 13672 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards}) 13673 return res 13674 } 13675 13676 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) String() string { 13677 if fieldMask == nil { 13678 return "<nil>" 13679 } 13680 pathsStr := make([]string, 0, len(fieldMask.Paths)) 13681 for _, path := range fieldMask.Paths { 13682 pathsStr = append(pathsStr, path.String()) 13683 } 13684 return strings.Join(pathsStr, ", ") 13685 } 13686 13687 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) IsFull() bool { 13688 if fieldMask == nil { 13689 return false 13690 } 13691 presentSelectors := make([]bool, 1) 13692 for _, path := range fieldMask.Paths { 13693 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath); ok { 13694 presentSelectors[int(asFinal.selector)] = true 13695 } 13696 } 13697 for _, flag := range presentSelectors { 13698 if !flag { 13699 return false 13700 } 13701 } 13702 return true 13703 } 13704 13705 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) ProtoReflect() preflect.Message { 13706 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 13707 return ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(raw) 13708 }) 13709 } 13710 13711 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) ProtoMessage() {} 13712 13713 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Reset() { 13714 if fieldMask != nil { 13715 fieldMask.Paths = nil 13716 } 13717 } 13718 13719 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask { 13720 result := &Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask{} 13721 removedSelectors := make([]bool, 1) 13722 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector]gotenobject.FieldMask{ 13723 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask{}, 13724 } 13725 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector]gotenobject.FieldMask{ 13726 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask{}, 13727 } 13728 13729 for _, path := range other.GetPaths() { 13730 switch tp := path.(type) { 13731 case *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath: 13732 removedSelectors[int(tp.selector)] = true 13733 case *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath: 13734 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 13735 } 13736 } 13737 for _, path := range fieldMask.GetPaths() { 13738 if !removedSelectors[int(path.Selector())] { 13739 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 13740 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath); ok { 13741 switch tp.selector { 13742 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 13743 mySubMasks[DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards] = FullDevice_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask() 13744 } 13745 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath); ok { 13746 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 13747 } 13748 } else { 13749 result.Paths = append(result.Paths, path) 13750 } 13751 } 13752 } 13753 for selector, mySubMask := range mySubMasks { 13754 if mySubMask.PathsCount() > 0 { 13755 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 13756 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath{selector: selector, subPath: allowedPath}) 13757 } 13758 } 13759 } 13760 13761 if len(result.Paths) == 0 { 13762 return nil 13763 } 13764 return result 13765 } 13766 13767 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 13768 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask)) 13769 } 13770 13771 // FilterInputFields generates copy of field paths with output_only field paths removed 13772 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask { 13773 result := &Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask{} 13774 result.Paths = append(result.Paths, fieldMask.Paths...) 13775 return result 13776 } 13777 13778 // ToFieldMask is used for proto conversions 13779 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 13780 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13781 for _, path := range fieldMask.Paths { 13782 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 13783 } 13784 return protoFieldMask 13785 } 13786 13787 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 13788 if fieldMask == nil { 13789 return status.Error(codes.Internal, "target field mask is nil") 13790 } 13791 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath, 0, len(protoFieldMask.Paths)) 13792 for _, strPath := range protoFieldMask.Paths { 13793 path, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(strPath) 13794 if err != nil { 13795 return err 13796 } 13797 fieldMask.Paths = append(fieldMask.Paths, path) 13798 } 13799 return nil 13800 } 13801 13802 // implement methods required by customType 13803 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Marshal() ([]byte, error) { 13804 protoFieldMask := fieldMask.ToProtoFieldMask() 13805 return proto.Marshal(protoFieldMask) 13806 } 13807 13808 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Unmarshal(data []byte) error { 13809 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13810 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 13811 return err 13812 } 13813 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13814 return err 13815 } 13816 return nil 13817 } 13818 13819 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Size() int { 13820 return proto.Size(fieldMask.ToProtoFieldMask()) 13821 } 13822 13823 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) MarshalJSON() ([]byte, error) { 13824 return json.Marshal(fieldMask.ToProtoFieldMask()) 13825 } 13826 13827 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) UnmarshalJSON(data []byte) error { 13828 protoFieldMask := &googlefieldmaskpb.FieldMask{} 13829 if err := json.Unmarshal(data, protoFieldMask); err != nil { 13830 return err 13831 } 13832 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 13833 return err 13834 } 13835 return nil 13836 } 13837 13838 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath) { 13839 fieldMask.Paths = append(fieldMask.Paths, path) 13840 } 13841 13842 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 13843 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath)) 13844 } 13845 13846 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath { 13847 if fieldMask == nil { 13848 return nil 13849 } 13850 return fieldMask.Paths 13851 } 13852 13853 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) GetRawPaths() []gotenobject.FieldPath { 13854 if fieldMask == nil { 13855 return nil 13856 } 13857 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 13858 for _, path := range fieldMask.Paths { 13859 rawPaths = append(rawPaths, path) 13860 } 13861 return rawPaths 13862 } 13863 13864 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) SetFromCliFlag(raw string) error { 13865 path, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(raw) 13866 if err != nil { 13867 return err 13868 } 13869 fieldMask.Paths = append(fieldMask.Paths, path) 13870 return nil 13871 } 13872 13873 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_GPU) { 13874 for _, path := range fieldMask.Paths { 13875 val, _ := path.GetSingle(source) 13876 // if val is nil, then field does not exist in source, skip 13877 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 13878 if val != nil { 13879 path.WithIValue(val).SetTo(&target) 13880 } 13881 } 13882 } 13883 13884 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 13885 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_GPU), source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 13886 } 13887 13888 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_GPU) *Device_Status_DeviceInfo_HardwareInformation_GPU { 13889 if source == nil { 13890 return nil 13891 } 13892 if fieldMask == nil { 13893 return source 13894 } 13895 result := &Device_Status_DeviceInfo_HardwareInformation_GPU{} 13896 graphicCardsMask := &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask{} 13897 wholeGraphicCardsAccepted := false 13898 13899 for _, p := range fieldMask.Paths { 13900 switch tp := p.(type) { 13901 case *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath: 13902 switch tp.selector { 13903 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 13904 result.GraphicCards = source.GraphicCards 13905 wholeGraphicCardsAccepted = true 13906 } 13907 case *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath: 13908 switch tp.selector { 13909 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 13910 graphicCardsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath)) 13911 } 13912 } 13913 } 13914 if wholeGraphicCardsAccepted == false && len(graphicCardsMask.Paths) > 0 { 13915 for _, sourceItem := range source.GetGraphicCards() { 13916 result.GraphicCards = append(result.GraphicCards, graphicCardsMask.Project(sourceItem)) 13917 } 13918 } 13919 return result 13920 } 13921 13922 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 13923 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 13924 } 13925 13926 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_FieldMask) PathsCount() int { 13927 if fieldMask == nil { 13928 return 0 13929 } 13930 return len(fieldMask.Paths) 13931 } 13932 13933 type Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask struct { 13934 Paths []DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath 13935 } 13936 13937 func FullDevice_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask { 13938 res := &Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask{} 13939 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress}) 13940 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor}) 13941 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct}) 13942 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName}) 13943 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor}) 13944 return res 13945 } 13946 13947 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) String() string { 13948 if fieldMask == nil { 13949 return "<nil>" 13950 } 13951 pathsStr := make([]string, 0, len(fieldMask.Paths)) 13952 for _, path := range fieldMask.Paths { 13953 pathsStr = append(pathsStr, path.String()) 13954 } 13955 return strings.Join(pathsStr, ", ") 13956 } 13957 13958 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) IsFull() bool { 13959 if fieldMask == nil { 13960 return false 13961 } 13962 presentSelectors := make([]bool, 5) 13963 for _, path := range fieldMask.Paths { 13964 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath); ok { 13965 presentSelectors[int(asFinal.selector)] = true 13966 } 13967 } 13968 for _, flag := range presentSelectors { 13969 if !flag { 13970 return false 13971 } 13972 } 13973 return true 13974 } 13975 13976 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) ProtoReflect() preflect.Message { 13977 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 13978 return ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(raw) 13979 }) 13980 } 13981 13982 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) ProtoMessage() {} 13983 13984 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Reset() { 13985 if fieldMask != nil { 13986 fieldMask.Paths = nil 13987 } 13988 } 13989 13990 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask { 13991 result := &Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask{} 13992 removedSelectors := make([]bool, 5) 13993 13994 for _, path := range other.GetPaths() { 13995 switch tp := path.(type) { 13996 case *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: 13997 removedSelectors[int(tp.selector)] = true 13998 } 13999 } 14000 for _, path := range fieldMask.GetPaths() { 14001 if !removedSelectors[int(path.Selector())] { 14002 result.Paths = append(result.Paths, path) 14003 } 14004 } 14005 14006 if len(result.Paths) == 0 { 14007 return nil 14008 } 14009 return result 14010 } 14011 14012 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 14013 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask)) 14014 } 14015 14016 // FilterInputFields generates copy of field paths with output_only field paths removed 14017 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask { 14018 result := &Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask{} 14019 result.Paths = append(result.Paths, fieldMask.Paths...) 14020 return result 14021 } 14022 14023 // ToFieldMask is used for proto conversions 14024 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 14025 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14026 for _, path := range fieldMask.Paths { 14027 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 14028 } 14029 return protoFieldMask 14030 } 14031 14032 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 14033 if fieldMask == nil { 14034 return status.Error(codes.Internal, "target field mask is nil") 14035 } 14036 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath, 0, len(protoFieldMask.Paths)) 14037 for _, strPath := range protoFieldMask.Paths { 14038 path, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(strPath) 14039 if err != nil { 14040 return err 14041 } 14042 fieldMask.Paths = append(fieldMask.Paths, path) 14043 } 14044 return nil 14045 } 14046 14047 // implement methods required by customType 14048 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Marshal() ([]byte, error) { 14049 protoFieldMask := fieldMask.ToProtoFieldMask() 14050 return proto.Marshal(protoFieldMask) 14051 } 14052 14053 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Unmarshal(data []byte) error { 14054 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14055 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 14056 return err 14057 } 14058 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14059 return err 14060 } 14061 return nil 14062 } 14063 14064 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Size() int { 14065 return proto.Size(fieldMask.ToProtoFieldMask()) 14066 } 14067 14068 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) MarshalJSON() ([]byte, error) { 14069 return json.Marshal(fieldMask.ToProtoFieldMask()) 14070 } 14071 14072 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) UnmarshalJSON(data []byte) error { 14073 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14074 if err := json.Unmarshal(data, protoFieldMask); err != nil { 14075 return err 14076 } 14077 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14078 return err 14079 } 14080 return nil 14081 } 14082 14083 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath) { 14084 fieldMask.Paths = append(fieldMask.Paths, path) 14085 } 14086 14087 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 14088 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath)) 14089 } 14090 14091 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath { 14092 if fieldMask == nil { 14093 return nil 14094 } 14095 return fieldMask.Paths 14096 } 14097 14098 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) GetRawPaths() []gotenobject.FieldPath { 14099 if fieldMask == nil { 14100 return nil 14101 } 14102 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 14103 for _, path := range fieldMask.Paths { 14104 rawPaths = append(rawPaths, path) 14105 } 14106 return rawPaths 14107 } 14108 14109 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) SetFromCliFlag(raw string) error { 14110 path, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(raw) 14111 if err != nil { 14112 return err 14113 } 14114 fieldMask.Paths = append(fieldMask.Paths, path) 14115 return nil 14116 } 14117 14118 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) { 14119 for _, path := range fieldMask.Paths { 14120 val, _ := path.GetSingle(source) 14121 // if val is nil, then field does not exist in source, skip 14122 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 14123 if val != nil { 14124 path.WithIValue(val).SetTo(&target) 14125 } 14126 } 14127 } 14128 14129 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 14130 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice), source.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 14131 } 14132 14133 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) *Device_Status_DeviceInfo_HardwareInformation_PCIDevice { 14134 if source == nil { 14135 return nil 14136 } 14137 if fieldMask == nil { 14138 return source 14139 } 14140 result := &Device_Status_DeviceInfo_HardwareInformation_PCIDevice{} 14141 14142 for _, p := range fieldMask.Paths { 14143 switch tp := p.(type) { 14144 case *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: 14145 switch tp.selector { 14146 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 14147 result.Address = source.Address 14148 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 14149 result.Vendor = source.Vendor 14150 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 14151 result.Product = source.Product 14152 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 14153 result.Name = source.Name 14154 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 14155 result.Subvendor = source.Subvendor 14156 } 14157 } 14158 } 14159 return result 14160 } 14161 14162 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 14163 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 14164 } 14165 14166 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask) PathsCount() int { 14167 if fieldMask == nil { 14168 return 0 14169 } 14170 return len(fieldMask.Paths) 14171 } 14172 14173 type Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask struct { 14174 Paths []DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 14175 } 14176 14177 func FullDevice_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask { 14178 res := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask{} 14179 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory}) 14180 return res 14181 } 14182 14183 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) String() string { 14184 if fieldMask == nil { 14185 return "<nil>" 14186 } 14187 pathsStr := make([]string, 0, len(fieldMask.Paths)) 14188 for _, path := range fieldMask.Paths { 14189 pathsStr = append(pathsStr, path.String()) 14190 } 14191 return strings.Join(pathsStr, ", ") 14192 } 14193 14194 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) IsFull() bool { 14195 if fieldMask == nil { 14196 return false 14197 } 14198 presentSelectors := make([]bool, 1) 14199 for _, path := range fieldMask.Paths { 14200 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath); ok { 14201 presentSelectors[int(asFinal.selector)] = true 14202 } 14203 } 14204 for _, flag := range presentSelectors { 14205 if !flag { 14206 return false 14207 } 14208 } 14209 return true 14210 } 14211 14212 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) ProtoReflect() preflect.Message { 14213 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 14214 return ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(raw) 14215 }) 14216 } 14217 14218 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) ProtoMessage() {} 14219 14220 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Reset() { 14221 if fieldMask != nil { 14222 fieldMask.Paths = nil 14223 } 14224 } 14225 14226 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask { 14227 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask{} 14228 removedSelectors := make([]bool, 1) 14229 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector]gotenobject.FieldMask{ 14230 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory: &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask{}, 14231 } 14232 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector]gotenobject.FieldMask{ 14233 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory: &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask{}, 14234 } 14235 14236 for _, path := range other.GetPaths() { 14237 switch tp := path.(type) { 14238 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: 14239 removedSelectors[int(tp.selector)] = true 14240 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath: 14241 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 14242 } 14243 } 14244 for _, path := range fieldMask.GetPaths() { 14245 if !removedSelectors[int(path.Selector())] { 14246 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 14247 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath); ok { 14248 switch tp.selector { 14249 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory: 14250 mySubMasks[DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory] = FullDevice_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask() 14251 } 14252 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath); ok { 14253 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 14254 } 14255 } else { 14256 result.Paths = append(result.Paths, path) 14257 } 14258 } 14259 } 14260 for selector, mySubMask := range mySubMasks { 14261 if mySubMask.PathsCount() > 0 { 14262 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 14263 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath{selector: selector, subPath: allowedPath}) 14264 } 14265 } 14266 } 14267 14268 if len(result.Paths) == 0 { 14269 return nil 14270 } 14271 return result 14272 } 14273 14274 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 14275 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask)) 14276 } 14277 14278 // FilterInputFields generates copy of field paths with output_only field paths removed 14279 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask { 14280 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask{} 14281 result.Paths = append(result.Paths, fieldMask.Paths...) 14282 return result 14283 } 14284 14285 // ToFieldMask is used for proto conversions 14286 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 14287 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14288 for _, path := range fieldMask.Paths { 14289 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 14290 } 14291 return protoFieldMask 14292 } 14293 14294 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 14295 if fieldMask == nil { 14296 return status.Error(codes.Internal, "target field mask is nil") 14297 } 14298 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath, 0, len(protoFieldMask.Paths)) 14299 for _, strPath := range protoFieldMask.Paths { 14300 path, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(strPath) 14301 if err != nil { 14302 return err 14303 } 14304 fieldMask.Paths = append(fieldMask.Paths, path) 14305 } 14306 return nil 14307 } 14308 14309 // implement methods required by customType 14310 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Marshal() ([]byte, error) { 14311 protoFieldMask := fieldMask.ToProtoFieldMask() 14312 return proto.Marshal(protoFieldMask) 14313 } 14314 14315 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Unmarshal(data []byte) error { 14316 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14317 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 14318 return err 14319 } 14320 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14321 return err 14322 } 14323 return nil 14324 } 14325 14326 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Size() int { 14327 return proto.Size(fieldMask.ToProtoFieldMask()) 14328 } 14329 14330 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) MarshalJSON() ([]byte, error) { 14331 return json.Marshal(fieldMask.ToProtoFieldMask()) 14332 } 14333 14334 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) UnmarshalJSON(data []byte) error { 14335 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14336 if err := json.Unmarshal(data, protoFieldMask); err != nil { 14337 return err 14338 } 14339 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14340 return err 14341 } 14342 return nil 14343 } 14344 14345 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath) { 14346 fieldMask.Paths = append(fieldMask.Paths, path) 14347 } 14348 14349 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 14350 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath)) 14351 } 14352 14353 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath { 14354 if fieldMask == nil { 14355 return nil 14356 } 14357 return fieldMask.Paths 14358 } 14359 14360 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 14361 if fieldMask == nil { 14362 return nil 14363 } 14364 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 14365 for _, path := range fieldMask.Paths { 14366 rawPaths = append(rawPaths, path) 14367 } 14368 return rawPaths 14369 } 14370 14371 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) SetFromCliFlag(raw string) error { 14372 path, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(raw) 14373 if err != nil { 14374 return err 14375 } 14376 fieldMask.Paths = append(fieldMask.Paths, path) 14377 return nil 14378 } 14379 14380 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) { 14381 for _, path := range fieldMask.Paths { 14382 val, _ := path.GetSingle(source) 14383 // if val is nil, then field does not exist in source, skip 14384 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 14385 if val != nil { 14386 path.WithIValue(val).SetTo(&target) 14387 } 14388 } 14389 } 14390 14391 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 14392 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo), source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 14393 } 14394 14395 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo { 14396 if source == nil { 14397 return nil 14398 } 14399 if fieldMask == nil { 14400 return source 14401 } 14402 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo{} 14403 memoryMask := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask{} 14404 wholeMemoryAccepted := false 14405 14406 for _, p := range fieldMask.Paths { 14407 switch tp := p.(type) { 14408 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: 14409 switch tp.selector { 14410 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory: 14411 result.Memory = source.Memory 14412 wholeMemoryAccepted = true 14413 } 14414 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath: 14415 switch tp.selector { 14416 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemory: 14417 memoryMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath)) 14418 } 14419 } 14420 } 14421 if wholeMemoryAccepted == false && len(memoryMask.Paths) > 0 { 14422 for _, sourceItem := range source.GetMemory() { 14423 result.Memory = append(result.Memory, memoryMask.Project(sourceItem)) 14424 } 14425 } 14426 return result 14427 } 14428 14429 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 14430 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 14431 } 14432 14433 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_FieldMask) PathsCount() int { 14434 if fieldMask == nil { 14435 return 0 14436 } 14437 return len(fieldMask.Paths) 14438 } 14439 14440 type Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask struct { 14441 Paths []DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 14442 } 14443 14444 func FullDevice_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask { 14445 res := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask{} 14446 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus}) 14447 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion}) 14448 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules}) 14449 return res 14450 } 14451 14452 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) String() string { 14453 if fieldMask == nil { 14454 return "<nil>" 14455 } 14456 pathsStr := make([]string, 0, len(fieldMask.Paths)) 14457 for _, path := range fieldMask.Paths { 14458 pathsStr = append(pathsStr, path.String()) 14459 } 14460 return strings.Join(pathsStr, ", ") 14461 } 14462 14463 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) IsFull() bool { 14464 if fieldMask == nil { 14465 return false 14466 } 14467 presentSelectors := make([]bool, 3) 14468 for _, path := range fieldMask.Paths { 14469 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath); ok { 14470 presentSelectors[int(asFinal.selector)] = true 14471 } 14472 } 14473 for _, flag := range presentSelectors { 14474 if !flag { 14475 return false 14476 } 14477 } 14478 return true 14479 } 14480 14481 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) ProtoReflect() preflect.Message { 14482 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 14483 return ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(raw) 14484 }) 14485 } 14486 14487 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) ProtoMessage() {} 14488 14489 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Reset() { 14490 if fieldMask != nil { 14491 fieldMask.Paths = nil 14492 } 14493 } 14494 14495 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask { 14496 result := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask{} 14497 removedSelectors := make([]bool, 3) 14498 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector]gotenobject.FieldMask{ 14499 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask{}, 14500 } 14501 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector]gotenobject.FieldMask{ 14502 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask{}, 14503 } 14504 14505 for _, path := range other.GetPaths() { 14506 switch tp := path.(type) { 14507 case *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: 14508 removedSelectors[int(tp.selector)] = true 14509 case *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath: 14510 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 14511 } 14512 } 14513 for _, path := range fieldMask.GetPaths() { 14514 if !removedSelectors[int(path.Selector())] { 14515 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 14516 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath); ok { 14517 switch tp.selector { 14518 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 14519 mySubMasks[DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules] = FullDevice_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask() 14520 } 14521 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath); ok { 14522 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 14523 } 14524 } else { 14525 result.Paths = append(result.Paths, path) 14526 } 14527 } 14528 } 14529 for selector, mySubMask := range mySubMasks { 14530 if mySubMask.PathsCount() > 0 { 14531 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 14532 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath{selector: selector, subPath: allowedPath}) 14533 } 14534 } 14535 } 14536 14537 if len(result.Paths) == 0 { 14538 return nil 14539 } 14540 return result 14541 } 14542 14543 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 14544 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask)) 14545 } 14546 14547 // FilterInputFields generates copy of field paths with output_only field paths removed 14548 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask { 14549 result := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask{} 14550 result.Paths = append(result.Paths, fieldMask.Paths...) 14551 return result 14552 } 14553 14554 // ToFieldMask is used for proto conversions 14555 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 14556 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14557 for _, path := range fieldMask.Paths { 14558 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 14559 } 14560 return protoFieldMask 14561 } 14562 14563 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 14564 if fieldMask == nil { 14565 return status.Error(codes.Internal, "target field mask is nil") 14566 } 14567 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath, 0, len(protoFieldMask.Paths)) 14568 for _, strPath := range protoFieldMask.Paths { 14569 path, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(strPath) 14570 if err != nil { 14571 return err 14572 } 14573 fieldMask.Paths = append(fieldMask.Paths, path) 14574 } 14575 return nil 14576 } 14577 14578 // implement methods required by customType 14579 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Marshal() ([]byte, error) { 14580 protoFieldMask := fieldMask.ToProtoFieldMask() 14581 return proto.Marshal(protoFieldMask) 14582 } 14583 14584 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Unmarshal(data []byte) error { 14585 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14586 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 14587 return err 14588 } 14589 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14590 return err 14591 } 14592 return nil 14593 } 14594 14595 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Size() int { 14596 return proto.Size(fieldMask.ToProtoFieldMask()) 14597 } 14598 14599 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) MarshalJSON() ([]byte, error) { 14600 return json.Marshal(fieldMask.ToProtoFieldMask()) 14601 } 14602 14603 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) UnmarshalJSON(data []byte) error { 14604 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14605 if err := json.Unmarshal(data, protoFieldMask); err != nil { 14606 return err 14607 } 14608 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14609 return err 14610 } 14611 return nil 14612 } 14613 14614 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath) { 14615 fieldMask.Paths = append(fieldMask.Paths, path) 14616 } 14617 14618 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 14619 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath)) 14620 } 14621 14622 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath { 14623 if fieldMask == nil { 14624 return nil 14625 } 14626 return fieldMask.Paths 14627 } 14628 14629 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 14630 if fieldMask == nil { 14631 return nil 14632 } 14633 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 14634 for _, path := range fieldMask.Paths { 14635 rawPaths = append(rawPaths, path) 14636 } 14637 return rawPaths 14638 } 14639 14640 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) SetFromCliFlag(raw string) error { 14641 path, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(raw) 14642 if err != nil { 14643 return err 14644 } 14645 fieldMask.Paths = append(fieldMask.Paths, path) 14646 return nil 14647 } 14648 14649 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) { 14650 for _, path := range fieldMask.Paths { 14651 val, _ := path.GetSingle(source) 14652 // if val is nil, then field does not exist in source, skip 14653 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 14654 if val != nil { 14655 path.WithIValue(val).SetTo(&target) 14656 } 14657 } 14658 } 14659 14660 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 14661 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo), source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 14662 } 14663 14664 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) *Device_Status_DeviceInfo_HardwareInformation_HailoInfo { 14665 if source == nil { 14666 return nil 14667 } 14668 if fieldMask == nil { 14669 return source 14670 } 14671 result := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo{} 14672 modulesMask := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask{} 14673 wholeModulesAccepted := false 14674 14675 for _, p := range fieldMask.Paths { 14676 switch tp := p.(type) { 14677 case *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: 14678 switch tp.selector { 14679 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 14680 result.Status = source.Status 14681 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 14682 result.CliVersion = source.CliVersion 14683 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 14684 result.Modules = source.Modules 14685 wholeModulesAccepted = true 14686 } 14687 case *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath: 14688 switch tp.selector { 14689 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 14690 modulesMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath)) 14691 } 14692 } 14693 } 14694 if wholeModulesAccepted == false && len(modulesMask.Paths) > 0 { 14695 for _, sourceItem := range source.GetModules() { 14696 result.Modules = append(result.Modules, modulesMask.Project(sourceItem)) 14697 } 14698 } 14699 return result 14700 } 14701 14702 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 14703 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 14704 } 14705 14706 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_FieldMask) PathsCount() int { 14707 if fieldMask == nil { 14708 return 0 14709 } 14710 return len(fieldMask.Paths) 14711 } 14712 14713 type Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask struct { 14714 Paths []DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 14715 } 14716 14717 func FullDevice_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask { 14718 res := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask{} 14719 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus}) 14720 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion}) 14721 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion}) 14722 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus}) 14723 return res 14724 } 14725 14726 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) String() string { 14727 if fieldMask == nil { 14728 return "<nil>" 14729 } 14730 pathsStr := make([]string, 0, len(fieldMask.Paths)) 14731 for _, path := range fieldMask.Paths { 14732 pathsStr = append(pathsStr, path.String()) 14733 } 14734 return strings.Join(pathsStr, ", ") 14735 } 14736 14737 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) IsFull() bool { 14738 if fieldMask == nil { 14739 return false 14740 } 14741 presentSelectors := make([]bool, 4) 14742 for _, path := range fieldMask.Paths { 14743 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath); ok { 14744 presentSelectors[int(asFinal.selector)] = true 14745 } 14746 } 14747 for _, flag := range presentSelectors { 14748 if !flag { 14749 return false 14750 } 14751 } 14752 return true 14753 } 14754 14755 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) ProtoReflect() preflect.Message { 14756 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 14757 return ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(raw) 14758 }) 14759 } 14760 14761 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) ProtoMessage() {} 14762 14763 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Reset() { 14764 if fieldMask != nil { 14765 fieldMask.Paths = nil 14766 } 14767 } 14768 14769 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask { 14770 result := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask{} 14771 removedSelectors := make([]bool, 4) 14772 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector]gotenobject.FieldMask{ 14773 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask{}, 14774 } 14775 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector]gotenobject.FieldMask{ 14776 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask{}, 14777 } 14778 14779 for _, path := range other.GetPaths() { 14780 switch tp := path.(type) { 14781 case *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: 14782 removedSelectors[int(tp.selector)] = true 14783 case *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath: 14784 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 14785 } 14786 } 14787 for _, path := range fieldMask.GetPaths() { 14788 if !removedSelectors[int(path.Selector())] { 14789 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 14790 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath); ok { 14791 switch tp.selector { 14792 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 14793 mySubMasks[DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus] = FullDevice_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask() 14794 } 14795 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath); ok { 14796 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 14797 } 14798 } else { 14799 result.Paths = append(result.Paths, path) 14800 } 14801 } 14802 } 14803 for selector, mySubMask := range mySubMasks { 14804 if mySubMask.PathsCount() > 0 { 14805 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 14806 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath{selector: selector, subPath: allowedPath}) 14807 } 14808 } 14809 } 14810 14811 if len(result.Paths) == 0 { 14812 return nil 14813 } 14814 return result 14815 } 14816 14817 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 14818 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask)) 14819 } 14820 14821 // FilterInputFields generates copy of field paths with output_only field paths removed 14822 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask { 14823 result := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask{} 14824 result.Paths = append(result.Paths, fieldMask.Paths...) 14825 return result 14826 } 14827 14828 // ToFieldMask is used for proto conversions 14829 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 14830 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14831 for _, path := range fieldMask.Paths { 14832 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 14833 } 14834 return protoFieldMask 14835 } 14836 14837 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 14838 if fieldMask == nil { 14839 return status.Error(codes.Internal, "target field mask is nil") 14840 } 14841 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath, 0, len(protoFieldMask.Paths)) 14842 for _, strPath := range protoFieldMask.Paths { 14843 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(strPath) 14844 if err != nil { 14845 return err 14846 } 14847 fieldMask.Paths = append(fieldMask.Paths, path) 14848 } 14849 return nil 14850 } 14851 14852 // implement methods required by customType 14853 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Marshal() ([]byte, error) { 14854 protoFieldMask := fieldMask.ToProtoFieldMask() 14855 return proto.Marshal(protoFieldMask) 14856 } 14857 14858 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Unmarshal(data []byte) error { 14859 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14860 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 14861 return err 14862 } 14863 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14864 return err 14865 } 14866 return nil 14867 } 14868 14869 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Size() int { 14870 return proto.Size(fieldMask.ToProtoFieldMask()) 14871 } 14872 14873 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) MarshalJSON() ([]byte, error) { 14874 return json.Marshal(fieldMask.ToProtoFieldMask()) 14875 } 14876 14877 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) UnmarshalJSON(data []byte) error { 14878 protoFieldMask := &googlefieldmaskpb.FieldMask{} 14879 if err := json.Unmarshal(data, protoFieldMask); err != nil { 14880 return err 14881 } 14882 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 14883 return err 14884 } 14885 return nil 14886 } 14887 14888 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath) { 14889 fieldMask.Paths = append(fieldMask.Paths, path) 14890 } 14891 14892 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 14893 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath)) 14894 } 14895 14896 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath { 14897 if fieldMask == nil { 14898 return nil 14899 } 14900 return fieldMask.Paths 14901 } 14902 14903 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 14904 if fieldMask == nil { 14905 return nil 14906 } 14907 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 14908 for _, path := range fieldMask.Paths { 14909 rawPaths = append(rawPaths, path) 14910 } 14911 return rawPaths 14912 } 14913 14914 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) SetFromCliFlag(raw string) error { 14915 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(raw) 14916 if err != nil { 14917 return err 14918 } 14919 fieldMask.Paths = append(fieldMask.Paths, path) 14920 return nil 14921 } 14922 14923 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) { 14924 for _, path := range fieldMask.Paths { 14925 val, _ := path.GetSingle(source) 14926 // if val is nil, then field does not exist in source, skip 14927 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 14928 if val != nil { 14929 path.WithIValue(val).SetTo(&target) 14930 } 14931 } 14932 } 14933 14934 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 14935 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo), source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 14936 } 14937 14938 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo { 14939 if source == nil { 14940 return nil 14941 } 14942 if fieldMask == nil { 14943 return source 14944 } 14945 result := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo{} 14946 gpusMask := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask{} 14947 wholeGpusAccepted := false 14948 14949 for _, p := range fieldMask.Paths { 14950 switch tp := p.(type) { 14951 case *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: 14952 switch tp.selector { 14953 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 14954 result.Status = source.Status 14955 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 14956 result.DriverVersion = source.DriverVersion 14957 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 14958 result.CudaVersion = source.CudaVersion 14959 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 14960 result.Gpus = source.Gpus 14961 wholeGpusAccepted = true 14962 } 14963 case *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath: 14964 switch tp.selector { 14965 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 14966 gpusMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath)) 14967 } 14968 } 14969 } 14970 if wholeGpusAccepted == false && len(gpusMask.Paths) > 0 { 14971 for _, sourceItem := range source.GetGpus() { 14972 result.Gpus = append(result.Gpus, gpusMask.Project(sourceItem)) 14973 } 14974 } 14975 return result 14976 } 14977 14978 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 14979 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 14980 } 14981 14982 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_FieldMask) PathsCount() int { 14983 if fieldMask == nil { 14984 return 0 14985 } 14986 return len(fieldMask.Paths) 14987 } 14988 14989 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask struct { 14990 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 14991 } 14992 14993 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask { 14994 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask{} 14995 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem}) 14996 return res 14997 } 14998 14999 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) String() string { 15000 if fieldMask == nil { 15001 return "<nil>" 15002 } 15003 pathsStr := make([]string, 0, len(fieldMask.Paths)) 15004 for _, path := range fieldMask.Paths { 15005 pathsStr = append(pathsStr, path.String()) 15006 } 15007 return strings.Join(pathsStr, ", ") 15008 } 15009 15010 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) IsFull() bool { 15011 if fieldMask == nil { 15012 return false 15013 } 15014 presentSelectors := make([]bool, 1) 15015 for _, path := range fieldMask.Paths { 15016 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath); ok { 15017 presentSelectors[int(asFinal.selector)] = true 15018 } 15019 } 15020 for _, flag := range presentSelectors { 15021 if !flag { 15022 return false 15023 } 15024 } 15025 return true 15026 } 15027 15028 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) ProtoReflect() preflect.Message { 15029 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 15030 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(raw) 15031 }) 15032 } 15033 15034 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) ProtoMessage() {} 15035 15036 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Reset() { 15037 if fieldMask != nil { 15038 fieldMask.Paths = nil 15039 } 15040 } 15041 15042 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask { 15043 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask{} 15044 removedSelectors := make([]bool, 1) 15045 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector]gotenobject.FieldMask{ 15046 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask{}, 15047 } 15048 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector]gotenobject.FieldMask{ 15049 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask{}, 15050 } 15051 15052 for _, path := range other.GetPaths() { 15053 switch tp := path.(type) { 15054 case *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath: 15055 removedSelectors[int(tp.selector)] = true 15056 case *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath: 15057 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 15058 } 15059 } 15060 for _, path := range fieldMask.GetPaths() { 15061 if !removedSelectors[int(path.Selector())] { 15062 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 15063 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath); ok { 15064 switch tp.selector { 15065 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 15066 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask() 15067 } 15068 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath); ok { 15069 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 15070 } 15071 } else { 15072 result.Paths = append(result.Paths, path) 15073 } 15074 } 15075 } 15076 for selector, mySubMask := range mySubMasks { 15077 if mySubMask.PathsCount() > 0 { 15078 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 15079 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath{selector: selector, subPath: allowedPath}) 15080 } 15081 } 15082 } 15083 15084 if len(result.Paths) == 0 { 15085 return nil 15086 } 15087 return result 15088 } 15089 15090 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 15091 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask)) 15092 } 15093 15094 // FilterInputFields generates copy of field paths with output_only field paths removed 15095 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask { 15096 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask{} 15097 result.Paths = append(result.Paths, fieldMask.Paths...) 15098 return result 15099 } 15100 15101 // ToFieldMask is used for proto conversions 15102 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 15103 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15104 for _, path := range fieldMask.Paths { 15105 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 15106 } 15107 return protoFieldMask 15108 } 15109 15110 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 15111 if fieldMask == nil { 15112 return status.Error(codes.Internal, "target field mask is nil") 15113 } 15114 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath, 0, len(protoFieldMask.Paths)) 15115 for _, strPath := range protoFieldMask.Paths { 15116 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(strPath) 15117 if err != nil { 15118 return err 15119 } 15120 fieldMask.Paths = append(fieldMask.Paths, path) 15121 } 15122 return nil 15123 } 15124 15125 // implement methods required by customType 15126 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Marshal() ([]byte, error) { 15127 protoFieldMask := fieldMask.ToProtoFieldMask() 15128 return proto.Marshal(protoFieldMask) 15129 } 15130 15131 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Unmarshal(data []byte) error { 15132 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15133 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 15134 return err 15135 } 15136 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15137 return err 15138 } 15139 return nil 15140 } 15141 15142 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Size() int { 15143 return proto.Size(fieldMask.ToProtoFieldMask()) 15144 } 15145 15146 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) MarshalJSON() ([]byte, error) { 15147 return json.Marshal(fieldMask.ToProtoFieldMask()) 15148 } 15149 15150 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) UnmarshalJSON(data []byte) error { 15151 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15152 if err := json.Unmarshal(data, protoFieldMask); err != nil { 15153 return err 15154 } 15155 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15156 return err 15157 } 15158 return nil 15159 } 15160 15161 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath) { 15162 fieldMask.Paths = append(fieldMask.Paths, path) 15163 } 15164 15165 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 15166 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath)) 15167 } 15168 15169 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath { 15170 if fieldMask == nil { 15171 return nil 15172 } 15173 return fieldMask.Paths 15174 } 15175 15176 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) GetRawPaths() []gotenobject.FieldPath { 15177 if fieldMask == nil { 15178 return nil 15179 } 15180 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 15181 for _, path := range fieldMask.Paths { 15182 rawPaths = append(rawPaths, path) 15183 } 15184 return rawPaths 15185 } 15186 15187 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) SetFromCliFlag(raw string) error { 15188 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(raw) 15189 if err != nil { 15190 return err 15191 } 15192 fieldMask.Paths = append(fieldMask.Paths, path) 15193 return nil 15194 } 15195 15196 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) { 15197 for _, path := range fieldMask.Paths { 15198 val, _ := path.GetSingle(source) 15199 // if val is nil, then field does not exist in source, skip 15200 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 15201 if val != nil { 15202 path.WithIValue(val).SetTo(&target) 15203 } 15204 } 15205 } 15206 15207 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 15208 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 15209 } 15210 15211 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus { 15212 if source == nil { 15213 return nil 15214 } 15215 if fieldMask == nil { 15216 return source 15217 } 15218 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus{} 15219 modemMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask{} 15220 wholeModemAccepted := false 15221 15222 for _, p := range fieldMask.Paths { 15223 switch tp := p.(type) { 15224 case *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath: 15225 switch tp.selector { 15226 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 15227 result.Modem = source.Modem 15228 wholeModemAccepted = true 15229 } 15230 case *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath: 15231 switch tp.selector { 15232 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 15233 modemMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath)) 15234 } 15235 } 15236 } 15237 if wholeModemAccepted == false && len(modemMask.Paths) > 0 { 15238 result.Modem = modemMask.Project(source.GetModem()) 15239 } 15240 return result 15241 } 15242 15243 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 15244 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 15245 } 15246 15247 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FieldMask) PathsCount() int { 15248 if fieldMask == nil { 15249 return 0 15250 } 15251 return len(fieldMask.Paths) 15252 } 15253 15254 type Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask struct { 15255 Paths []DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath 15256 } 15257 15258 func FullDevice_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask { 15259 res := &Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask{} 15260 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis}) 15261 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid}) 15262 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber}) 15263 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily}) 15264 return res 15265 } 15266 15267 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) String() string { 15268 if fieldMask == nil { 15269 return "<nil>" 15270 } 15271 pathsStr := make([]string, 0, len(fieldMask.Paths)) 15272 for _, path := range fieldMask.Paths { 15273 pathsStr = append(pathsStr, path.String()) 15274 } 15275 return strings.Join(pathsStr, ", ") 15276 } 15277 15278 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) IsFull() bool { 15279 if fieldMask == nil { 15280 return false 15281 } 15282 presentSelectors := make([]bool, 4) 15283 for _, path := range fieldMask.Paths { 15284 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath); ok { 15285 presentSelectors[int(asFinal.selector)] = true 15286 } 15287 } 15288 for _, flag := range presentSelectors { 15289 if !flag { 15290 return false 15291 } 15292 } 15293 return true 15294 } 15295 15296 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) ProtoReflect() preflect.Message { 15297 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 15298 return ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(raw) 15299 }) 15300 } 15301 15302 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) ProtoMessage() { 15303 } 15304 15305 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Reset() { 15306 if fieldMask != nil { 15307 fieldMask.Paths = nil 15308 } 15309 } 15310 15311 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask { 15312 result := &Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask{} 15313 removedSelectors := make([]bool, 4) 15314 15315 for _, path := range other.GetPaths() { 15316 switch tp := path.(type) { 15317 case *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: 15318 removedSelectors[int(tp.selector)] = true 15319 } 15320 } 15321 for _, path := range fieldMask.GetPaths() { 15322 if !removedSelectors[int(path.Selector())] { 15323 result.Paths = append(result.Paths, path) 15324 } 15325 } 15326 15327 if len(result.Paths) == 0 { 15328 return nil 15329 } 15330 return result 15331 } 15332 15333 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 15334 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask)) 15335 } 15336 15337 // FilterInputFields generates copy of field paths with output_only field paths removed 15338 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask { 15339 result := &Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask{} 15340 result.Paths = append(result.Paths, fieldMask.Paths...) 15341 return result 15342 } 15343 15344 // ToFieldMask is used for proto conversions 15345 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 15346 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15347 for _, path := range fieldMask.Paths { 15348 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 15349 } 15350 return protoFieldMask 15351 } 15352 15353 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 15354 if fieldMask == nil { 15355 return status.Error(codes.Internal, "target field mask is nil") 15356 } 15357 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath, 0, len(protoFieldMask.Paths)) 15358 for _, strPath := range protoFieldMask.Paths { 15359 path, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(strPath) 15360 if err != nil { 15361 return err 15362 } 15363 fieldMask.Paths = append(fieldMask.Paths, path) 15364 } 15365 return nil 15366 } 15367 15368 // implement methods required by customType 15369 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Marshal() ([]byte, error) { 15370 protoFieldMask := fieldMask.ToProtoFieldMask() 15371 return proto.Marshal(protoFieldMask) 15372 } 15373 15374 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Unmarshal(data []byte) error { 15375 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15376 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 15377 return err 15378 } 15379 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15380 return err 15381 } 15382 return nil 15383 } 15384 15385 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Size() int { 15386 return proto.Size(fieldMask.ToProtoFieldMask()) 15387 } 15388 15389 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) MarshalJSON() ([]byte, error) { 15390 return json.Marshal(fieldMask.ToProtoFieldMask()) 15391 } 15392 15393 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) UnmarshalJSON(data []byte) error { 15394 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15395 if err := json.Unmarshal(data, protoFieldMask); err != nil { 15396 return err 15397 } 15398 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15399 return err 15400 } 15401 return nil 15402 } 15403 15404 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath) { 15405 fieldMask.Paths = append(fieldMask.Paths, path) 15406 } 15407 15408 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 15409 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath)) 15410 } 15411 15412 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath { 15413 if fieldMask == nil { 15414 return nil 15415 } 15416 return fieldMask.Paths 15417 } 15418 15419 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) GetRawPaths() []gotenobject.FieldPath { 15420 if fieldMask == nil { 15421 return nil 15422 } 15423 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 15424 for _, path := range fieldMask.Paths { 15425 rawPaths = append(rawPaths, path) 15426 } 15427 return rawPaths 15428 } 15429 15430 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) SetFromCliFlag(raw string) error { 15431 path, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(raw) 15432 if err != nil { 15433 return err 15434 } 15435 fieldMask.Paths = append(fieldMask.Paths, path) 15436 return nil 15437 } 15438 15439 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) { 15440 for _, path := range fieldMask.Paths { 15441 val, _ := path.GetSingle(source) 15442 // if val is nil, then field does not exist in source, skip 15443 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 15444 if val != nil { 15445 path.WithIValue(val).SetTo(&target) 15446 } 15447 } 15448 } 15449 15450 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 15451 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration), source.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 15452 } 15453 15454 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) *Device_Status_DeviceInfo_HardwareInformation_System_Configuration { 15455 if source == nil { 15456 return nil 15457 } 15458 if fieldMask == nil { 15459 return source 15460 } 15461 result := &Device_Status_DeviceInfo_HardwareInformation_System_Configuration{} 15462 15463 for _, p := range fieldMask.Paths { 15464 switch tp := p.(type) { 15465 case *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: 15466 switch tp.selector { 15467 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 15468 result.Chassis = source.Chassis 15469 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 15470 result.Uuid = source.Uuid 15471 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 15472 result.SkuNumber = source.SkuNumber 15473 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 15474 result.Family = source.Family 15475 } 15476 } 15477 } 15478 return result 15479 } 15480 15481 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 15482 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 15483 } 15484 15485 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_System_Configuration_FieldMask) PathsCount() int { 15486 if fieldMask == nil { 15487 return 0 15488 } 15489 return len(fieldMask.Paths) 15490 } 15491 15492 type Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask struct { 15493 Paths []DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 15494 } 15495 15496 func FullDevice_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask { 15497 res := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask{} 15498 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor}) 15499 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel}) 15500 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities}) 15501 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads}) 15502 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores}) 15503 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores}) 15504 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName}) 15505 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial}) 15506 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz}) 15507 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz}) 15508 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo}) 15509 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver}) 15510 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency}) 15511 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock}) 15512 return res 15513 } 15514 15515 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) String() string { 15516 if fieldMask == nil { 15517 return "<nil>" 15518 } 15519 pathsStr := make([]string, 0, len(fieldMask.Paths)) 15520 for _, path := range fieldMask.Paths { 15521 pathsStr = append(pathsStr, path.String()) 15522 } 15523 return strings.Join(pathsStr, ", ") 15524 } 15525 15526 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) IsFull() bool { 15527 if fieldMask == nil { 15528 return false 15529 } 15530 presentSelectors := make([]bool, 14) 15531 for _, path := range fieldMask.Paths { 15532 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath); ok { 15533 presentSelectors[int(asFinal.selector)] = true 15534 } 15535 } 15536 for _, flag := range presentSelectors { 15537 if !flag { 15538 return false 15539 } 15540 } 15541 return true 15542 } 15543 15544 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) ProtoReflect() preflect.Message { 15545 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 15546 return ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(raw) 15547 }) 15548 } 15549 15550 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) ProtoMessage() { 15551 } 15552 15553 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Reset() { 15554 if fieldMask != nil { 15555 fieldMask.Paths = nil 15556 } 15557 } 15558 15559 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask { 15560 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask{} 15561 removedSelectors := make([]bool, 14) 15562 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector]gotenobject.FieldMask{ 15563 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: &Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask{}, 15564 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask{}, 15565 } 15566 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector]gotenobject.FieldMask{ 15567 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: &Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask{}, 15568 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask{}, 15569 } 15570 15571 for _, path := range other.GetPaths() { 15572 switch tp := path.(type) { 15573 case *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: 15574 removedSelectors[int(tp.selector)] = true 15575 case *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath: 15576 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 15577 } 15578 } 15579 for _, path := range fieldMask.GetPaths() { 15580 if !removedSelectors[int(path.Selector())] { 15581 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 15582 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath); ok { 15583 switch tp.selector { 15584 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 15585 mySubMasks[DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities] = FullDevice_Status_DeviceInfo_HardwareInformation_Capability_FieldMask() 15586 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 15587 mySubMasks[DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo] = FullDevice_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask() 15588 } 15589 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath); ok { 15590 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 15591 } 15592 } else { 15593 result.Paths = append(result.Paths, path) 15594 } 15595 } 15596 } 15597 for selector, mySubMask := range mySubMasks { 15598 if mySubMask.PathsCount() > 0 { 15599 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 15600 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath{selector: selector, subPath: allowedPath}) 15601 } 15602 } 15603 } 15604 15605 if len(result.Paths) == 0 { 15606 return nil 15607 } 15608 return result 15609 } 15610 15611 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 15612 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask)) 15613 } 15614 15615 // FilterInputFields generates copy of field paths with output_only field paths removed 15616 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask { 15617 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask{} 15618 result.Paths = append(result.Paths, fieldMask.Paths...) 15619 return result 15620 } 15621 15622 // ToFieldMask is used for proto conversions 15623 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 15624 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15625 for _, path := range fieldMask.Paths { 15626 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 15627 } 15628 return protoFieldMask 15629 } 15630 15631 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 15632 if fieldMask == nil { 15633 return status.Error(codes.Internal, "target field mask is nil") 15634 } 15635 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath, 0, len(protoFieldMask.Paths)) 15636 for _, strPath := range protoFieldMask.Paths { 15637 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(strPath) 15638 if err != nil { 15639 return err 15640 } 15641 fieldMask.Paths = append(fieldMask.Paths, path) 15642 } 15643 return nil 15644 } 15645 15646 // implement methods required by customType 15647 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Marshal() ([]byte, error) { 15648 protoFieldMask := fieldMask.ToProtoFieldMask() 15649 return proto.Marshal(protoFieldMask) 15650 } 15651 15652 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Unmarshal(data []byte) error { 15653 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15654 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 15655 return err 15656 } 15657 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15658 return err 15659 } 15660 return nil 15661 } 15662 15663 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Size() int { 15664 return proto.Size(fieldMask.ToProtoFieldMask()) 15665 } 15666 15667 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) MarshalJSON() ([]byte, error) { 15668 return json.Marshal(fieldMask.ToProtoFieldMask()) 15669 } 15670 15671 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) UnmarshalJSON(data []byte) error { 15672 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15673 if err := json.Unmarshal(data, protoFieldMask); err != nil { 15674 return err 15675 } 15676 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15677 return err 15678 } 15679 return nil 15680 } 15681 15682 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath) { 15683 fieldMask.Paths = append(fieldMask.Paths, path) 15684 } 15685 15686 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 15687 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath)) 15688 } 15689 15690 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath { 15691 if fieldMask == nil { 15692 return nil 15693 } 15694 return fieldMask.Paths 15695 } 15696 15697 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) GetRawPaths() []gotenobject.FieldPath { 15698 if fieldMask == nil { 15699 return nil 15700 } 15701 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 15702 for _, path := range fieldMask.Paths { 15703 rawPaths = append(rawPaths, path) 15704 } 15705 return rawPaths 15706 } 15707 15708 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) SetFromCliFlag(raw string) error { 15709 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(raw) 15710 if err != nil { 15711 return err 15712 } 15713 fieldMask.Paths = append(fieldMask.Paths, path) 15714 return nil 15715 } 15716 15717 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) { 15718 for _, path := range fieldMask.Paths { 15719 val, _ := path.GetSingle(source) 15720 // if val is nil, then field does not exist in source, skip 15721 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 15722 if val != nil { 15723 path.WithIValue(val).SetTo(&target) 15724 } 15725 } 15726 } 15727 15728 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 15729 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor), source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 15730 } 15731 15732 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor { 15733 if source == nil { 15734 return nil 15735 } 15736 if fieldMask == nil { 15737 return source 15738 } 15739 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor{} 15740 capabilitiesMask := &Device_Status_DeviceInfo_HardwareInformation_Capability_FieldMask{} 15741 wholeCapabilitiesAccepted := false 15742 cacheInfoMask := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask{} 15743 wholeCacheInfoAccepted := false 15744 15745 for _, p := range fieldMask.Paths { 15746 switch tp := p.(type) { 15747 case *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: 15748 switch tp.selector { 15749 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 15750 result.Vendor = source.Vendor 15751 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 15752 result.Model = source.Model 15753 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 15754 result.Capabilities = source.Capabilities 15755 wholeCapabilitiesAccepted = true 15756 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 15757 result.NumThreads = source.NumThreads 15758 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 15759 result.NumCores = source.NumCores 15760 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 15761 result.NumEnabledCores = source.NumEnabledCores 15762 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 15763 result.Name = source.Name 15764 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 15765 result.Serial = source.Serial 15766 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 15767 result.FrequencyMhz = source.FrequencyMhz 15768 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 15769 result.MaxFrequencyMhz = source.MaxFrequencyMhz 15770 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 15771 result.CacheInfo = source.CacheInfo 15772 wholeCacheInfoAccepted = true 15773 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 15774 result.Driver = source.Driver 15775 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 15776 result.Latency = source.Latency 15777 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 15778 result.Clock = source.Clock 15779 } 15780 case *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath: 15781 switch tp.selector { 15782 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 15783 capabilitiesMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath)) 15784 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 15785 cacheInfoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath)) 15786 } 15787 } 15788 } 15789 if wholeCapabilitiesAccepted == false && len(capabilitiesMask.Paths) > 0 { 15790 for _, sourceItem := range source.GetCapabilities() { 15791 result.Capabilities = append(result.Capabilities, capabilitiesMask.Project(sourceItem)) 15792 } 15793 } 15794 if wholeCacheInfoAccepted == false && len(cacheInfoMask.Paths) > 0 { 15795 for _, sourceItem := range source.GetCacheInfo() { 15796 result.CacheInfo = append(result.CacheInfo, cacheInfoMask.Project(sourceItem)) 15797 } 15798 } 15799 return result 15800 } 15801 15802 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 15803 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 15804 } 15805 15806 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_FieldMask) PathsCount() int { 15807 if fieldMask == nil { 15808 return 0 15809 } 15810 return len(fieldMask.Paths) 15811 } 15812 15813 type Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask struct { 15814 Paths []DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath 15815 } 15816 15817 func FullDevice_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask { 15818 res := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask{} 15819 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType}) 15820 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes}) 15821 return res 15822 } 15823 15824 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) String() string { 15825 if fieldMask == nil { 15826 return "<nil>" 15827 } 15828 pathsStr := make([]string, 0, len(fieldMask.Paths)) 15829 for _, path := range fieldMask.Paths { 15830 pathsStr = append(pathsStr, path.String()) 15831 } 15832 return strings.Join(pathsStr, ", ") 15833 } 15834 15835 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) IsFull() bool { 15836 if fieldMask == nil { 15837 return false 15838 } 15839 presentSelectors := make([]bool, 2) 15840 for _, path := range fieldMask.Paths { 15841 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath); ok { 15842 presentSelectors[int(asFinal.selector)] = true 15843 } 15844 } 15845 for _, flag := range presentSelectors { 15846 if !flag { 15847 return false 15848 } 15849 } 15850 return true 15851 } 15852 15853 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) ProtoReflect() preflect.Message { 15854 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 15855 return ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(raw) 15856 }) 15857 } 15858 15859 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) ProtoMessage() { 15860 } 15861 15862 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Reset() { 15863 if fieldMask != nil { 15864 fieldMask.Paths = nil 15865 } 15866 } 15867 15868 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask { 15869 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask{} 15870 removedSelectors := make([]bool, 2) 15871 15872 for _, path := range other.GetPaths() { 15873 switch tp := path.(type) { 15874 case *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: 15875 removedSelectors[int(tp.selector)] = true 15876 } 15877 } 15878 for _, path := range fieldMask.GetPaths() { 15879 if !removedSelectors[int(path.Selector())] { 15880 result.Paths = append(result.Paths, path) 15881 } 15882 } 15883 15884 if len(result.Paths) == 0 { 15885 return nil 15886 } 15887 return result 15888 } 15889 15890 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 15891 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask)) 15892 } 15893 15894 // FilterInputFields generates copy of field paths with output_only field paths removed 15895 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask { 15896 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask{} 15897 result.Paths = append(result.Paths, fieldMask.Paths...) 15898 return result 15899 } 15900 15901 // ToFieldMask is used for proto conversions 15902 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 15903 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15904 for _, path := range fieldMask.Paths { 15905 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 15906 } 15907 return protoFieldMask 15908 } 15909 15910 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 15911 if fieldMask == nil { 15912 return status.Error(codes.Internal, "target field mask is nil") 15913 } 15914 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath, 0, len(protoFieldMask.Paths)) 15915 for _, strPath := range protoFieldMask.Paths { 15916 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(strPath) 15917 if err != nil { 15918 return err 15919 } 15920 fieldMask.Paths = append(fieldMask.Paths, path) 15921 } 15922 return nil 15923 } 15924 15925 // implement methods required by customType 15926 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Marshal() ([]byte, error) { 15927 protoFieldMask := fieldMask.ToProtoFieldMask() 15928 return proto.Marshal(protoFieldMask) 15929 } 15930 15931 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Unmarshal(data []byte) error { 15932 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15933 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 15934 return err 15935 } 15936 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15937 return err 15938 } 15939 return nil 15940 } 15941 15942 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Size() int { 15943 return proto.Size(fieldMask.ToProtoFieldMask()) 15944 } 15945 15946 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) MarshalJSON() ([]byte, error) { 15947 return json.Marshal(fieldMask.ToProtoFieldMask()) 15948 } 15949 15950 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) UnmarshalJSON(data []byte) error { 15951 protoFieldMask := &googlefieldmaskpb.FieldMask{} 15952 if err := json.Unmarshal(data, protoFieldMask); err != nil { 15953 return err 15954 } 15955 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 15956 return err 15957 } 15958 return nil 15959 } 15960 15961 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath) { 15962 fieldMask.Paths = append(fieldMask.Paths, path) 15963 } 15964 15965 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 15966 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath)) 15967 } 15968 15969 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath { 15970 if fieldMask == nil { 15971 return nil 15972 } 15973 return fieldMask.Paths 15974 } 15975 15976 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) GetRawPaths() []gotenobject.FieldPath { 15977 if fieldMask == nil { 15978 return nil 15979 } 15980 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 15981 for _, path := range fieldMask.Paths { 15982 rawPaths = append(rawPaths, path) 15983 } 15984 return rawPaths 15985 } 15986 15987 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) SetFromCliFlag(raw string) error { 15988 path, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(raw) 15989 if err != nil { 15990 return err 15991 } 15992 fieldMask.Paths = append(fieldMask.Paths, path) 15993 return nil 15994 } 15995 15996 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) { 15997 for _, path := range fieldMask.Paths { 15998 val, _ := path.GetSingle(source) 15999 // if val is nil, then field does not exist in source, skip 16000 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 16001 if val != nil { 16002 path.WithIValue(val).SetTo(&target) 16003 } 16004 } 16005 } 16006 16007 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 16008 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache), source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 16009 } 16010 16011 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache { 16012 if source == nil { 16013 return nil 16014 } 16015 if fieldMask == nil { 16016 return source 16017 } 16018 result := &Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache{} 16019 16020 for _, p := range fieldMask.Paths { 16021 switch tp := p.(type) { 16022 case *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: 16023 switch tp.selector { 16024 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 16025 result.Type = source.Type 16026 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 16027 result.SizeBytes = source.SizeBytes 16028 } 16029 } 16030 } 16031 return result 16032 } 16033 16034 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 16035 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 16036 } 16037 16038 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache_FieldMask) PathsCount() int { 16039 if fieldMask == nil { 16040 return 0 16041 } 16042 return len(fieldMask.Paths) 16043 } 16044 16045 type Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask struct { 16046 Paths []DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 16047 } 16048 16049 func FullDevice_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask { 16050 res := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask{} 16051 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName}) 16052 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes}) 16053 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType}) 16054 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor}) 16055 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel}) 16056 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber}) 16057 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn}) 16058 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions}) 16059 return res 16060 } 16061 16062 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) String() string { 16063 if fieldMask == nil { 16064 return "<nil>" 16065 } 16066 pathsStr := make([]string, 0, len(fieldMask.Paths)) 16067 for _, path := range fieldMask.Paths { 16068 pathsStr = append(pathsStr, path.String()) 16069 } 16070 return strings.Join(pathsStr, ", ") 16071 } 16072 16073 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) IsFull() bool { 16074 if fieldMask == nil { 16075 return false 16076 } 16077 presentSelectors := make([]bool, 8) 16078 for _, path := range fieldMask.Paths { 16079 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath); ok { 16080 presentSelectors[int(asFinal.selector)] = true 16081 } 16082 } 16083 for _, flag := range presentSelectors { 16084 if !flag { 16085 return false 16086 } 16087 } 16088 return true 16089 } 16090 16091 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) ProtoReflect() preflect.Message { 16092 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 16093 return ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(raw) 16094 }) 16095 } 16096 16097 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) ProtoMessage() {} 16098 16099 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Reset() { 16100 if fieldMask != nil { 16101 fieldMask.Paths = nil 16102 } 16103 } 16104 16105 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask { 16106 result := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask{} 16107 removedSelectors := make([]bool, 8) 16108 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector]gotenobject.FieldMask{ 16109 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask{}, 16110 } 16111 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector]gotenobject.FieldMask{ 16112 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask{}, 16113 } 16114 16115 for _, path := range other.GetPaths() { 16116 switch tp := path.(type) { 16117 case *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: 16118 removedSelectors[int(tp.selector)] = true 16119 case *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath: 16120 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 16121 } 16122 } 16123 for _, path := range fieldMask.GetPaths() { 16124 if !removedSelectors[int(path.Selector())] { 16125 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 16126 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath); ok { 16127 switch tp.selector { 16128 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 16129 mySubMasks[DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions] = FullDevice_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask() 16130 } 16131 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath); ok { 16132 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 16133 } 16134 } else { 16135 result.Paths = append(result.Paths, path) 16136 } 16137 } 16138 } 16139 for selector, mySubMask := range mySubMasks { 16140 if mySubMask.PathsCount() > 0 { 16141 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 16142 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath{selector: selector, subPath: allowedPath}) 16143 } 16144 } 16145 } 16146 16147 if len(result.Paths) == 0 { 16148 return nil 16149 } 16150 return result 16151 } 16152 16153 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 16154 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask)) 16155 } 16156 16157 // FilterInputFields generates copy of field paths with output_only field paths removed 16158 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask { 16159 result := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask{} 16160 result.Paths = append(result.Paths, fieldMask.Paths...) 16161 return result 16162 } 16163 16164 // ToFieldMask is used for proto conversions 16165 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 16166 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16167 for _, path := range fieldMask.Paths { 16168 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 16169 } 16170 return protoFieldMask 16171 } 16172 16173 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 16174 if fieldMask == nil { 16175 return status.Error(codes.Internal, "target field mask is nil") 16176 } 16177 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath, 0, len(protoFieldMask.Paths)) 16178 for _, strPath := range protoFieldMask.Paths { 16179 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(strPath) 16180 if err != nil { 16181 return err 16182 } 16183 fieldMask.Paths = append(fieldMask.Paths, path) 16184 } 16185 return nil 16186 } 16187 16188 // implement methods required by customType 16189 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Marshal() ([]byte, error) { 16190 protoFieldMask := fieldMask.ToProtoFieldMask() 16191 return proto.Marshal(protoFieldMask) 16192 } 16193 16194 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Unmarshal(data []byte) error { 16195 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16196 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 16197 return err 16198 } 16199 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16200 return err 16201 } 16202 return nil 16203 } 16204 16205 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Size() int { 16206 return proto.Size(fieldMask.ToProtoFieldMask()) 16207 } 16208 16209 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) MarshalJSON() ([]byte, error) { 16210 return json.Marshal(fieldMask.ToProtoFieldMask()) 16211 } 16212 16213 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) UnmarshalJSON(data []byte) error { 16214 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16215 if err := json.Unmarshal(data, protoFieldMask); err != nil { 16216 return err 16217 } 16218 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16219 return err 16220 } 16221 return nil 16222 } 16223 16224 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath) { 16225 fieldMask.Paths = append(fieldMask.Paths, path) 16226 } 16227 16228 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 16229 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath)) 16230 } 16231 16232 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath { 16233 if fieldMask == nil { 16234 return nil 16235 } 16236 return fieldMask.Paths 16237 } 16238 16239 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) GetRawPaths() []gotenobject.FieldPath { 16240 if fieldMask == nil { 16241 return nil 16242 } 16243 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 16244 for _, path := range fieldMask.Paths { 16245 rawPaths = append(rawPaths, path) 16246 } 16247 return rawPaths 16248 } 16249 16250 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) SetFromCliFlag(raw string) error { 16251 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(raw) 16252 if err != nil { 16253 return err 16254 } 16255 fieldMask.Paths = append(fieldMask.Paths, path) 16256 return nil 16257 } 16258 16259 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) { 16260 for _, path := range fieldMask.Paths { 16261 val, _ := path.GetSingle(source) 16262 // if val is nil, then field does not exist in source, skip 16263 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 16264 if val != nil { 16265 path.WithIValue(val).SetTo(&target) 16266 } 16267 } 16268 } 16269 16270 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 16271 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk), source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 16272 } 16273 16274 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) *Device_Status_DeviceInfo_HardwareInformation_Block_Disk { 16275 if source == nil { 16276 return nil 16277 } 16278 if fieldMask == nil { 16279 return source 16280 } 16281 result := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk{} 16282 partitionsMask := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask{} 16283 wholePartitionsAccepted := false 16284 16285 for _, p := range fieldMask.Paths { 16286 switch tp := p.(type) { 16287 case *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: 16288 switch tp.selector { 16289 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 16290 result.Name = source.Name 16291 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 16292 result.SizeBytes = source.SizeBytes 16293 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 16294 result.DriveType = source.DriveType 16295 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 16296 result.Vendor = source.Vendor 16297 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 16298 result.Model = source.Model 16299 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 16300 result.SerialNumber = source.SerialNumber 16301 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 16302 result.Wwn = source.Wwn 16303 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 16304 result.Partitions = source.Partitions 16305 wholePartitionsAccepted = true 16306 } 16307 case *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath: 16308 switch tp.selector { 16309 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 16310 partitionsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath)) 16311 } 16312 } 16313 } 16314 if wholePartitionsAccepted == false && len(partitionsMask.Paths) > 0 { 16315 for _, sourceItem := range source.GetPartitions() { 16316 result.Partitions = append(result.Partitions, partitionsMask.Project(sourceItem)) 16317 } 16318 } 16319 return result 16320 } 16321 16322 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 16323 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 16324 } 16325 16326 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_FieldMask) PathsCount() int { 16327 if fieldMask == nil { 16328 return 0 16329 } 16330 return len(fieldMask.Paths) 16331 } 16332 16333 type Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask struct { 16334 Paths []DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath 16335 } 16336 16337 func FullDevice_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask { 16338 res := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask{} 16339 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName}) 16340 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes}) 16341 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint}) 16342 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType}) 16343 return res 16344 } 16345 16346 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) String() string { 16347 if fieldMask == nil { 16348 return "<nil>" 16349 } 16350 pathsStr := make([]string, 0, len(fieldMask.Paths)) 16351 for _, path := range fieldMask.Paths { 16352 pathsStr = append(pathsStr, path.String()) 16353 } 16354 return strings.Join(pathsStr, ", ") 16355 } 16356 16357 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) IsFull() bool { 16358 if fieldMask == nil { 16359 return false 16360 } 16361 presentSelectors := make([]bool, 4) 16362 for _, path := range fieldMask.Paths { 16363 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath); ok { 16364 presentSelectors[int(asFinal.selector)] = true 16365 } 16366 } 16367 for _, flag := range presentSelectors { 16368 if !flag { 16369 return false 16370 } 16371 } 16372 return true 16373 } 16374 16375 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) ProtoReflect() preflect.Message { 16376 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 16377 return ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(raw) 16378 }) 16379 } 16380 16381 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) ProtoMessage() { 16382 } 16383 16384 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Reset() { 16385 if fieldMask != nil { 16386 fieldMask.Paths = nil 16387 } 16388 } 16389 16390 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask { 16391 result := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask{} 16392 removedSelectors := make([]bool, 4) 16393 16394 for _, path := range other.GetPaths() { 16395 switch tp := path.(type) { 16396 case *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: 16397 removedSelectors[int(tp.selector)] = true 16398 } 16399 } 16400 for _, path := range fieldMask.GetPaths() { 16401 if !removedSelectors[int(path.Selector())] { 16402 result.Paths = append(result.Paths, path) 16403 } 16404 } 16405 16406 if len(result.Paths) == 0 { 16407 return nil 16408 } 16409 return result 16410 } 16411 16412 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 16413 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask)) 16414 } 16415 16416 // FilterInputFields generates copy of field paths with output_only field paths removed 16417 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask { 16418 result := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask{} 16419 result.Paths = append(result.Paths, fieldMask.Paths...) 16420 return result 16421 } 16422 16423 // ToFieldMask is used for proto conversions 16424 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 16425 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16426 for _, path := range fieldMask.Paths { 16427 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 16428 } 16429 return protoFieldMask 16430 } 16431 16432 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 16433 if fieldMask == nil { 16434 return status.Error(codes.Internal, "target field mask is nil") 16435 } 16436 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath, 0, len(protoFieldMask.Paths)) 16437 for _, strPath := range protoFieldMask.Paths { 16438 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(strPath) 16439 if err != nil { 16440 return err 16441 } 16442 fieldMask.Paths = append(fieldMask.Paths, path) 16443 } 16444 return nil 16445 } 16446 16447 // implement methods required by customType 16448 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Marshal() ([]byte, error) { 16449 protoFieldMask := fieldMask.ToProtoFieldMask() 16450 return proto.Marshal(protoFieldMask) 16451 } 16452 16453 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Unmarshal(data []byte) error { 16454 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16455 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 16456 return err 16457 } 16458 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16459 return err 16460 } 16461 return nil 16462 } 16463 16464 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Size() int { 16465 return proto.Size(fieldMask.ToProtoFieldMask()) 16466 } 16467 16468 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) MarshalJSON() ([]byte, error) { 16469 return json.Marshal(fieldMask.ToProtoFieldMask()) 16470 } 16471 16472 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) UnmarshalJSON(data []byte) error { 16473 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16474 if err := json.Unmarshal(data, protoFieldMask); err != nil { 16475 return err 16476 } 16477 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16478 return err 16479 } 16480 return nil 16481 } 16482 16483 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath) { 16484 fieldMask.Paths = append(fieldMask.Paths, path) 16485 } 16486 16487 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 16488 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath)) 16489 } 16490 16491 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath { 16492 if fieldMask == nil { 16493 return nil 16494 } 16495 return fieldMask.Paths 16496 } 16497 16498 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) GetRawPaths() []gotenobject.FieldPath { 16499 if fieldMask == nil { 16500 return nil 16501 } 16502 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 16503 for _, path := range fieldMask.Paths { 16504 rawPaths = append(rawPaths, path) 16505 } 16506 return rawPaths 16507 } 16508 16509 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) SetFromCliFlag(raw string) error { 16510 path, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(raw) 16511 if err != nil { 16512 return err 16513 } 16514 fieldMask.Paths = append(fieldMask.Paths, path) 16515 return nil 16516 } 16517 16518 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) { 16519 for _, path := range fieldMask.Paths { 16520 val, _ := path.GetSingle(source) 16521 // if val is nil, then field does not exist in source, skip 16522 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 16523 if val != nil { 16524 path.WithIValue(val).SetTo(&target) 16525 } 16526 } 16527 } 16528 16529 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 16530 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition), source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 16531 } 16532 16533 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition { 16534 if source == nil { 16535 return nil 16536 } 16537 if fieldMask == nil { 16538 return source 16539 } 16540 result := &Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition{} 16541 16542 for _, p := range fieldMask.Paths { 16543 switch tp := p.(type) { 16544 case *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: 16545 switch tp.selector { 16546 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 16547 result.Name = source.Name 16548 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 16549 result.SizeBytes = source.SizeBytes 16550 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 16551 result.MountPoint = source.MountPoint 16552 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 16553 result.Type = source.Type 16554 } 16555 } 16556 } 16557 return result 16558 } 16559 16560 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 16561 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 16562 } 16563 16564 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition_FieldMask) PathsCount() int { 16565 if fieldMask == nil { 16566 return 0 16567 } 16568 return len(fieldMask.Paths) 16569 } 16570 16571 type Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask struct { 16572 Paths []DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath 16573 } 16574 16575 func FullDevice_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask { 16576 res := &Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask{} 16577 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName}) 16578 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress}) 16579 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual}) 16580 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription}) 16581 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName}) 16582 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor}) 16583 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor}) 16584 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting}) 16585 return res 16586 } 16587 16588 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) String() string { 16589 if fieldMask == nil { 16590 return "<nil>" 16591 } 16592 pathsStr := make([]string, 0, len(fieldMask.Paths)) 16593 for _, path := range fieldMask.Paths { 16594 pathsStr = append(pathsStr, path.String()) 16595 } 16596 return strings.Join(pathsStr, ", ") 16597 } 16598 16599 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) IsFull() bool { 16600 if fieldMask == nil { 16601 return false 16602 } 16603 presentSelectors := make([]bool, 8) 16604 for _, path := range fieldMask.Paths { 16605 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath); ok { 16606 presentSelectors[int(asFinal.selector)] = true 16607 } 16608 } 16609 for _, flag := range presentSelectors { 16610 if !flag { 16611 return false 16612 } 16613 } 16614 return true 16615 } 16616 16617 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) ProtoReflect() preflect.Message { 16618 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 16619 return ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(raw) 16620 }) 16621 } 16622 16623 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) ProtoMessage() {} 16624 16625 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Reset() { 16626 if fieldMask != nil { 16627 fieldMask.Paths = nil 16628 } 16629 } 16630 16631 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask { 16632 result := &Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask{} 16633 removedSelectors := make([]bool, 8) 16634 16635 for _, path := range other.GetPaths() { 16636 switch tp := path.(type) { 16637 case *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: 16638 removedSelectors[int(tp.selector)] = true 16639 } 16640 } 16641 for _, path := range fieldMask.GetPaths() { 16642 if !removedSelectors[int(path.Selector())] { 16643 result.Paths = append(result.Paths, path) 16644 } 16645 } 16646 16647 if len(result.Paths) == 0 { 16648 return nil 16649 } 16650 return result 16651 } 16652 16653 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 16654 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask)) 16655 } 16656 16657 // FilterInputFields generates copy of field paths with output_only field paths removed 16658 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask { 16659 result := &Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask{} 16660 result.Paths = append(result.Paths, fieldMask.Paths...) 16661 return result 16662 } 16663 16664 // ToFieldMask is used for proto conversions 16665 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 16666 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16667 for _, path := range fieldMask.Paths { 16668 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 16669 } 16670 return protoFieldMask 16671 } 16672 16673 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 16674 if fieldMask == nil { 16675 return status.Error(codes.Internal, "target field mask is nil") 16676 } 16677 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath, 0, len(protoFieldMask.Paths)) 16678 for _, strPath := range protoFieldMask.Paths { 16679 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(strPath) 16680 if err != nil { 16681 return err 16682 } 16683 fieldMask.Paths = append(fieldMask.Paths, path) 16684 } 16685 return nil 16686 } 16687 16688 // implement methods required by customType 16689 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Marshal() ([]byte, error) { 16690 protoFieldMask := fieldMask.ToProtoFieldMask() 16691 return proto.Marshal(protoFieldMask) 16692 } 16693 16694 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Unmarshal(data []byte) error { 16695 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16696 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 16697 return err 16698 } 16699 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16700 return err 16701 } 16702 return nil 16703 } 16704 16705 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Size() int { 16706 return proto.Size(fieldMask.ToProtoFieldMask()) 16707 } 16708 16709 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) MarshalJSON() ([]byte, error) { 16710 return json.Marshal(fieldMask.ToProtoFieldMask()) 16711 } 16712 16713 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) UnmarshalJSON(data []byte) error { 16714 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16715 if err := json.Unmarshal(data, protoFieldMask); err != nil { 16716 return err 16717 } 16718 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16719 return err 16720 } 16721 return nil 16722 } 16723 16724 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath) { 16725 fieldMask.Paths = append(fieldMask.Paths, path) 16726 } 16727 16728 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 16729 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath)) 16730 } 16731 16732 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath { 16733 if fieldMask == nil { 16734 return nil 16735 } 16736 return fieldMask.Paths 16737 } 16738 16739 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) GetRawPaths() []gotenobject.FieldPath { 16740 if fieldMask == nil { 16741 return nil 16742 } 16743 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 16744 for _, path := range fieldMask.Paths { 16745 rawPaths = append(rawPaths, path) 16746 } 16747 return rawPaths 16748 } 16749 16750 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) SetFromCliFlag(raw string) error { 16751 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(raw) 16752 if err != nil { 16753 return err 16754 } 16755 fieldMask.Paths = append(fieldMask.Paths, path) 16756 return nil 16757 } 16758 16759 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) { 16760 for _, path := range fieldMask.Paths { 16761 val, _ := path.GetSingle(source) 16762 // if val is nil, then field does not exist in source, skip 16763 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 16764 if val != nil { 16765 path.WithIValue(val).SetTo(&target) 16766 } 16767 } 16768 } 16769 16770 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 16771 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC), source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 16772 } 16773 16774 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) *Device_Status_DeviceInfo_HardwareInformation_Network_NIC { 16775 if source == nil { 16776 return nil 16777 } 16778 if fieldMask == nil { 16779 return source 16780 } 16781 result := &Device_Status_DeviceInfo_HardwareInformation_Network_NIC{} 16782 var settingMapKeys []string 16783 wholeSettingAccepted := false 16784 16785 for _, p := range fieldMask.Paths { 16786 switch tp := p.(type) { 16787 case *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: 16788 switch tp.selector { 16789 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 16790 result.Name = source.Name 16791 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 16792 result.MacAddress = source.MacAddress 16793 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 16794 result.Virtual = source.Virtual 16795 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 16796 result.Description = source.Description 16797 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 16798 result.ProductName = source.ProductName 16799 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 16800 result.Vendor = source.Vendor 16801 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 16802 result.Subvendor = source.Subvendor 16803 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 16804 result.Setting = source.Setting 16805 wholeSettingAccepted = true 16806 } 16807 case *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap: 16808 switch tp.selector { 16809 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 16810 settingMapKeys = append(settingMapKeys, tp.key) 16811 } 16812 } 16813 } 16814 if wholeSettingAccepted == false && len(settingMapKeys) > 0 && source.GetSetting() != nil { 16815 copiedMap := map[string]string{} 16816 sourceMap := source.GetSetting() 16817 for _, key := range settingMapKeys { 16818 copiedMap[key] = sourceMap[key] 16819 } 16820 result.Setting = copiedMap 16821 } 16822 return result 16823 } 16824 16825 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 16826 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 16827 } 16828 16829 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_Network_NIC_FieldMask) PathsCount() int { 16830 if fieldMask == nil { 16831 return 0 16832 } 16833 return len(fieldMask.Paths) 16834 } 16835 16836 type Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask struct { 16837 Paths []DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 16838 } 16839 16840 func FullDevice_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask { 16841 res := &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask{} 16842 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex}) 16843 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice}) 16844 return res 16845 } 16846 16847 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) String() string { 16848 if fieldMask == nil { 16849 return "<nil>" 16850 } 16851 pathsStr := make([]string, 0, len(fieldMask.Paths)) 16852 for _, path := range fieldMask.Paths { 16853 pathsStr = append(pathsStr, path.String()) 16854 } 16855 return strings.Join(pathsStr, ", ") 16856 } 16857 16858 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) IsFull() bool { 16859 if fieldMask == nil { 16860 return false 16861 } 16862 presentSelectors := make([]bool, 2) 16863 for _, path := range fieldMask.Paths { 16864 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath); ok { 16865 presentSelectors[int(asFinal.selector)] = true 16866 } 16867 } 16868 for _, flag := range presentSelectors { 16869 if !flag { 16870 return false 16871 } 16872 } 16873 return true 16874 } 16875 16876 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) ProtoReflect() preflect.Message { 16877 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 16878 return ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(raw) 16879 }) 16880 } 16881 16882 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) ProtoMessage() { 16883 } 16884 16885 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Reset() { 16886 if fieldMask != nil { 16887 fieldMask.Paths = nil 16888 } 16889 } 16890 16891 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask { 16892 result := &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask{} 16893 removedSelectors := make([]bool, 2) 16894 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector]gotenobject.FieldMask{ 16895 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: &Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask{}, 16896 } 16897 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector]gotenobject.FieldMask{ 16898 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: &Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask{}, 16899 } 16900 16901 for _, path := range other.GetPaths() { 16902 switch tp := path.(type) { 16903 case *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: 16904 removedSelectors[int(tp.selector)] = true 16905 case *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath: 16906 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 16907 } 16908 } 16909 for _, path := range fieldMask.GetPaths() { 16910 if !removedSelectors[int(path.Selector())] { 16911 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 16912 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath); ok { 16913 switch tp.selector { 16914 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 16915 mySubMasks[DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice] = FullDevice_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask() 16916 } 16917 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath); ok { 16918 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 16919 } 16920 } else { 16921 result.Paths = append(result.Paths, path) 16922 } 16923 } 16924 } 16925 for selector, mySubMask := range mySubMasks { 16926 if mySubMask.PathsCount() > 0 { 16927 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 16928 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath{selector: selector, subPath: allowedPath}) 16929 } 16930 } 16931 } 16932 16933 if len(result.Paths) == 0 { 16934 return nil 16935 } 16936 return result 16937 } 16938 16939 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 16940 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask)) 16941 } 16942 16943 // FilterInputFields generates copy of field paths with output_only field paths removed 16944 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask { 16945 result := &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask{} 16946 result.Paths = append(result.Paths, fieldMask.Paths...) 16947 return result 16948 } 16949 16950 // ToFieldMask is used for proto conversions 16951 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 16952 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16953 for _, path := range fieldMask.Paths { 16954 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 16955 } 16956 return protoFieldMask 16957 } 16958 16959 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 16960 if fieldMask == nil { 16961 return status.Error(codes.Internal, "target field mask is nil") 16962 } 16963 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath, 0, len(protoFieldMask.Paths)) 16964 for _, strPath := range protoFieldMask.Paths { 16965 path, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(strPath) 16966 if err != nil { 16967 return err 16968 } 16969 fieldMask.Paths = append(fieldMask.Paths, path) 16970 } 16971 return nil 16972 } 16973 16974 // implement methods required by customType 16975 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Marshal() ([]byte, error) { 16976 protoFieldMask := fieldMask.ToProtoFieldMask() 16977 return proto.Marshal(protoFieldMask) 16978 } 16979 16980 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Unmarshal(data []byte) error { 16981 protoFieldMask := &googlefieldmaskpb.FieldMask{} 16982 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 16983 return err 16984 } 16985 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 16986 return err 16987 } 16988 return nil 16989 } 16990 16991 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Size() int { 16992 return proto.Size(fieldMask.ToProtoFieldMask()) 16993 } 16994 16995 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) MarshalJSON() ([]byte, error) { 16996 return json.Marshal(fieldMask.ToProtoFieldMask()) 16997 } 16998 16999 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) UnmarshalJSON(data []byte) error { 17000 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17001 if err := json.Unmarshal(data, protoFieldMask); err != nil { 17002 return err 17003 } 17004 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17005 return err 17006 } 17007 return nil 17008 } 17009 17010 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath) { 17011 fieldMask.Paths = append(fieldMask.Paths, path) 17012 } 17013 17014 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 17015 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath)) 17016 } 17017 17018 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath { 17019 if fieldMask == nil { 17020 return nil 17021 } 17022 return fieldMask.Paths 17023 } 17024 17025 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) GetRawPaths() []gotenobject.FieldPath { 17026 if fieldMask == nil { 17027 return nil 17028 } 17029 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 17030 for _, path := range fieldMask.Paths { 17031 rawPaths = append(rawPaths, path) 17032 } 17033 return rawPaths 17034 } 17035 17036 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) SetFromCliFlag(raw string) error { 17037 path, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(raw) 17038 if err != nil { 17039 return err 17040 } 17041 fieldMask.Paths = append(fieldMask.Paths, path) 17042 return nil 17043 } 17044 17045 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) { 17046 for _, path := range fieldMask.Paths { 17047 val, _ := path.GetSingle(source) 17048 // if val is nil, then field does not exist in source, skip 17049 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 17050 if val != nil { 17051 path.WithIValue(val).SetTo(&target) 17052 } 17053 } 17054 } 17055 17056 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 17057 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard), source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 17058 } 17059 17060 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard { 17061 if source == nil { 17062 return nil 17063 } 17064 if fieldMask == nil { 17065 return source 17066 } 17067 result := &Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard{} 17068 deviceMask := &Device_Status_DeviceInfo_HardwareInformation_PCIDevice_FieldMask{} 17069 wholeDeviceAccepted := false 17070 17071 for _, p := range fieldMask.Paths { 17072 switch tp := p.(type) { 17073 case *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: 17074 switch tp.selector { 17075 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 17076 result.Index = source.Index 17077 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 17078 result.Device = source.Device 17079 wholeDeviceAccepted = true 17080 } 17081 case *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath: 17082 switch tp.selector { 17083 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 17084 deviceMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath)) 17085 } 17086 } 17087 } 17088 if wholeDeviceAccepted == false && len(deviceMask.Paths) > 0 { 17089 result.Device = deviceMask.Project(source.GetDevice()) 17090 } 17091 return result 17092 } 17093 17094 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 17095 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 17096 } 17097 17098 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard_FieldMask) PathsCount() int { 17099 if fieldMask == nil { 17100 return 0 17101 } 17102 return len(fieldMask.Paths) 17103 } 17104 17105 type Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask struct { 17106 Paths []DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath 17107 } 17108 17109 func FullDevice_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask { 17110 res := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask{} 17111 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorDescription}) 17112 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorSizeBytes}) 17113 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks}) 17114 return res 17115 } 17116 17117 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) String() string { 17118 if fieldMask == nil { 17119 return "<nil>" 17120 } 17121 pathsStr := make([]string, 0, len(fieldMask.Paths)) 17122 for _, path := range fieldMask.Paths { 17123 pathsStr = append(pathsStr, path.String()) 17124 } 17125 return strings.Join(pathsStr, ", ") 17126 } 17127 17128 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) IsFull() bool { 17129 if fieldMask == nil { 17130 return false 17131 } 17132 presentSelectors := make([]bool, 3) 17133 for _, path := range fieldMask.Paths { 17134 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath); ok { 17135 presentSelectors[int(asFinal.selector)] = true 17136 } 17137 } 17138 for _, flag := range presentSelectors { 17139 if !flag { 17140 return false 17141 } 17142 } 17143 return true 17144 } 17145 17146 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) ProtoReflect() preflect.Message { 17147 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 17148 return ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath(raw) 17149 }) 17150 } 17151 17152 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) ProtoMessage() { 17153 } 17154 17155 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Reset() { 17156 if fieldMask != nil { 17157 fieldMask.Paths = nil 17158 } 17159 } 17160 17161 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask { 17162 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask{} 17163 removedSelectors := make([]bool, 3) 17164 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelector]gotenobject.FieldMask{ 17165 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks: &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask{}, 17166 } 17167 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelector]gotenobject.FieldMask{ 17168 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks: &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask{}, 17169 } 17170 17171 for _, path := range other.GetPaths() { 17172 switch tp := path.(type) { 17173 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath: 17174 removedSelectors[int(tp.selector)] = true 17175 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldSubPath: 17176 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 17177 } 17178 } 17179 for _, path := range fieldMask.GetPaths() { 17180 if !removedSelectors[int(path.Selector())] { 17181 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 17182 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath); ok { 17183 switch tp.selector { 17184 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks: 17185 mySubMasks[DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks] = FullDevice_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask() 17186 } 17187 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldSubPath); ok { 17188 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 17189 } 17190 } else { 17191 result.Paths = append(result.Paths, path) 17192 } 17193 } 17194 } 17195 for selector, mySubMask := range mySubMasks { 17196 if mySubMask.PathsCount() > 0 { 17197 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 17198 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldSubPath{selector: selector, subPath: allowedPath}) 17199 } 17200 } 17201 } 17202 17203 if len(result.Paths) == 0 { 17204 return nil 17205 } 17206 return result 17207 } 17208 17209 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 17210 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask)) 17211 } 17212 17213 // FilterInputFields generates copy of field paths with output_only field paths removed 17214 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask { 17215 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask{} 17216 result.Paths = append(result.Paths, fieldMask.Paths...) 17217 return result 17218 } 17219 17220 // ToFieldMask is used for proto conversions 17221 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 17222 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17223 for _, path := range fieldMask.Paths { 17224 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 17225 } 17226 return protoFieldMask 17227 } 17228 17229 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 17230 if fieldMask == nil { 17231 return status.Error(codes.Internal, "target field mask is nil") 17232 } 17233 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath, 0, len(protoFieldMask.Paths)) 17234 for _, strPath := range protoFieldMask.Paths { 17235 path, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath(strPath) 17236 if err != nil { 17237 return err 17238 } 17239 fieldMask.Paths = append(fieldMask.Paths, path) 17240 } 17241 return nil 17242 } 17243 17244 // implement methods required by customType 17245 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Marshal() ([]byte, error) { 17246 protoFieldMask := fieldMask.ToProtoFieldMask() 17247 return proto.Marshal(protoFieldMask) 17248 } 17249 17250 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Unmarshal(data []byte) error { 17251 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17252 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 17253 return err 17254 } 17255 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17256 return err 17257 } 17258 return nil 17259 } 17260 17261 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Size() int { 17262 return proto.Size(fieldMask.ToProtoFieldMask()) 17263 } 17264 17265 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) MarshalJSON() ([]byte, error) { 17266 return json.Marshal(fieldMask.ToProtoFieldMask()) 17267 } 17268 17269 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) UnmarshalJSON(data []byte) error { 17270 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17271 if err := json.Unmarshal(data, protoFieldMask); err != nil { 17272 return err 17273 } 17274 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17275 return err 17276 } 17277 return nil 17278 } 17279 17280 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath) { 17281 fieldMask.Paths = append(fieldMask.Paths, path) 17282 } 17283 17284 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 17285 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath)) 17286 } 17287 17288 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath { 17289 if fieldMask == nil { 17290 return nil 17291 } 17292 return fieldMask.Paths 17293 } 17294 17295 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) GetRawPaths() []gotenobject.FieldPath { 17296 if fieldMask == nil { 17297 return nil 17298 } 17299 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 17300 for _, path := range fieldMask.Paths { 17301 rawPaths = append(rawPaths, path) 17302 } 17303 return rawPaths 17304 } 17305 17306 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) SetFromCliFlag(raw string) error { 17307 path, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPath(raw) 17308 if err != nil { 17309 return err 17310 } 17311 fieldMask.Paths = append(fieldMask.Paths, path) 17312 return nil 17313 } 17314 17315 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory) { 17316 for _, path := range fieldMask.Paths { 17317 val, _ := path.GetSingle(source) 17318 // if val is nil, then field does not exist in source, skip 17319 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 17320 if val != nil { 17321 path.WithIValue(val).SetTo(&target) 17322 } 17323 } 17324 } 17325 17326 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 17327 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory), source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory)) 17328 } 17329 17330 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory) *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory { 17331 if source == nil { 17332 return nil 17333 } 17334 if fieldMask == nil { 17335 return source 17336 } 17337 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory{} 17338 memoryBanksMask := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask{} 17339 wholeMemoryBanksAccepted := false 17340 17341 for _, p := range fieldMask.Paths { 17342 switch tp := p.(type) { 17343 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldTerminalPath: 17344 switch tp.selector { 17345 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorDescription: 17346 result.Description = source.Description 17347 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorSizeBytes: 17348 result.SizeBytes = source.SizeBytes 17349 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks: 17350 result.MemoryBanks = source.MemoryBanks 17351 wholeMemoryBanksAccepted = true 17352 } 17353 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldSubPath: 17354 switch tp.selector { 17355 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemory_FieldPathSelectorMemoryBanks: 17356 memoryBanksMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath)) 17357 } 17358 } 17359 } 17360 if wholeMemoryBanksAccepted == false && len(memoryBanksMask.Paths) > 0 { 17361 for _, sourceItem := range source.GetMemoryBanks() { 17362 result.MemoryBanks = append(result.MemoryBanks, memoryBanksMask.Project(sourceItem)) 17363 } 17364 } 17365 return result 17366 } 17367 17368 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 17369 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory)) 17370 } 17371 17372 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_FieldMask) PathsCount() int { 17373 if fieldMask == nil { 17374 return 0 17375 } 17376 return len(fieldMask.Paths) 17377 } 17378 17379 type Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask struct { 17380 Paths []DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath 17381 } 17382 17383 func FullDevice_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask { 17384 res := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask{} 17385 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorDescription}) 17386 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorProduct}) 17387 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorVendor}) 17388 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorSerial}) 17389 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorSlot}) 17390 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorSizeBytes}) 17391 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorFrequencyHz}) 17392 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorWidthBits}) 17393 return res 17394 } 17395 17396 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) String() string { 17397 if fieldMask == nil { 17398 return "<nil>" 17399 } 17400 pathsStr := make([]string, 0, len(fieldMask.Paths)) 17401 for _, path := range fieldMask.Paths { 17402 pathsStr = append(pathsStr, path.String()) 17403 } 17404 return strings.Join(pathsStr, ", ") 17405 } 17406 17407 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) IsFull() bool { 17408 if fieldMask == nil { 17409 return false 17410 } 17411 presentSelectors := make([]bool, 8) 17412 for _, path := range fieldMask.Paths { 17413 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath); ok { 17414 presentSelectors[int(asFinal.selector)] = true 17415 } 17416 } 17417 for _, flag := range presentSelectors { 17418 if !flag { 17419 return false 17420 } 17421 } 17422 return true 17423 } 17424 17425 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) ProtoReflect() preflect.Message { 17426 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 17427 return ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath(raw) 17428 }) 17429 } 17430 17431 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) ProtoMessage() { 17432 } 17433 17434 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Reset() { 17435 if fieldMask != nil { 17436 fieldMask.Paths = nil 17437 } 17438 } 17439 17440 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask { 17441 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask{} 17442 removedSelectors := make([]bool, 8) 17443 17444 for _, path := range other.GetPaths() { 17445 switch tp := path.(type) { 17446 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath: 17447 removedSelectors[int(tp.selector)] = true 17448 } 17449 } 17450 for _, path := range fieldMask.GetPaths() { 17451 if !removedSelectors[int(path.Selector())] { 17452 result.Paths = append(result.Paths, path) 17453 } 17454 } 17455 17456 if len(result.Paths) == 0 { 17457 return nil 17458 } 17459 return result 17460 } 17461 17462 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 17463 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask)) 17464 } 17465 17466 // FilterInputFields generates copy of field paths with output_only field paths removed 17467 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask { 17468 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask{} 17469 result.Paths = append(result.Paths, fieldMask.Paths...) 17470 return result 17471 } 17472 17473 // ToFieldMask is used for proto conversions 17474 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 17475 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17476 for _, path := range fieldMask.Paths { 17477 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 17478 } 17479 return protoFieldMask 17480 } 17481 17482 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 17483 if fieldMask == nil { 17484 return status.Error(codes.Internal, "target field mask is nil") 17485 } 17486 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath, 0, len(protoFieldMask.Paths)) 17487 for _, strPath := range protoFieldMask.Paths { 17488 path, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath(strPath) 17489 if err != nil { 17490 return err 17491 } 17492 fieldMask.Paths = append(fieldMask.Paths, path) 17493 } 17494 return nil 17495 } 17496 17497 // implement methods required by customType 17498 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Marshal() ([]byte, error) { 17499 protoFieldMask := fieldMask.ToProtoFieldMask() 17500 return proto.Marshal(protoFieldMask) 17501 } 17502 17503 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Unmarshal(data []byte) error { 17504 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17505 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 17506 return err 17507 } 17508 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17509 return err 17510 } 17511 return nil 17512 } 17513 17514 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Size() int { 17515 return proto.Size(fieldMask.ToProtoFieldMask()) 17516 } 17517 17518 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) MarshalJSON() ([]byte, error) { 17519 return json.Marshal(fieldMask.ToProtoFieldMask()) 17520 } 17521 17522 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) UnmarshalJSON(data []byte) error { 17523 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17524 if err := json.Unmarshal(data, protoFieldMask); err != nil { 17525 return err 17526 } 17527 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17528 return err 17529 } 17530 return nil 17531 } 17532 17533 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath) { 17534 fieldMask.Paths = append(fieldMask.Paths, path) 17535 } 17536 17537 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 17538 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath)) 17539 } 17540 17541 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath { 17542 if fieldMask == nil { 17543 return nil 17544 } 17545 return fieldMask.Paths 17546 } 17547 17548 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) GetRawPaths() []gotenobject.FieldPath { 17549 if fieldMask == nil { 17550 return nil 17551 } 17552 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 17553 for _, path := range fieldMask.Paths { 17554 rawPaths = append(rawPaths, path) 17555 } 17556 return rawPaths 17557 } 17558 17559 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) SetFromCliFlag(raw string) error { 17560 path, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPath(raw) 17561 if err != nil { 17562 return err 17563 } 17564 fieldMask.Paths = append(fieldMask.Paths, path) 17565 return nil 17566 } 17567 17568 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank) { 17569 for _, path := range fieldMask.Paths { 17570 val, _ := path.GetSingle(source) 17571 // if val is nil, then field does not exist in source, skip 17572 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 17573 if val != nil { 17574 path.WithIValue(val).SetTo(&target) 17575 } 17576 } 17577 } 17578 17579 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 17580 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank), source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank)) 17581 } 17582 17583 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank) *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank { 17584 if source == nil { 17585 return nil 17586 } 17587 if fieldMask == nil { 17588 return source 17589 } 17590 result := &Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank{} 17591 17592 for _, p := range fieldMask.Paths { 17593 switch tp := p.(type) { 17594 case *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldTerminalPath: 17595 switch tp.selector { 17596 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorDescription: 17597 result.Description = source.Description 17598 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorProduct: 17599 result.Product = source.Product 17600 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorVendor: 17601 result.Vendor = source.Vendor 17602 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorSerial: 17603 result.Serial = source.Serial 17604 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorSlot: 17605 result.Slot = source.Slot 17606 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorSizeBytes: 17607 result.SizeBytes = source.SizeBytes 17608 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorFrequencyHz: 17609 result.FrequencyHz = source.FrequencyHz 17610 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryMemoryBank_FieldPathSelectorWidthBits: 17611 result.WidthBits = source.WidthBits 17612 } 17613 } 17614 } 17615 return result 17616 } 17617 17618 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 17619 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank)) 17620 } 17621 17622 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_Memory_MemoryBank_FieldMask) PathsCount() int { 17623 if fieldMask == nil { 17624 return 0 17625 } 17626 return len(fieldMask.Paths) 17627 } 17628 17629 type Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask struct { 17630 Paths []DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath 17631 } 17632 17633 func FullDevice_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask { 17634 res := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask{} 17635 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId}) 17636 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion}) 17637 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion}) 17638 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion}) 17639 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName}) 17640 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber}) 17641 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber}) 17642 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName}) 17643 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate}) 17644 return res 17645 } 17646 17647 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) String() string { 17648 if fieldMask == nil { 17649 return "<nil>" 17650 } 17651 pathsStr := make([]string, 0, len(fieldMask.Paths)) 17652 for _, path := range fieldMask.Paths { 17653 pathsStr = append(pathsStr, path.String()) 17654 } 17655 return strings.Join(pathsStr, ", ") 17656 } 17657 17658 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) IsFull() bool { 17659 if fieldMask == nil { 17660 return false 17661 } 17662 presentSelectors := make([]bool, 9) 17663 for _, path := range fieldMask.Paths { 17664 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath); ok { 17665 presentSelectors[int(asFinal.selector)] = true 17666 } 17667 } 17668 for _, flag := range presentSelectors { 17669 if !flag { 17670 return false 17671 } 17672 } 17673 return true 17674 } 17675 17676 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) ProtoReflect() preflect.Message { 17677 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 17678 return ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(raw) 17679 }) 17680 } 17681 17682 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) ProtoMessage() { 17683 } 17684 17685 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Reset() { 17686 if fieldMask != nil { 17687 fieldMask.Paths = nil 17688 } 17689 } 17690 17691 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask { 17692 result := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask{} 17693 removedSelectors := make([]bool, 9) 17694 17695 for _, path := range other.GetPaths() { 17696 switch tp := path.(type) { 17697 case *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: 17698 removedSelectors[int(tp.selector)] = true 17699 } 17700 } 17701 for _, path := range fieldMask.GetPaths() { 17702 if !removedSelectors[int(path.Selector())] { 17703 result.Paths = append(result.Paths, path) 17704 } 17705 } 17706 17707 if len(result.Paths) == 0 { 17708 return nil 17709 } 17710 return result 17711 } 17712 17713 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 17714 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask)) 17715 } 17716 17717 // FilterInputFields generates copy of field paths with output_only field paths removed 17718 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask { 17719 result := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask{} 17720 result.Paths = append(result.Paths, fieldMask.Paths...) 17721 return result 17722 } 17723 17724 // ToFieldMask is used for proto conversions 17725 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 17726 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17727 for _, path := range fieldMask.Paths { 17728 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 17729 } 17730 return protoFieldMask 17731 } 17732 17733 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 17734 if fieldMask == nil { 17735 return status.Error(codes.Internal, "target field mask is nil") 17736 } 17737 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath, 0, len(protoFieldMask.Paths)) 17738 for _, strPath := range protoFieldMask.Paths { 17739 path, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(strPath) 17740 if err != nil { 17741 return err 17742 } 17743 fieldMask.Paths = append(fieldMask.Paths, path) 17744 } 17745 return nil 17746 } 17747 17748 // implement methods required by customType 17749 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Marshal() ([]byte, error) { 17750 protoFieldMask := fieldMask.ToProtoFieldMask() 17751 return proto.Marshal(protoFieldMask) 17752 } 17753 17754 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Unmarshal(data []byte) error { 17755 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17756 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 17757 return err 17758 } 17759 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17760 return err 17761 } 17762 return nil 17763 } 17764 17765 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Size() int { 17766 return proto.Size(fieldMask.ToProtoFieldMask()) 17767 } 17768 17769 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) MarshalJSON() ([]byte, error) { 17770 return json.Marshal(fieldMask.ToProtoFieldMask()) 17771 } 17772 17773 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) UnmarshalJSON(data []byte) error { 17774 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17775 if err := json.Unmarshal(data, protoFieldMask); err != nil { 17776 return err 17777 } 17778 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 17779 return err 17780 } 17781 return nil 17782 } 17783 17784 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath) { 17785 fieldMask.Paths = append(fieldMask.Paths, path) 17786 } 17787 17788 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 17789 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath)) 17790 } 17791 17792 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath { 17793 if fieldMask == nil { 17794 return nil 17795 } 17796 return fieldMask.Paths 17797 } 17798 17799 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 17800 if fieldMask == nil { 17801 return nil 17802 } 17803 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 17804 for _, path := range fieldMask.Paths { 17805 rawPaths = append(rawPaths, path) 17806 } 17807 return rawPaths 17808 } 17809 17810 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) SetFromCliFlag(raw string) error { 17811 path, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(raw) 17812 if err != nil { 17813 return err 17814 } 17815 fieldMask.Paths = append(fieldMask.Paths, path) 17816 return nil 17817 } 17818 17819 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) { 17820 for _, path := range fieldMask.Paths { 17821 val, _ := path.GetSingle(source) 17822 // if val is nil, then field does not exist in source, skip 17823 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 17824 if val != nil { 17825 path.WithIValue(val).SetTo(&target) 17826 } 17827 } 17828 } 17829 17830 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 17831 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo), source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 17832 } 17833 17834 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo { 17835 if source == nil { 17836 return nil 17837 } 17838 if fieldMask == nil { 17839 return source 17840 } 17841 result := &Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo{} 17842 17843 for _, p := range fieldMask.Paths { 17844 switch tp := p.(type) { 17845 case *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: 17846 switch tp.selector { 17847 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 17848 result.DevId = source.DevId 17849 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 17850 result.ControlProtoVersion = source.ControlProtoVersion 17851 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 17852 result.FirmwareVersion = source.FirmwareVersion 17853 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 17854 result.LoggerVersion = source.LoggerVersion 17855 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 17856 result.BoardName = source.BoardName 17857 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 17858 result.SerialNumber = source.SerialNumber 17859 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 17860 result.PartNumber = source.PartNumber 17861 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 17862 result.ProductName = source.ProductName 17863 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 17864 result.NeuralNetworkCoreClockRate = source.NeuralNetworkCoreClockRate 17865 } 17866 } 17867 } 17868 return result 17869 } 17870 17871 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 17872 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 17873 } 17874 17875 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo_FieldMask) PathsCount() int { 17876 if fieldMask == nil { 17877 return 0 17878 } 17879 return len(fieldMask.Paths) 17880 } 17881 17882 type Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask struct { 17883 Paths []DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath 17884 } 17885 17886 func FullDevice_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask { 17887 res := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask{} 17888 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId}) 17889 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName}) 17890 return res 17891 } 17892 17893 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) String() string { 17894 if fieldMask == nil { 17895 return "<nil>" 17896 } 17897 pathsStr := make([]string, 0, len(fieldMask.Paths)) 17898 for _, path := range fieldMask.Paths { 17899 pathsStr = append(pathsStr, path.String()) 17900 } 17901 return strings.Join(pathsStr, ", ") 17902 } 17903 17904 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) IsFull() bool { 17905 if fieldMask == nil { 17906 return false 17907 } 17908 presentSelectors := make([]bool, 2) 17909 for _, path := range fieldMask.Paths { 17910 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath); ok { 17911 presentSelectors[int(asFinal.selector)] = true 17912 } 17913 } 17914 for _, flag := range presentSelectors { 17915 if !flag { 17916 return false 17917 } 17918 } 17919 return true 17920 } 17921 17922 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) ProtoReflect() preflect.Message { 17923 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 17924 return ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(raw) 17925 }) 17926 } 17927 17928 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) ProtoMessage() { 17929 } 17930 17931 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Reset() { 17932 if fieldMask != nil { 17933 fieldMask.Paths = nil 17934 } 17935 } 17936 17937 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask { 17938 result := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask{} 17939 removedSelectors := make([]bool, 2) 17940 17941 for _, path := range other.GetPaths() { 17942 switch tp := path.(type) { 17943 case *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: 17944 removedSelectors[int(tp.selector)] = true 17945 } 17946 } 17947 for _, path := range fieldMask.GetPaths() { 17948 if !removedSelectors[int(path.Selector())] { 17949 result.Paths = append(result.Paths, path) 17950 } 17951 } 17952 17953 if len(result.Paths) == 0 { 17954 return nil 17955 } 17956 return result 17957 } 17958 17959 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 17960 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask)) 17961 } 17962 17963 // FilterInputFields generates copy of field paths with output_only field paths removed 17964 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask { 17965 result := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask{} 17966 result.Paths = append(result.Paths, fieldMask.Paths...) 17967 return result 17968 } 17969 17970 // ToFieldMask is used for proto conversions 17971 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 17972 protoFieldMask := &googlefieldmaskpb.FieldMask{} 17973 for _, path := range fieldMask.Paths { 17974 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 17975 } 17976 return protoFieldMask 17977 } 17978 17979 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 17980 if fieldMask == nil { 17981 return status.Error(codes.Internal, "target field mask is nil") 17982 } 17983 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath, 0, len(protoFieldMask.Paths)) 17984 for _, strPath := range protoFieldMask.Paths { 17985 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(strPath) 17986 if err != nil { 17987 return err 17988 } 17989 fieldMask.Paths = append(fieldMask.Paths, path) 17990 } 17991 return nil 17992 } 17993 17994 // implement methods required by customType 17995 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Marshal() ([]byte, error) { 17996 protoFieldMask := fieldMask.ToProtoFieldMask() 17997 return proto.Marshal(protoFieldMask) 17998 } 17999 18000 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Unmarshal(data []byte) error { 18001 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18002 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 18003 return err 18004 } 18005 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18006 return err 18007 } 18008 return nil 18009 } 18010 18011 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Size() int { 18012 return proto.Size(fieldMask.ToProtoFieldMask()) 18013 } 18014 18015 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) MarshalJSON() ([]byte, error) { 18016 return json.Marshal(fieldMask.ToProtoFieldMask()) 18017 } 18018 18019 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) UnmarshalJSON(data []byte) error { 18020 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18021 if err := json.Unmarshal(data, protoFieldMask); err != nil { 18022 return err 18023 } 18024 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18025 return err 18026 } 18027 return nil 18028 } 18029 18030 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath) { 18031 fieldMask.Paths = append(fieldMask.Paths, path) 18032 } 18033 18034 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 18035 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath)) 18036 } 18037 18038 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath { 18039 if fieldMask == nil { 18040 return nil 18041 } 18042 return fieldMask.Paths 18043 } 18044 18045 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 18046 if fieldMask == nil { 18047 return nil 18048 } 18049 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 18050 for _, path := range fieldMask.Paths { 18051 rawPaths = append(rawPaths, path) 18052 } 18053 return rawPaths 18054 } 18055 18056 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) SetFromCliFlag(raw string) error { 18057 path, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(raw) 18058 if err != nil { 18059 return err 18060 } 18061 fieldMask.Paths = append(fieldMask.Paths, path) 18062 return nil 18063 } 18064 18065 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) { 18066 for _, path := range fieldMask.Paths { 18067 val, _ := path.GetSingle(source) 18068 // if val is nil, then field does not exist in source, skip 18069 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 18070 if val != nil { 18071 path.WithIValue(val).SetTo(&target) 18072 } 18073 } 18074 } 18075 18076 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 18077 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo), source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 18078 } 18079 18080 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo { 18081 if source == nil { 18082 return nil 18083 } 18084 if fieldMask == nil { 18085 return source 18086 } 18087 result := &Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo{} 18088 18089 for _, p := range fieldMask.Paths { 18090 switch tp := p.(type) { 18091 case *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: 18092 switch tp.selector { 18093 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 18094 result.Id = source.Id 18095 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 18096 result.ProductName = source.ProductName 18097 } 18098 } 18099 } 18100 return result 18101 } 18102 18103 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 18104 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 18105 } 18106 18107 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo_FieldMask) PathsCount() int { 18108 if fieldMask == nil { 18109 return 0 18110 } 18111 return len(fieldMask.Paths) 18112 } 18113 18114 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask struct { 18115 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath 18116 } 18117 18118 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask { 18119 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask{} 18120 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle}) 18121 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode}) 18122 return res 18123 } 18124 18125 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) String() string { 18126 if fieldMask == nil { 18127 return "<nil>" 18128 } 18129 pathsStr := make([]string, 0, len(fieldMask.Paths)) 18130 for _, path := range fieldMask.Paths { 18131 pathsStr = append(pathsStr, path.String()) 18132 } 18133 return strings.Join(pathsStr, ", ") 18134 } 18135 18136 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) IsFull() bool { 18137 if fieldMask == nil { 18138 return false 18139 } 18140 presentSelectors := make([]bool, 2) 18141 for _, path := range fieldMask.Paths { 18142 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath); ok { 18143 presentSelectors[int(asFinal.selector)] = true 18144 } 18145 } 18146 for _, flag := range presentSelectors { 18147 if !flag { 18148 return false 18149 } 18150 } 18151 return true 18152 } 18153 18154 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) ProtoReflect() preflect.Message { 18155 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 18156 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(raw) 18157 }) 18158 } 18159 18160 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) ProtoMessage() { 18161 } 18162 18163 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Reset() { 18164 if fieldMask != nil { 18165 fieldMask.Paths = nil 18166 } 18167 } 18168 18169 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask { 18170 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask{} 18171 removedSelectors := make([]bool, 2) 18172 18173 for _, path := range other.GetPaths() { 18174 switch tp := path.(type) { 18175 case *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: 18176 removedSelectors[int(tp.selector)] = true 18177 } 18178 } 18179 for _, path := range fieldMask.GetPaths() { 18180 if !removedSelectors[int(path.Selector())] { 18181 result.Paths = append(result.Paths, path) 18182 } 18183 } 18184 18185 if len(result.Paths) == 0 { 18186 return nil 18187 } 18188 return result 18189 } 18190 18191 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 18192 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask)) 18193 } 18194 18195 // FilterInputFields generates copy of field paths with output_only field paths removed 18196 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask { 18197 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask{} 18198 result.Paths = append(result.Paths, fieldMask.Paths...) 18199 return result 18200 } 18201 18202 // ToFieldMask is used for proto conversions 18203 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 18204 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18205 for _, path := range fieldMask.Paths { 18206 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 18207 } 18208 return protoFieldMask 18209 } 18210 18211 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 18212 if fieldMask == nil { 18213 return status.Error(codes.Internal, "target field mask is nil") 18214 } 18215 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath, 0, len(protoFieldMask.Paths)) 18216 for _, strPath := range protoFieldMask.Paths { 18217 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(strPath) 18218 if err != nil { 18219 return err 18220 } 18221 fieldMask.Paths = append(fieldMask.Paths, path) 18222 } 18223 return nil 18224 } 18225 18226 // implement methods required by customType 18227 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Marshal() ([]byte, error) { 18228 protoFieldMask := fieldMask.ToProtoFieldMask() 18229 return proto.Marshal(protoFieldMask) 18230 } 18231 18232 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Unmarshal(data []byte) error { 18233 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18234 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 18235 return err 18236 } 18237 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18238 return err 18239 } 18240 return nil 18241 } 18242 18243 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Size() int { 18244 return proto.Size(fieldMask.ToProtoFieldMask()) 18245 } 18246 18247 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) MarshalJSON() ([]byte, error) { 18248 return json.Marshal(fieldMask.ToProtoFieldMask()) 18249 } 18250 18251 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) UnmarshalJSON(data []byte) error { 18252 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18253 if err := json.Unmarshal(data, protoFieldMask); err != nil { 18254 return err 18255 } 18256 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18257 return err 18258 } 18259 return nil 18260 } 18261 18262 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath) { 18263 fieldMask.Paths = append(fieldMask.Paths, path) 18264 } 18265 18266 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 18267 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath)) 18268 } 18269 18270 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath { 18271 if fieldMask == nil { 18272 return nil 18273 } 18274 return fieldMask.Paths 18275 } 18276 18277 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) GetRawPaths() []gotenobject.FieldPath { 18278 if fieldMask == nil { 18279 return nil 18280 } 18281 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 18282 for _, path := range fieldMask.Paths { 18283 rawPaths = append(rawPaths, path) 18284 } 18285 return rawPaths 18286 } 18287 18288 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) SetFromCliFlag(raw string) error { 18289 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(raw) 18290 if err != nil { 18291 return err 18292 } 18293 fieldMask.Paths = append(fieldMask.Paths, path) 18294 return nil 18295 } 18296 18297 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) { 18298 for _, path := range fieldMask.Paths { 18299 val, _ := path.GetSingle(source) 18300 // if val is nil, then field does not exist in source, skip 18301 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 18302 if val != nil { 18303 path.WithIValue(val).SetTo(&target) 18304 } 18305 } 18306 } 18307 18308 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 18309 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 18310 } 18311 18312 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings { 18313 if source == nil { 18314 return nil 18315 } 18316 if fieldMask == nil { 18317 return source 18318 } 18319 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings{} 18320 18321 for _, p := range fieldMask.Paths { 18322 switch tp := p.(type) { 18323 case *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: 18324 switch tp.selector { 18325 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 18326 result.DrxCycle = source.DrxCycle 18327 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 18328 result.MicoMode = source.MicoMode 18329 } 18330 } 18331 } 18332 return result 18333 } 18334 18335 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 18336 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 18337 } 18338 18339 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask) PathsCount() int { 18340 if fieldMask == nil { 18341 return 0 18342 } 18343 return len(fieldMask.Paths) 18344 } 18345 18346 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask struct { 18347 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 18348 } 18349 18350 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask { 18351 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask{} 18352 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings}) 18353 return res 18354 } 18355 18356 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) String() string { 18357 if fieldMask == nil { 18358 return "<nil>" 18359 } 18360 pathsStr := make([]string, 0, len(fieldMask.Paths)) 18361 for _, path := range fieldMask.Paths { 18362 pathsStr = append(pathsStr, path.String()) 18363 } 18364 return strings.Join(pathsStr, ", ") 18365 } 18366 18367 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) IsFull() bool { 18368 if fieldMask == nil { 18369 return false 18370 } 18371 presentSelectors := make([]bool, 1) 18372 for _, path := range fieldMask.Paths { 18373 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath); ok { 18374 presentSelectors[int(asFinal.selector)] = true 18375 } 18376 } 18377 for _, flag := range presentSelectors { 18378 if !flag { 18379 return false 18380 } 18381 } 18382 return true 18383 } 18384 18385 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) ProtoReflect() preflect.Message { 18386 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 18387 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(raw) 18388 }) 18389 } 18390 18391 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) ProtoMessage() { 18392 } 18393 18394 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Reset() { 18395 if fieldMask != nil { 18396 fieldMask.Paths = nil 18397 } 18398 } 18399 18400 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask { 18401 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask{} 18402 removedSelectors := make([]bool, 1) 18403 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector]gotenobject.FieldMask{ 18404 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask{}, 18405 } 18406 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector]gotenobject.FieldMask{ 18407 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask{}, 18408 } 18409 18410 for _, path := range other.GetPaths() { 18411 switch tp := path.(type) { 18412 case *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath: 18413 removedSelectors[int(tp.selector)] = true 18414 case *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath: 18415 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 18416 } 18417 } 18418 for _, path := range fieldMask.GetPaths() { 18419 if !removedSelectors[int(path.Selector())] { 18420 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 18421 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath); ok { 18422 switch tp.selector { 18423 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 18424 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask() 18425 } 18426 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath); ok { 18427 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 18428 } 18429 } else { 18430 result.Paths = append(result.Paths, path) 18431 } 18432 } 18433 } 18434 for selector, mySubMask := range mySubMasks { 18435 if mySubMask.PathsCount() > 0 { 18436 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 18437 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath{selector: selector, subPath: allowedPath}) 18438 } 18439 } 18440 } 18441 18442 if len(result.Paths) == 0 { 18443 return nil 18444 } 18445 return result 18446 } 18447 18448 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 18449 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask)) 18450 } 18451 18452 // FilterInputFields generates copy of field paths with output_only field paths removed 18453 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask { 18454 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask{} 18455 result.Paths = append(result.Paths, fieldMask.Paths...) 18456 return result 18457 } 18458 18459 // ToFieldMask is used for proto conversions 18460 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 18461 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18462 for _, path := range fieldMask.Paths { 18463 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 18464 } 18465 return protoFieldMask 18466 } 18467 18468 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 18469 if fieldMask == nil { 18470 return status.Error(codes.Internal, "target field mask is nil") 18471 } 18472 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath, 0, len(protoFieldMask.Paths)) 18473 for _, strPath := range protoFieldMask.Paths { 18474 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(strPath) 18475 if err != nil { 18476 return err 18477 } 18478 fieldMask.Paths = append(fieldMask.Paths, path) 18479 } 18480 return nil 18481 } 18482 18483 // implement methods required by customType 18484 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Marshal() ([]byte, error) { 18485 protoFieldMask := fieldMask.ToProtoFieldMask() 18486 return proto.Marshal(protoFieldMask) 18487 } 18488 18489 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Unmarshal(data []byte) error { 18490 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18491 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 18492 return err 18493 } 18494 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18495 return err 18496 } 18497 return nil 18498 } 18499 18500 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Size() int { 18501 return proto.Size(fieldMask.ToProtoFieldMask()) 18502 } 18503 18504 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) MarshalJSON() ([]byte, error) { 18505 return json.Marshal(fieldMask.ToProtoFieldMask()) 18506 } 18507 18508 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) UnmarshalJSON(data []byte) error { 18509 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18510 if err := json.Unmarshal(data, protoFieldMask); err != nil { 18511 return err 18512 } 18513 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18514 return err 18515 } 18516 return nil 18517 } 18518 18519 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath) { 18520 fieldMask.Paths = append(fieldMask.Paths, path) 18521 } 18522 18523 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 18524 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath)) 18525 } 18526 18527 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath { 18528 if fieldMask == nil { 18529 return nil 18530 } 18531 return fieldMask.Paths 18532 } 18533 18534 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) GetRawPaths() []gotenobject.FieldPath { 18535 if fieldMask == nil { 18536 return nil 18537 } 18538 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 18539 for _, path := range fieldMask.Paths { 18540 rawPaths = append(rawPaths, path) 18541 } 18542 return rawPaths 18543 } 18544 18545 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) SetFromCliFlag(raw string) error { 18546 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(raw) 18547 if err != nil { 18548 return err 18549 } 18550 fieldMask.Paths = append(fieldMask.Paths, path) 18551 return nil 18552 } 18553 18554 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) { 18555 for _, path := range fieldMask.Paths { 18556 val, _ := path.GetSingle(source) 18557 // if val is nil, then field does not exist in source, skip 18558 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 18559 if val != nil { 18560 path.WithIValue(val).SetTo(&target) 18561 } 18562 } 18563 } 18564 18565 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 18566 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 18567 } 18568 18569 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr { 18570 if source == nil { 18571 return nil 18572 } 18573 if fieldMask == nil { 18574 return source 18575 } 18576 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr{} 18577 registrationSettingsMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings_FieldMask{} 18578 wholeRegistrationSettingsAccepted := false 18579 18580 for _, p := range fieldMask.Paths { 18581 switch tp := p.(type) { 18582 case *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath: 18583 switch tp.selector { 18584 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 18585 result.RegistrationSettings = source.RegistrationSettings 18586 wholeRegistrationSettingsAccepted = true 18587 } 18588 case *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath: 18589 switch tp.selector { 18590 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 18591 registrationSettingsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath)) 18592 } 18593 } 18594 } 18595 if wholeRegistrationSettingsAccepted == false && len(registrationSettingsMask.Paths) > 0 { 18596 result.RegistrationSettings = registrationSettingsMask.Project(source.GetRegistrationSettings()) 18597 } 18598 return result 18599 } 18600 18601 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 18602 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 18603 } 18604 18605 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask) PathsCount() int { 18606 if fieldMask == nil { 18607 return 0 18608 } 18609 return len(fieldMask.Paths) 18610 } 18611 18612 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask struct { 18613 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath 18614 } 18615 18616 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask { 18617 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask{} 18618 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn}) 18619 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType}) 18620 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword}) 18621 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser}) 18622 return res 18623 } 18624 18625 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) String() string { 18626 if fieldMask == nil { 18627 return "<nil>" 18628 } 18629 pathsStr := make([]string, 0, len(fieldMask.Paths)) 18630 for _, path := range fieldMask.Paths { 18631 pathsStr = append(pathsStr, path.String()) 18632 } 18633 return strings.Join(pathsStr, ", ") 18634 } 18635 18636 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) IsFull() bool { 18637 if fieldMask == nil { 18638 return false 18639 } 18640 presentSelectors := make([]bool, 4) 18641 for _, path := range fieldMask.Paths { 18642 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath); ok { 18643 presentSelectors[int(asFinal.selector)] = true 18644 } 18645 } 18646 for _, flag := range presentSelectors { 18647 if !flag { 18648 return false 18649 } 18650 } 18651 return true 18652 } 18653 18654 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) ProtoReflect() preflect.Message { 18655 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 18656 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(raw) 18657 }) 18658 } 18659 18660 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) ProtoMessage() { 18661 } 18662 18663 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Reset() { 18664 if fieldMask != nil { 18665 fieldMask.Paths = nil 18666 } 18667 } 18668 18669 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask { 18670 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask{} 18671 removedSelectors := make([]bool, 4) 18672 18673 for _, path := range other.GetPaths() { 18674 switch tp := path.(type) { 18675 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: 18676 removedSelectors[int(tp.selector)] = true 18677 } 18678 } 18679 for _, path := range fieldMask.GetPaths() { 18680 if !removedSelectors[int(path.Selector())] { 18681 result.Paths = append(result.Paths, path) 18682 } 18683 } 18684 18685 if len(result.Paths) == 0 { 18686 return nil 18687 } 18688 return result 18689 } 18690 18691 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 18692 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask)) 18693 } 18694 18695 // FilterInputFields generates copy of field paths with output_only field paths removed 18696 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask { 18697 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask{} 18698 result.Paths = append(result.Paths, fieldMask.Paths...) 18699 return result 18700 } 18701 18702 // ToFieldMask is used for proto conversions 18703 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 18704 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18705 for _, path := range fieldMask.Paths { 18706 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 18707 } 18708 return protoFieldMask 18709 } 18710 18711 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 18712 if fieldMask == nil { 18713 return status.Error(codes.Internal, "target field mask is nil") 18714 } 18715 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath, 0, len(protoFieldMask.Paths)) 18716 for _, strPath := range protoFieldMask.Paths { 18717 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(strPath) 18718 if err != nil { 18719 return err 18720 } 18721 fieldMask.Paths = append(fieldMask.Paths, path) 18722 } 18723 return nil 18724 } 18725 18726 // implement methods required by customType 18727 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Marshal() ([]byte, error) { 18728 protoFieldMask := fieldMask.ToProtoFieldMask() 18729 return proto.Marshal(protoFieldMask) 18730 } 18731 18732 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Unmarshal(data []byte) error { 18733 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18734 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 18735 return err 18736 } 18737 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18738 return err 18739 } 18740 return nil 18741 } 18742 18743 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Size() int { 18744 return proto.Size(fieldMask.ToProtoFieldMask()) 18745 } 18746 18747 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) MarshalJSON() ([]byte, error) { 18748 return json.Marshal(fieldMask.ToProtoFieldMask()) 18749 } 18750 18751 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) UnmarshalJSON(data []byte) error { 18752 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18753 if err := json.Unmarshal(data, protoFieldMask); err != nil { 18754 return err 18755 } 18756 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 18757 return err 18758 } 18759 return nil 18760 } 18761 18762 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath) { 18763 fieldMask.Paths = append(fieldMask.Paths, path) 18764 } 18765 18766 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 18767 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath)) 18768 } 18769 18770 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath { 18771 if fieldMask == nil { 18772 return nil 18773 } 18774 return fieldMask.Paths 18775 } 18776 18777 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) GetRawPaths() []gotenobject.FieldPath { 18778 if fieldMask == nil { 18779 return nil 18780 } 18781 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 18782 for _, path := range fieldMask.Paths { 18783 rawPaths = append(rawPaths, path) 18784 } 18785 return rawPaths 18786 } 18787 18788 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) SetFromCliFlag(raw string) error { 18789 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(raw) 18790 if err != nil { 18791 return err 18792 } 18793 fieldMask.Paths = append(fieldMask.Paths, path) 18794 return nil 18795 } 18796 18797 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) { 18798 for _, path := range fieldMask.Paths { 18799 val, _ := path.GetSingle(source) 18800 // if val is nil, then field does not exist in source, skip 18801 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 18802 if val != nil { 18803 path.WithIValue(val).SetTo(&target) 18804 } 18805 } 18806 } 18807 18808 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 18809 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 18810 } 18811 18812 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings { 18813 if source == nil { 18814 return nil 18815 } 18816 if fieldMask == nil { 18817 return source 18818 } 18819 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings{} 18820 18821 for _, p := range fieldMask.Paths { 18822 switch tp := p.(type) { 18823 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: 18824 switch tp.selector { 18825 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 18826 result.Apn = source.Apn 18827 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 18828 result.IpType = source.IpType 18829 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 18830 result.Password = source.Password 18831 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 18832 result.User = source.User 18833 } 18834 } 18835 } 18836 return result 18837 } 18838 18839 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 18840 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 18841 } 18842 18843 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask) PathsCount() int { 18844 if fieldMask == nil { 18845 return 0 18846 } 18847 return len(fieldMask.Paths) 18848 } 18849 18850 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask struct { 18851 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 18852 } 18853 18854 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask { 18855 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask{} 18856 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath}) 18857 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings}) 18858 return res 18859 } 18860 18861 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) String() string { 18862 if fieldMask == nil { 18863 return "<nil>" 18864 } 18865 pathsStr := make([]string, 0, len(fieldMask.Paths)) 18866 for _, path := range fieldMask.Paths { 18867 pathsStr = append(pathsStr, path.String()) 18868 } 18869 return strings.Join(pathsStr, ", ") 18870 } 18871 18872 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) IsFull() bool { 18873 if fieldMask == nil { 18874 return false 18875 } 18876 presentSelectors := make([]bool, 2) 18877 for _, path := range fieldMask.Paths { 18878 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath); ok { 18879 presentSelectors[int(asFinal.selector)] = true 18880 } 18881 } 18882 for _, flag := range presentSelectors { 18883 if !flag { 18884 return false 18885 } 18886 } 18887 return true 18888 } 18889 18890 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) ProtoReflect() preflect.Message { 18891 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 18892 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(raw) 18893 }) 18894 } 18895 18896 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) ProtoMessage() { 18897 } 18898 18899 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Reset() { 18900 if fieldMask != nil { 18901 fieldMask.Paths = nil 18902 } 18903 } 18904 18905 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask { 18906 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask{} 18907 removedSelectors := make([]bool, 2) 18908 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector]gotenobject.FieldMask{ 18909 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask{}, 18910 } 18911 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector]gotenobject.FieldMask{ 18912 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask{}, 18913 } 18914 18915 for _, path := range other.GetPaths() { 18916 switch tp := path.(type) { 18917 case *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: 18918 removedSelectors[int(tp.selector)] = true 18919 case *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath: 18920 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 18921 } 18922 } 18923 for _, path := range fieldMask.GetPaths() { 18924 if !removedSelectors[int(path.Selector())] { 18925 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 18926 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath); ok { 18927 switch tp.selector { 18928 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 18929 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask() 18930 } 18931 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath); ok { 18932 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 18933 } 18934 } else { 18935 result.Paths = append(result.Paths, path) 18936 } 18937 } 18938 } 18939 for selector, mySubMask := range mySubMasks { 18940 if mySubMask.PathsCount() > 0 { 18941 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 18942 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath{selector: selector, subPath: allowedPath}) 18943 } 18944 } 18945 } 18946 18947 if len(result.Paths) == 0 { 18948 return nil 18949 } 18950 return result 18951 } 18952 18953 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 18954 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask)) 18955 } 18956 18957 // FilterInputFields generates copy of field paths with output_only field paths removed 18958 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask { 18959 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask{} 18960 result.Paths = append(result.Paths, fieldMask.Paths...) 18961 return result 18962 } 18963 18964 // ToFieldMask is used for proto conversions 18965 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 18966 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18967 for _, path := range fieldMask.Paths { 18968 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 18969 } 18970 return protoFieldMask 18971 } 18972 18973 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 18974 if fieldMask == nil { 18975 return status.Error(codes.Internal, "target field mask is nil") 18976 } 18977 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath, 0, len(protoFieldMask.Paths)) 18978 for _, strPath := range protoFieldMask.Paths { 18979 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(strPath) 18980 if err != nil { 18981 return err 18982 } 18983 fieldMask.Paths = append(fieldMask.Paths, path) 18984 } 18985 return nil 18986 } 18987 18988 // implement methods required by customType 18989 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Marshal() ([]byte, error) { 18990 protoFieldMask := fieldMask.ToProtoFieldMask() 18991 return proto.Marshal(protoFieldMask) 18992 } 18993 18994 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Unmarshal(data []byte) error { 18995 protoFieldMask := &googlefieldmaskpb.FieldMask{} 18996 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 18997 return err 18998 } 18999 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19000 return err 19001 } 19002 return nil 19003 } 19004 19005 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Size() int { 19006 return proto.Size(fieldMask.ToProtoFieldMask()) 19007 } 19008 19009 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) MarshalJSON() ([]byte, error) { 19010 return json.Marshal(fieldMask.ToProtoFieldMask()) 19011 } 19012 19013 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) UnmarshalJSON(data []byte) error { 19014 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19015 if err := json.Unmarshal(data, protoFieldMask); err != nil { 19016 return err 19017 } 19018 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19019 return err 19020 } 19021 return nil 19022 } 19023 19024 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath) { 19025 fieldMask.Paths = append(fieldMask.Paths, path) 19026 } 19027 19028 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 19029 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath)) 19030 } 19031 19032 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath { 19033 if fieldMask == nil { 19034 return nil 19035 } 19036 return fieldMask.Paths 19037 } 19038 19039 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) GetRawPaths() []gotenobject.FieldPath { 19040 if fieldMask == nil { 19041 return nil 19042 } 19043 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 19044 for _, path := range fieldMask.Paths { 19045 rawPaths = append(rawPaths, path) 19046 } 19047 return rawPaths 19048 } 19049 19050 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) SetFromCliFlag(raw string) error { 19051 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(raw) 19052 if err != nil { 19053 return err 19054 } 19055 fieldMask.Paths = append(fieldMask.Paths, path) 19056 return nil 19057 } 19058 19059 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) { 19060 for _, path := range fieldMask.Paths { 19061 val, _ := path.GetSingle(source) 19062 // if val is nil, then field does not exist in source, skip 19063 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 19064 if val != nil { 19065 path.WithIValue(val).SetTo(&target) 19066 } 19067 } 19068 } 19069 19070 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 19071 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 19072 } 19073 19074 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer { 19075 if source == nil { 19076 return nil 19077 } 19078 if fieldMask == nil { 19079 return source 19080 } 19081 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer{} 19082 settingsMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings_FieldMask{} 19083 wholeSettingsAccepted := false 19084 19085 for _, p := range fieldMask.Paths { 19086 switch tp := p.(type) { 19087 case *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: 19088 switch tp.selector { 19089 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 19090 result.DbusPath = source.DbusPath 19091 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 19092 result.Settings = source.Settings 19093 wholeSettingsAccepted = true 19094 } 19095 case *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath: 19096 switch tp.selector { 19097 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 19098 settingsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath)) 19099 } 19100 } 19101 } 19102 if wholeSettingsAccepted == false && len(settingsMask.Paths) > 0 { 19103 result.Settings = settingsMask.Project(source.GetSettings()) 19104 } 19105 return result 19106 } 19107 19108 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 19109 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 19110 } 19111 19112 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask) PathsCount() int { 19113 if fieldMask == nil { 19114 return 0 19115 } 19116 return len(fieldMask.Paths) 19117 } 19118 19119 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask struct { 19120 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 19121 } 19122 19123 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask { 19124 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask{} 19125 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer}) 19126 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation}) 19127 return res 19128 } 19129 19130 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) String() string { 19131 if fieldMask == nil { 19132 return "<nil>" 19133 } 19134 pathsStr := make([]string, 0, len(fieldMask.Paths)) 19135 for _, path := range fieldMask.Paths { 19136 pathsStr = append(pathsStr, path.String()) 19137 } 19138 return strings.Join(pathsStr, ", ") 19139 } 19140 19141 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) IsFull() bool { 19142 if fieldMask == nil { 19143 return false 19144 } 19145 presentSelectors := make([]bool, 2) 19146 for _, path := range fieldMask.Paths { 19147 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath); ok { 19148 presentSelectors[int(asFinal.selector)] = true 19149 } 19150 } 19151 for _, flag := range presentSelectors { 19152 if !flag { 19153 return false 19154 } 19155 } 19156 return true 19157 } 19158 19159 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) ProtoReflect() preflect.Message { 19160 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 19161 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(raw) 19162 }) 19163 } 19164 19165 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) ProtoMessage() { 19166 } 19167 19168 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Reset() { 19169 if fieldMask != nil { 19170 fieldMask.Paths = nil 19171 } 19172 } 19173 19174 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask { 19175 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask{} 19176 removedSelectors := make([]bool, 2) 19177 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector]gotenobject.FieldMask{ 19178 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask{}, 19179 } 19180 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector]gotenobject.FieldMask{ 19181 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask{}, 19182 } 19183 19184 for _, path := range other.GetPaths() { 19185 switch tp := path.(type) { 19186 case *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: 19187 removedSelectors[int(tp.selector)] = true 19188 case *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath: 19189 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 19190 } 19191 } 19192 for _, path := range fieldMask.GetPaths() { 19193 if !removedSelectors[int(path.Selector())] { 19194 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 19195 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath); ok { 19196 switch tp.selector { 19197 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 19198 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask() 19199 } 19200 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath); ok { 19201 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 19202 } 19203 } else { 19204 result.Paths = append(result.Paths, path) 19205 } 19206 } 19207 } 19208 for selector, mySubMask := range mySubMasks { 19209 if mySubMask.PathsCount() > 0 { 19210 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 19211 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath{selector: selector, subPath: allowedPath}) 19212 } 19213 } 19214 } 19215 19216 if len(result.Paths) == 0 { 19217 return nil 19218 } 19219 return result 19220 } 19221 19222 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 19223 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask)) 19224 } 19225 19226 // FilterInputFields generates copy of field paths with output_only field paths removed 19227 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask { 19228 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask{} 19229 result.Paths = append(result.Paths, fieldMask.Paths...) 19230 return result 19231 } 19232 19233 // ToFieldMask is used for proto conversions 19234 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 19235 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19236 for _, path := range fieldMask.Paths { 19237 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 19238 } 19239 return protoFieldMask 19240 } 19241 19242 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 19243 if fieldMask == nil { 19244 return status.Error(codes.Internal, "target field mask is nil") 19245 } 19246 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath, 0, len(protoFieldMask.Paths)) 19247 for _, strPath := range protoFieldMask.Paths { 19248 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(strPath) 19249 if err != nil { 19250 return err 19251 } 19252 fieldMask.Paths = append(fieldMask.Paths, path) 19253 } 19254 return nil 19255 } 19256 19257 // implement methods required by customType 19258 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Marshal() ([]byte, error) { 19259 protoFieldMask := fieldMask.ToProtoFieldMask() 19260 return proto.Marshal(protoFieldMask) 19261 } 19262 19263 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Unmarshal(data []byte) error { 19264 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19265 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 19266 return err 19267 } 19268 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19269 return err 19270 } 19271 return nil 19272 } 19273 19274 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Size() int { 19275 return proto.Size(fieldMask.ToProtoFieldMask()) 19276 } 19277 19278 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) MarshalJSON() ([]byte, error) { 19279 return json.Marshal(fieldMask.ToProtoFieldMask()) 19280 } 19281 19282 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) UnmarshalJSON(data []byte) error { 19283 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19284 if err := json.Unmarshal(data, protoFieldMask); err != nil { 19285 return err 19286 } 19287 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19288 return err 19289 } 19290 return nil 19291 } 19292 19293 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath) { 19294 fieldMask.Paths = append(fieldMask.Paths, path) 19295 } 19296 19297 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 19298 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath)) 19299 } 19300 19301 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath { 19302 if fieldMask == nil { 19303 return nil 19304 } 19305 return fieldMask.Paths 19306 } 19307 19308 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) GetRawPaths() []gotenobject.FieldPath { 19309 if fieldMask == nil { 19310 return nil 19311 } 19312 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 19313 for _, path := range fieldMask.Paths { 19314 rawPaths = append(rawPaths, path) 19315 } 19316 return rawPaths 19317 } 19318 19319 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) SetFromCliFlag(raw string) error { 19320 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(raw) 19321 if err != nil { 19322 return err 19323 } 19324 fieldMask.Paths = append(fieldMask.Paths, path) 19325 return nil 19326 } 19327 19328 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) { 19329 for _, path := range fieldMask.Paths { 19330 val, _ := path.GetSingle(source) 19331 // if val is nil, then field does not exist in source, skip 19332 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 19333 if val != nil { 19334 path.WithIValue(val).SetTo(&target) 19335 } 19336 } 19337 } 19338 19339 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 19340 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 19341 } 19342 19343 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps { 19344 if source == nil { 19345 return nil 19346 } 19347 if fieldMask == nil { 19348 return source 19349 } 19350 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps{} 19351 initialBearerMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer_FieldMask{} 19352 wholeInitialBearerAccepted := false 19353 19354 for _, p := range fieldMask.Paths { 19355 switch tp := p.(type) { 19356 case *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: 19357 switch tp.selector { 19358 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 19359 result.InitialBearer = source.InitialBearer 19360 wholeInitialBearerAccepted = true 19361 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 19362 result.UeModeOperation = source.UeModeOperation 19363 } 19364 case *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath: 19365 switch tp.selector { 19366 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 19367 initialBearerMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath)) 19368 } 19369 } 19370 } 19371 if wholeInitialBearerAccepted == false && len(initialBearerMask.Paths) > 0 { 19372 result.InitialBearer = initialBearerMask.Project(source.GetInitialBearer()) 19373 } 19374 return result 19375 } 19376 19377 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 19378 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 19379 } 19380 19381 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask) PathsCount() int { 19382 if fieldMask == nil { 19383 return 0 19384 } 19385 return len(fieldMask.Paths) 19386 } 19387 19388 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask struct { 19389 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 19390 } 19391 19392 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask { 19393 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask{} 19394 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr}) 19395 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks}) 19396 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps}) 19397 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei}) 19398 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode}) 19399 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName}) 19400 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState}) 19401 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco}) 19402 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState}) 19403 return res 19404 } 19405 19406 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) String() string { 19407 if fieldMask == nil { 19408 return "<nil>" 19409 } 19410 pathsStr := make([]string, 0, len(fieldMask.Paths)) 19411 for _, path := range fieldMask.Paths { 19412 pathsStr = append(pathsStr, path.String()) 19413 } 19414 return strings.Join(pathsStr, ", ") 19415 } 19416 19417 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) IsFull() bool { 19418 if fieldMask == nil { 19419 return false 19420 } 19421 presentSelectors := make([]bool, 9) 19422 for _, path := range fieldMask.Paths { 19423 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath); ok { 19424 presentSelectors[int(asFinal.selector)] = true 19425 } 19426 } 19427 for _, flag := range presentSelectors { 19428 if !flag { 19429 return false 19430 } 19431 } 19432 return true 19433 } 19434 19435 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) ProtoReflect() preflect.Message { 19436 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 19437 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(raw) 19438 }) 19439 } 19440 19441 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) ProtoMessage() { 19442 } 19443 19444 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Reset() { 19445 if fieldMask != nil { 19446 fieldMask.Paths = nil 19447 } 19448 } 19449 19450 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask { 19451 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask{} 19452 removedSelectors := make([]bool, 9) 19453 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector]gotenobject.FieldMask{ 19454 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask{}, 19455 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask{}, 19456 } 19457 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector]gotenobject.FieldMask{ 19458 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask{}, 19459 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask{}, 19460 } 19461 19462 for _, path := range other.GetPaths() { 19463 switch tp := path.(type) { 19464 case *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: 19465 removedSelectors[int(tp.selector)] = true 19466 case *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath: 19467 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 19468 } 19469 } 19470 for _, path := range fieldMask.GetPaths() { 19471 if !removedSelectors[int(path.Selector())] { 19472 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 19473 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath); ok { 19474 switch tp.selector { 19475 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 19476 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask() 19477 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 19478 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask() 19479 } 19480 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath); ok { 19481 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 19482 } 19483 } else { 19484 result.Paths = append(result.Paths, path) 19485 } 19486 } 19487 } 19488 for selector, mySubMask := range mySubMasks { 19489 if mySubMask.PathsCount() > 0 { 19490 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 19491 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath{selector: selector, subPath: allowedPath}) 19492 } 19493 } 19494 } 19495 19496 if len(result.Paths) == 0 { 19497 return nil 19498 } 19499 return result 19500 } 19501 19502 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 19503 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask)) 19504 } 19505 19506 // FilterInputFields generates copy of field paths with output_only field paths removed 19507 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask { 19508 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask{} 19509 result.Paths = append(result.Paths, fieldMask.Paths...) 19510 return result 19511 } 19512 19513 // ToFieldMask is used for proto conversions 19514 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 19515 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19516 for _, path := range fieldMask.Paths { 19517 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 19518 } 19519 return protoFieldMask 19520 } 19521 19522 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 19523 if fieldMask == nil { 19524 return status.Error(codes.Internal, "target field mask is nil") 19525 } 19526 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath, 0, len(protoFieldMask.Paths)) 19527 for _, strPath := range protoFieldMask.Paths { 19528 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(strPath) 19529 if err != nil { 19530 return err 19531 } 19532 fieldMask.Paths = append(fieldMask.Paths, path) 19533 } 19534 return nil 19535 } 19536 19537 // implement methods required by customType 19538 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Marshal() ([]byte, error) { 19539 protoFieldMask := fieldMask.ToProtoFieldMask() 19540 return proto.Marshal(protoFieldMask) 19541 } 19542 19543 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Unmarshal(data []byte) error { 19544 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19545 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 19546 return err 19547 } 19548 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19549 return err 19550 } 19551 return nil 19552 } 19553 19554 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Size() int { 19555 return proto.Size(fieldMask.ToProtoFieldMask()) 19556 } 19557 19558 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) MarshalJSON() ([]byte, error) { 19559 return json.Marshal(fieldMask.ToProtoFieldMask()) 19560 } 19561 19562 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) UnmarshalJSON(data []byte) error { 19563 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19564 if err := json.Unmarshal(data, protoFieldMask); err != nil { 19565 return err 19566 } 19567 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19568 return err 19569 } 19570 return nil 19571 } 19572 19573 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath) { 19574 fieldMask.Paths = append(fieldMask.Paths, path) 19575 } 19576 19577 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 19578 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath)) 19579 } 19580 19581 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath { 19582 if fieldMask == nil { 19583 return nil 19584 } 19585 return fieldMask.Paths 19586 } 19587 19588 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) GetRawPaths() []gotenobject.FieldPath { 19589 if fieldMask == nil { 19590 return nil 19591 } 19592 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 19593 for _, path := range fieldMask.Paths { 19594 rawPaths = append(rawPaths, path) 19595 } 19596 return rawPaths 19597 } 19598 19599 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) SetFromCliFlag(raw string) error { 19600 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(raw) 19601 if err != nil { 19602 return err 19603 } 19604 fieldMask.Paths = append(fieldMask.Paths, path) 19605 return nil 19606 } 19607 19608 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) { 19609 for _, path := range fieldMask.Paths { 19610 val, _ := path.GetSingle(source) 19611 // if val is nil, then field does not exist in source, skip 19612 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 19613 if val != nil { 19614 path.WithIValue(val).SetTo(&target) 19615 } 19616 } 19617 } 19618 19619 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 19620 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 19621 } 19622 19623 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp { 19624 if source == nil { 19625 return nil 19626 } 19627 if fieldMask == nil { 19628 return source 19629 } 19630 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp{} 19631 fivegNrMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr_FieldMask{} 19632 wholeFivegNrAccepted := false 19633 epsMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps_FieldMask{} 19634 wholeEpsAccepted := false 19635 19636 for _, p := range fieldMask.Paths { 19637 switch tp := p.(type) { 19638 case *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: 19639 switch tp.selector { 19640 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 19641 result.FivegNr = source.FivegNr 19642 wholeFivegNrAccepted = true 19643 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 19644 result.EnabledLocks = source.EnabledLocks 19645 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 19646 result.Eps = source.Eps 19647 wholeEpsAccepted = true 19648 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 19649 result.Imei = source.Imei 19650 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 19651 result.OperatorCode = source.OperatorCode 19652 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 19653 result.OperatorName = source.OperatorName 19654 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 19655 result.PacketServiceState = source.PacketServiceState 19656 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 19657 result.Pco = source.Pco 19658 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 19659 result.RegistrationState = source.RegistrationState 19660 } 19661 case *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath: 19662 switch tp.selector { 19663 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 19664 fivegNrMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath)) 19665 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 19666 epsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath)) 19667 } 19668 } 19669 } 19670 if wholeFivegNrAccepted == false && len(fivegNrMask.Paths) > 0 { 19671 result.FivegNr = fivegNrMask.Project(source.GetFivegNr()) 19672 } 19673 if wholeEpsAccepted == false && len(epsMask.Paths) > 0 { 19674 result.Eps = epsMask.Project(source.GetEps()) 19675 } 19676 return result 19677 } 19678 19679 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 19680 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 19681 } 19682 19683 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask) PathsCount() int { 19684 if fieldMask == nil { 19685 return 0 19686 } 19687 return len(fieldMask.Paths) 19688 } 19689 19690 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask struct { 19691 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath 19692 } 19693 19694 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask { 19695 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask{} 19696 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState}) 19697 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState}) 19698 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn}) 19699 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState}) 19700 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid}) 19701 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid}) 19702 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid}) 19703 return res 19704 } 19705 19706 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) String() string { 19707 if fieldMask == nil { 19708 return "<nil>" 19709 } 19710 pathsStr := make([]string, 0, len(fieldMask.Paths)) 19711 for _, path := range fieldMask.Paths { 19712 pathsStr = append(pathsStr, path.String()) 19713 } 19714 return strings.Join(pathsStr, ", ") 19715 } 19716 19717 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) IsFull() bool { 19718 if fieldMask == nil { 19719 return false 19720 } 19721 presentSelectors := make([]bool, 7) 19722 for _, path := range fieldMask.Paths { 19723 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath); ok { 19724 presentSelectors[int(asFinal.selector)] = true 19725 } 19726 } 19727 for _, flag := range presentSelectors { 19728 if !flag { 19729 return false 19730 } 19731 } 19732 return true 19733 } 19734 19735 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) ProtoReflect() preflect.Message { 19736 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 19737 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(raw) 19738 }) 19739 } 19740 19741 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) ProtoMessage() { 19742 } 19743 19744 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Reset() { 19745 if fieldMask != nil { 19746 fieldMask.Paths = nil 19747 } 19748 } 19749 19750 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask { 19751 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask{} 19752 removedSelectors := make([]bool, 7) 19753 19754 for _, path := range other.GetPaths() { 19755 switch tp := path.(type) { 19756 case *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: 19757 removedSelectors[int(tp.selector)] = true 19758 } 19759 } 19760 for _, path := range fieldMask.GetPaths() { 19761 if !removedSelectors[int(path.Selector())] { 19762 result.Paths = append(result.Paths, path) 19763 } 19764 } 19765 19766 if len(result.Paths) == 0 { 19767 return nil 19768 } 19769 return result 19770 } 19771 19772 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 19773 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask)) 19774 } 19775 19776 // FilterInputFields generates copy of field paths with output_only field paths removed 19777 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask { 19778 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask{} 19779 result.Paths = append(result.Paths, fieldMask.Paths...) 19780 return result 19781 } 19782 19783 // ToFieldMask is used for proto conversions 19784 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 19785 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19786 for _, path := range fieldMask.Paths { 19787 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 19788 } 19789 return protoFieldMask 19790 } 19791 19792 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 19793 if fieldMask == nil { 19794 return status.Error(codes.Internal, "target field mask is nil") 19795 } 19796 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath, 0, len(protoFieldMask.Paths)) 19797 for _, strPath := range protoFieldMask.Paths { 19798 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(strPath) 19799 if err != nil { 19800 return err 19801 } 19802 fieldMask.Paths = append(fieldMask.Paths, path) 19803 } 19804 return nil 19805 } 19806 19807 // implement methods required by customType 19808 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Marshal() ([]byte, error) { 19809 protoFieldMask := fieldMask.ToProtoFieldMask() 19810 return proto.Marshal(protoFieldMask) 19811 } 19812 19813 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Unmarshal(data []byte) error { 19814 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19815 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 19816 return err 19817 } 19818 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19819 return err 19820 } 19821 return nil 19822 } 19823 19824 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Size() int { 19825 return proto.Size(fieldMask.ToProtoFieldMask()) 19826 } 19827 19828 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) MarshalJSON() ([]byte, error) { 19829 return json.Marshal(fieldMask.ToProtoFieldMask()) 19830 } 19831 19832 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) UnmarshalJSON(data []byte) error { 19833 protoFieldMask := &googlefieldmaskpb.FieldMask{} 19834 if err := json.Unmarshal(data, protoFieldMask); err != nil { 19835 return err 19836 } 19837 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 19838 return err 19839 } 19840 return nil 19841 } 19842 19843 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath) { 19844 fieldMask.Paths = append(fieldMask.Paths, path) 19845 } 19846 19847 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 19848 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath)) 19849 } 19850 19851 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath { 19852 if fieldMask == nil { 19853 return nil 19854 } 19855 return fieldMask.Paths 19856 } 19857 19858 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) GetRawPaths() []gotenobject.FieldPath { 19859 if fieldMask == nil { 19860 return nil 19861 } 19862 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 19863 for _, path := range fieldMask.Paths { 19864 rawPaths = append(rawPaths, path) 19865 } 19866 return rawPaths 19867 } 19868 19869 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) SetFromCliFlag(raw string) error { 19870 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(raw) 19871 if err != nil { 19872 return err 19873 } 19874 fieldMask.Paths = append(fieldMask.Paths, path) 19875 return nil 19876 } 19877 19878 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) { 19879 for _, path := range fieldMask.Paths { 19880 val, _ := path.GetSingle(source) 19881 // if val is nil, then field does not exist in source, skip 19882 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 19883 if val != nil { 19884 path.WithIValue(val).SetTo(&target) 19885 } 19886 } 19887 } 19888 19889 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 19890 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 19891 } 19892 19893 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma { 19894 if source == nil { 19895 return nil 19896 } 19897 if fieldMask == nil { 19898 return source 19899 } 19900 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma{} 19901 19902 for _, p := range fieldMask.Paths { 19903 switch tp := p.(type) { 19904 case *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: 19905 switch tp.selector { 19906 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 19907 result.ActivationState = source.ActivationState 19908 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 19909 result.Cdma1XRegistrationState = source.Cdma1XRegistrationState 19910 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 19911 result.Esn = source.Esn 19912 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 19913 result.EvdoRegistrationState = source.EvdoRegistrationState 19914 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 19915 result.Meid = source.Meid 19916 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 19917 result.Nid = source.Nid 19918 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 19919 result.Sid = source.Sid 19920 } 19921 } 19922 } 19923 return result 19924 } 19925 19926 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 19927 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 19928 } 19929 19930 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask) PathsCount() int { 19931 if fieldMask == nil { 19932 return 0 19933 } 19934 return len(fieldMask.Paths) 19935 } 19936 19937 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask struct { 19938 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath 19939 } 19940 19941 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask { 19942 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask{} 19943 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent}) 19944 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue}) 19945 return res 19946 } 19947 19948 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) String() string { 19949 if fieldMask == nil { 19950 return "<nil>" 19951 } 19952 pathsStr := make([]string, 0, len(fieldMask.Paths)) 19953 for _, path := range fieldMask.Paths { 19954 pathsStr = append(pathsStr, path.String()) 19955 } 19956 return strings.Join(pathsStr, ", ") 19957 } 19958 19959 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) IsFull() bool { 19960 if fieldMask == nil { 19961 return false 19962 } 19963 presentSelectors := make([]bool, 2) 19964 for _, path := range fieldMask.Paths { 19965 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath); ok { 19966 presentSelectors[int(asFinal.selector)] = true 19967 } 19968 } 19969 for _, flag := range presentSelectors { 19970 if !flag { 19971 return false 19972 } 19973 } 19974 return true 19975 } 19976 19977 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) ProtoReflect() preflect.Message { 19978 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 19979 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(raw) 19980 }) 19981 } 19982 19983 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) ProtoMessage() { 19984 } 19985 19986 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Reset() { 19987 if fieldMask != nil { 19988 fieldMask.Paths = nil 19989 } 19990 } 19991 19992 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask { 19993 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask{} 19994 removedSelectors := make([]bool, 2) 19995 19996 for _, path := range other.GetPaths() { 19997 switch tp := path.(type) { 19998 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: 19999 removedSelectors[int(tp.selector)] = true 20000 } 20001 } 20002 for _, path := range fieldMask.GetPaths() { 20003 if !removedSelectors[int(path.Selector())] { 20004 result.Paths = append(result.Paths, path) 20005 } 20006 } 20007 20008 if len(result.Paths) == 0 { 20009 return nil 20010 } 20011 return result 20012 } 20013 20014 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 20015 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask)) 20016 } 20017 20018 // FilterInputFields generates copy of field paths with output_only field paths removed 20019 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask { 20020 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask{} 20021 result.Paths = append(result.Paths, fieldMask.Paths...) 20022 return result 20023 } 20024 20025 // ToFieldMask is used for proto conversions 20026 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 20027 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20028 for _, path := range fieldMask.Paths { 20029 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 20030 } 20031 return protoFieldMask 20032 } 20033 20034 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 20035 if fieldMask == nil { 20036 return status.Error(codes.Internal, "target field mask is nil") 20037 } 20038 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath, 0, len(protoFieldMask.Paths)) 20039 for _, strPath := range protoFieldMask.Paths { 20040 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(strPath) 20041 if err != nil { 20042 return err 20043 } 20044 fieldMask.Paths = append(fieldMask.Paths, path) 20045 } 20046 return nil 20047 } 20048 20049 // implement methods required by customType 20050 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Marshal() ([]byte, error) { 20051 protoFieldMask := fieldMask.ToProtoFieldMask() 20052 return proto.Marshal(protoFieldMask) 20053 } 20054 20055 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Unmarshal(data []byte) error { 20056 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20057 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 20058 return err 20059 } 20060 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20061 return err 20062 } 20063 return nil 20064 } 20065 20066 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Size() int { 20067 return proto.Size(fieldMask.ToProtoFieldMask()) 20068 } 20069 20070 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) MarshalJSON() ([]byte, error) { 20071 return json.Marshal(fieldMask.ToProtoFieldMask()) 20072 } 20073 20074 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) UnmarshalJSON(data []byte) error { 20075 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20076 if err := json.Unmarshal(data, protoFieldMask); err != nil { 20077 return err 20078 } 20079 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20080 return err 20081 } 20082 return nil 20083 } 20084 20085 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath) { 20086 fieldMask.Paths = append(fieldMask.Paths, path) 20087 } 20088 20089 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 20090 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath)) 20091 } 20092 20093 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath { 20094 if fieldMask == nil { 20095 return nil 20096 } 20097 return fieldMask.Paths 20098 } 20099 20100 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) GetRawPaths() []gotenobject.FieldPath { 20101 if fieldMask == nil { 20102 return nil 20103 } 20104 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 20105 for _, path := range fieldMask.Paths { 20106 rawPaths = append(rawPaths, path) 20107 } 20108 return rawPaths 20109 } 20110 20111 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) SetFromCliFlag(raw string) error { 20112 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(raw) 20113 if err != nil { 20114 return err 20115 } 20116 fieldMask.Paths = append(fieldMask.Paths, path) 20117 return nil 20118 } 20119 20120 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) { 20121 for _, path := range fieldMask.Paths { 20122 val, _ := path.GetSingle(source) 20123 // if val is nil, then field does not exist in source, skip 20124 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 20125 if val != nil { 20126 path.WithIValue(val).SetTo(&target) 20127 } 20128 } 20129 } 20130 20131 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 20132 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 20133 } 20134 20135 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality { 20136 if source == nil { 20137 return nil 20138 } 20139 if fieldMask == nil { 20140 return source 20141 } 20142 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality{} 20143 20144 for _, p := range fieldMask.Paths { 20145 switch tp := p.(type) { 20146 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: 20147 switch tp.selector { 20148 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 20149 result.Recent = source.Recent 20150 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 20151 result.Value = source.Value 20152 } 20153 } 20154 } 20155 return result 20156 } 20157 20158 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 20159 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 20160 } 20161 20162 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask) PathsCount() int { 20163 if fieldMask == nil { 20164 return 0 20165 } 20166 return len(fieldMask.Paths) 20167 } 20168 20169 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask struct { 20170 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 20171 } 20172 20173 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask { 20174 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask{} 20175 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies}) 20176 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers}) 20177 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration}) 20178 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision}) 20179 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands}) 20180 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities}) 20181 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes}) 20182 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice}) 20183 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier}) 20184 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers}) 20185 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier}) 20186 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision}) 20187 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer}) 20188 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel}) 20189 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers}) 20190 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin}) 20191 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts}) 20192 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState}) 20193 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort}) 20194 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot}) 20195 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision}) 20196 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality}) 20197 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim}) 20198 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots}) 20199 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState}) 20200 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason}) 20201 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands}) 20202 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities}) 20203 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies}) 20204 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes}) 20205 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired}) 20206 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries}) 20207 return res 20208 } 20209 20210 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) String() string { 20211 if fieldMask == nil { 20212 return "<nil>" 20213 } 20214 pathsStr := make([]string, 0, len(fieldMask.Paths)) 20215 for _, path := range fieldMask.Paths { 20216 pathsStr = append(pathsStr, path.String()) 20217 } 20218 return strings.Join(pathsStr, ", ") 20219 } 20220 20221 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) IsFull() bool { 20222 if fieldMask == nil { 20223 return false 20224 } 20225 presentSelectors := make([]bool, 32) 20226 for _, path := range fieldMask.Paths { 20227 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath); ok { 20228 presentSelectors[int(asFinal.selector)] = true 20229 } 20230 } 20231 for _, flag := range presentSelectors { 20232 if !flag { 20233 return false 20234 } 20235 } 20236 return true 20237 } 20238 20239 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) ProtoReflect() preflect.Message { 20240 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 20241 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(raw) 20242 }) 20243 } 20244 20245 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) ProtoMessage() { 20246 } 20247 20248 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Reset() { 20249 if fieldMask != nil { 20250 fieldMask.Paths = nil 20251 } 20252 } 20253 20254 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask { 20255 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask{} 20256 removedSelectors := make([]bool, 32) 20257 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector]gotenobject.FieldMask{ 20258 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask{}, 20259 } 20260 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector]gotenobject.FieldMask{ 20261 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask{}, 20262 } 20263 20264 for _, path := range other.GetPaths() { 20265 switch tp := path.(type) { 20266 case *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: 20267 removedSelectors[int(tp.selector)] = true 20268 case *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath: 20269 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 20270 } 20271 } 20272 for _, path := range fieldMask.GetPaths() { 20273 if !removedSelectors[int(path.Selector())] { 20274 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 20275 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath); ok { 20276 switch tp.selector { 20277 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 20278 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask() 20279 } 20280 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath); ok { 20281 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 20282 } 20283 } else { 20284 result.Paths = append(result.Paths, path) 20285 } 20286 } 20287 } 20288 for selector, mySubMask := range mySubMasks { 20289 if mySubMask.PathsCount() > 0 { 20290 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 20291 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath{selector: selector, subPath: allowedPath}) 20292 } 20293 } 20294 } 20295 20296 if len(result.Paths) == 0 { 20297 return nil 20298 } 20299 return result 20300 } 20301 20302 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 20303 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask)) 20304 } 20305 20306 // FilterInputFields generates copy of field paths with output_only field paths removed 20307 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask { 20308 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask{} 20309 result.Paths = append(result.Paths, fieldMask.Paths...) 20310 return result 20311 } 20312 20313 // ToFieldMask is used for proto conversions 20314 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 20315 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20316 for _, path := range fieldMask.Paths { 20317 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 20318 } 20319 return protoFieldMask 20320 } 20321 20322 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 20323 if fieldMask == nil { 20324 return status.Error(codes.Internal, "target field mask is nil") 20325 } 20326 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath, 0, len(protoFieldMask.Paths)) 20327 for _, strPath := range protoFieldMask.Paths { 20328 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(strPath) 20329 if err != nil { 20330 return err 20331 } 20332 fieldMask.Paths = append(fieldMask.Paths, path) 20333 } 20334 return nil 20335 } 20336 20337 // implement methods required by customType 20338 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Marshal() ([]byte, error) { 20339 protoFieldMask := fieldMask.ToProtoFieldMask() 20340 return proto.Marshal(protoFieldMask) 20341 } 20342 20343 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Unmarshal(data []byte) error { 20344 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20345 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 20346 return err 20347 } 20348 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20349 return err 20350 } 20351 return nil 20352 } 20353 20354 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Size() int { 20355 return proto.Size(fieldMask.ToProtoFieldMask()) 20356 } 20357 20358 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) MarshalJSON() ([]byte, error) { 20359 return json.Marshal(fieldMask.ToProtoFieldMask()) 20360 } 20361 20362 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) UnmarshalJSON(data []byte) error { 20363 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20364 if err := json.Unmarshal(data, protoFieldMask); err != nil { 20365 return err 20366 } 20367 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20368 return err 20369 } 20370 return nil 20371 } 20372 20373 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath) { 20374 fieldMask.Paths = append(fieldMask.Paths, path) 20375 } 20376 20377 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 20378 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath)) 20379 } 20380 20381 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath { 20382 if fieldMask == nil { 20383 return nil 20384 } 20385 return fieldMask.Paths 20386 } 20387 20388 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) GetRawPaths() []gotenobject.FieldPath { 20389 if fieldMask == nil { 20390 return nil 20391 } 20392 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 20393 for _, path := range fieldMask.Paths { 20394 rawPaths = append(rawPaths, path) 20395 } 20396 return rawPaths 20397 } 20398 20399 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) SetFromCliFlag(raw string) error { 20400 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(raw) 20401 if err != nil { 20402 return err 20403 } 20404 fieldMask.Paths = append(fieldMask.Paths, path) 20405 return nil 20406 } 20407 20408 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) { 20409 for _, path := range fieldMask.Paths { 20410 val, _ := path.GetSingle(source) 20411 // if val is nil, then field does not exist in source, skip 20412 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 20413 if val != nil { 20414 path.WithIValue(val).SetTo(&target) 20415 } 20416 } 20417 } 20418 20419 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 20420 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 20421 } 20422 20423 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic { 20424 if source == nil { 20425 return nil 20426 } 20427 if fieldMask == nil { 20428 return source 20429 } 20430 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic{} 20431 signalQualityMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality_FieldMask{} 20432 wholeSignalQualityAccepted := false 20433 20434 for _, p := range fieldMask.Paths { 20435 switch tp := p.(type) { 20436 case *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: 20437 switch tp.selector { 20438 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 20439 result.AccessTechnologies = source.AccessTechnologies 20440 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 20441 result.Bearers = source.Bearers 20442 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 20443 result.CarrierConfiguration = source.CarrierConfiguration 20444 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 20445 result.CarrierConfigurationRevision = source.CarrierConfigurationRevision 20446 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 20447 result.CurrentBands = source.CurrentBands 20448 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 20449 result.CurrentCapabilities = source.CurrentCapabilities 20450 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 20451 result.CurrentModes = source.CurrentModes 20452 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 20453 result.Device = source.Device 20454 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 20455 result.DeviceIdentifier = source.DeviceIdentifier 20456 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 20457 result.Drivers = source.Drivers 20458 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 20459 result.EquipmentIdentifier = source.EquipmentIdentifier 20460 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 20461 result.HardwareRevision = source.HardwareRevision 20462 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 20463 result.Manufacturer = source.Manufacturer 20464 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 20465 result.Model = source.Model 20466 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 20467 result.OwnNumbers = source.OwnNumbers 20468 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 20469 result.Plugin = source.Plugin 20470 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 20471 result.Ports = source.Ports 20472 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 20473 result.PowerState = source.PowerState 20474 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 20475 result.PrimaryPort = source.PrimaryPort 20476 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 20477 result.PrimarySimSlot = source.PrimarySimSlot 20478 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 20479 result.Revision = source.Revision 20480 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 20481 result.SignalQuality = source.SignalQuality 20482 wholeSignalQualityAccepted = true 20483 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 20484 result.Sim = source.Sim 20485 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 20486 result.SimSlots = source.SimSlots 20487 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 20488 result.State = source.State 20489 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 20490 result.StateFailedReason = source.StateFailedReason 20491 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 20492 result.SupportedBands = source.SupportedBands 20493 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 20494 result.SupportedCapabilities = source.SupportedCapabilities 20495 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 20496 result.SupportedIpFamilies = source.SupportedIpFamilies 20497 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 20498 result.SupportedModes = source.SupportedModes 20499 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 20500 result.UnlockRequired = source.UnlockRequired 20501 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 20502 result.UnlockRetries = source.UnlockRetries 20503 } 20504 case *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath: 20505 switch tp.selector { 20506 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 20507 signalQualityMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath)) 20508 } 20509 } 20510 } 20511 if wholeSignalQualityAccepted == false && len(signalQualityMask.Paths) > 0 { 20512 result.SignalQuality = signalQualityMask.Project(source.GetSignalQuality()) 20513 } 20514 return result 20515 } 20516 20517 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 20518 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 20519 } 20520 20521 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask) PathsCount() int { 20522 if fieldMask == nil { 20523 return 0 20524 } 20525 return len(fieldMask.Paths) 20526 } 20527 20528 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask struct { 20529 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath 20530 } 20531 20532 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask { 20533 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask{} 20534 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorErrorRate}) 20535 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorRsrp}) 20536 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorRsrq}) 20537 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorSnr}) 20538 return res 20539 } 20540 20541 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) String() string { 20542 if fieldMask == nil { 20543 return "<nil>" 20544 } 20545 pathsStr := make([]string, 0, len(fieldMask.Paths)) 20546 for _, path := range fieldMask.Paths { 20547 pathsStr = append(pathsStr, path.String()) 20548 } 20549 return strings.Join(pathsStr, ", ") 20550 } 20551 20552 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) IsFull() bool { 20553 if fieldMask == nil { 20554 return false 20555 } 20556 presentSelectors := make([]bool, 4) 20557 for _, path := range fieldMask.Paths { 20558 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath); ok { 20559 presentSelectors[int(asFinal.selector)] = true 20560 } 20561 } 20562 for _, flag := range presentSelectors { 20563 if !flag { 20564 return false 20565 } 20566 } 20567 return true 20568 } 20569 20570 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) ProtoReflect() preflect.Message { 20571 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 20572 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath(raw) 20573 }) 20574 } 20575 20576 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) ProtoMessage() { 20577 } 20578 20579 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Reset() { 20580 if fieldMask != nil { 20581 fieldMask.Paths = nil 20582 } 20583 } 20584 20585 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask { 20586 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask{} 20587 removedSelectors := make([]bool, 4) 20588 20589 for _, path := range other.GetPaths() { 20590 switch tp := path.(type) { 20591 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath: 20592 removedSelectors[int(tp.selector)] = true 20593 } 20594 } 20595 for _, path := range fieldMask.GetPaths() { 20596 if !removedSelectors[int(path.Selector())] { 20597 result.Paths = append(result.Paths, path) 20598 } 20599 } 20600 20601 if len(result.Paths) == 0 { 20602 return nil 20603 } 20604 return result 20605 } 20606 20607 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 20608 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask)) 20609 } 20610 20611 // FilterInputFields generates copy of field paths with output_only field paths removed 20612 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask { 20613 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask{} 20614 result.Paths = append(result.Paths, fieldMask.Paths...) 20615 return result 20616 } 20617 20618 // ToFieldMask is used for proto conversions 20619 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 20620 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20621 for _, path := range fieldMask.Paths { 20622 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 20623 } 20624 return protoFieldMask 20625 } 20626 20627 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 20628 if fieldMask == nil { 20629 return status.Error(codes.Internal, "target field mask is nil") 20630 } 20631 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath, 0, len(protoFieldMask.Paths)) 20632 for _, strPath := range protoFieldMask.Paths { 20633 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath(strPath) 20634 if err != nil { 20635 return err 20636 } 20637 fieldMask.Paths = append(fieldMask.Paths, path) 20638 } 20639 return nil 20640 } 20641 20642 // implement methods required by customType 20643 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Marshal() ([]byte, error) { 20644 protoFieldMask := fieldMask.ToProtoFieldMask() 20645 return proto.Marshal(protoFieldMask) 20646 } 20647 20648 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Unmarshal(data []byte) error { 20649 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20650 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 20651 return err 20652 } 20653 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20654 return err 20655 } 20656 return nil 20657 } 20658 20659 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Size() int { 20660 return proto.Size(fieldMask.ToProtoFieldMask()) 20661 } 20662 20663 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) MarshalJSON() ([]byte, error) { 20664 return json.Marshal(fieldMask.ToProtoFieldMask()) 20665 } 20666 20667 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) UnmarshalJSON(data []byte) error { 20668 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20669 if err := json.Unmarshal(data, protoFieldMask); err != nil { 20670 return err 20671 } 20672 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20673 return err 20674 } 20675 return nil 20676 } 20677 20678 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath) { 20679 fieldMask.Paths = append(fieldMask.Paths, path) 20680 } 20681 20682 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 20683 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath)) 20684 } 20685 20686 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath { 20687 if fieldMask == nil { 20688 return nil 20689 } 20690 return fieldMask.Paths 20691 } 20692 20693 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) GetRawPaths() []gotenobject.FieldPath { 20694 if fieldMask == nil { 20695 return nil 20696 } 20697 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 20698 for _, path := range fieldMask.Paths { 20699 rawPaths = append(rawPaths, path) 20700 } 20701 return rawPaths 20702 } 20703 20704 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) SetFromCliFlag(raw string) error { 20705 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath(raw) 20706 if err != nil { 20707 return err 20708 } 20709 fieldMask.Paths = append(fieldMask.Paths, path) 20710 return nil 20711 } 20712 20713 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G) { 20714 for _, path := range fieldMask.Paths { 20715 val, _ := path.GetSingle(source) 20716 // if val is nil, then field does not exist in source, skip 20717 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 20718 if val != nil { 20719 path.WithIValue(val).SetTo(&target) 20720 } 20721 } 20722 } 20723 20724 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 20725 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G)) 20726 } 20727 20728 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G { 20729 if source == nil { 20730 return nil 20731 } 20732 if fieldMask == nil { 20733 return source 20734 } 20735 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G{} 20736 20737 for _, p := range fieldMask.Paths { 20738 switch tp := p.(type) { 20739 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldTerminalPath: 20740 switch tp.selector { 20741 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorErrorRate: 20742 result.ErrorRate = source.ErrorRate 20743 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorRsrp: 20744 result.Rsrp = source.Rsrp 20745 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorRsrq: 20746 result.Rsrq = source.Rsrq 20747 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPathSelectorSnr: 20748 result.Snr = source.Snr 20749 } 20750 } 20751 } 20752 return result 20753 } 20754 20755 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 20756 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G)) 20757 } 20758 20759 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask) PathsCount() int { 20760 if fieldMask == nil { 20761 return 0 20762 } 20763 return len(fieldMask.Paths) 20764 } 20765 20766 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask struct { 20767 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath 20768 } 20769 20770 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask { 20771 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask{} 20772 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPathSelectorEcio}) 20773 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPathSelectorErrorRate}) 20774 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPathSelectorRssi}) 20775 return res 20776 } 20777 20778 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) String() string { 20779 if fieldMask == nil { 20780 return "<nil>" 20781 } 20782 pathsStr := make([]string, 0, len(fieldMask.Paths)) 20783 for _, path := range fieldMask.Paths { 20784 pathsStr = append(pathsStr, path.String()) 20785 } 20786 return strings.Join(pathsStr, ", ") 20787 } 20788 20789 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) IsFull() bool { 20790 if fieldMask == nil { 20791 return false 20792 } 20793 presentSelectors := make([]bool, 3) 20794 for _, path := range fieldMask.Paths { 20795 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldTerminalPath); ok { 20796 presentSelectors[int(asFinal.selector)] = true 20797 } 20798 } 20799 for _, flag := range presentSelectors { 20800 if !flag { 20801 return false 20802 } 20803 } 20804 return true 20805 } 20806 20807 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) ProtoReflect() preflect.Message { 20808 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 20809 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath(raw) 20810 }) 20811 } 20812 20813 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) ProtoMessage() { 20814 } 20815 20816 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Reset() { 20817 if fieldMask != nil { 20818 fieldMask.Paths = nil 20819 } 20820 } 20821 20822 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask { 20823 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask{} 20824 removedSelectors := make([]bool, 3) 20825 20826 for _, path := range other.GetPaths() { 20827 switch tp := path.(type) { 20828 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldTerminalPath: 20829 removedSelectors[int(tp.selector)] = true 20830 } 20831 } 20832 for _, path := range fieldMask.GetPaths() { 20833 if !removedSelectors[int(path.Selector())] { 20834 result.Paths = append(result.Paths, path) 20835 } 20836 } 20837 20838 if len(result.Paths) == 0 { 20839 return nil 20840 } 20841 return result 20842 } 20843 20844 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 20845 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask)) 20846 } 20847 20848 // FilterInputFields generates copy of field paths with output_only field paths removed 20849 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask { 20850 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask{} 20851 result.Paths = append(result.Paths, fieldMask.Paths...) 20852 return result 20853 } 20854 20855 // ToFieldMask is used for proto conversions 20856 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 20857 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20858 for _, path := range fieldMask.Paths { 20859 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 20860 } 20861 return protoFieldMask 20862 } 20863 20864 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 20865 if fieldMask == nil { 20866 return status.Error(codes.Internal, "target field mask is nil") 20867 } 20868 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath, 0, len(protoFieldMask.Paths)) 20869 for _, strPath := range protoFieldMask.Paths { 20870 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath(strPath) 20871 if err != nil { 20872 return err 20873 } 20874 fieldMask.Paths = append(fieldMask.Paths, path) 20875 } 20876 return nil 20877 } 20878 20879 // implement methods required by customType 20880 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Marshal() ([]byte, error) { 20881 protoFieldMask := fieldMask.ToProtoFieldMask() 20882 return proto.Marshal(protoFieldMask) 20883 } 20884 20885 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Unmarshal(data []byte) error { 20886 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20887 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 20888 return err 20889 } 20890 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20891 return err 20892 } 20893 return nil 20894 } 20895 20896 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Size() int { 20897 return proto.Size(fieldMask.ToProtoFieldMask()) 20898 } 20899 20900 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) MarshalJSON() ([]byte, error) { 20901 return json.Marshal(fieldMask.ToProtoFieldMask()) 20902 } 20903 20904 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) UnmarshalJSON(data []byte) error { 20905 protoFieldMask := &googlefieldmaskpb.FieldMask{} 20906 if err := json.Unmarshal(data, protoFieldMask); err != nil { 20907 return err 20908 } 20909 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 20910 return err 20911 } 20912 return nil 20913 } 20914 20915 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath) { 20916 fieldMask.Paths = append(fieldMask.Paths, path) 20917 } 20918 20919 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 20920 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath)) 20921 } 20922 20923 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath { 20924 if fieldMask == nil { 20925 return nil 20926 } 20927 return fieldMask.Paths 20928 } 20929 20930 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) GetRawPaths() []gotenobject.FieldPath { 20931 if fieldMask == nil { 20932 return nil 20933 } 20934 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 20935 for _, path := range fieldMask.Paths { 20936 rawPaths = append(rawPaths, path) 20937 } 20938 return rawPaths 20939 } 20940 20941 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) SetFromCliFlag(raw string) error { 20942 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath(raw) 20943 if err != nil { 20944 return err 20945 } 20946 fieldMask.Paths = append(fieldMask.Paths, path) 20947 return nil 20948 } 20949 20950 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X) { 20951 for _, path := range fieldMask.Paths { 20952 val, _ := path.GetSingle(source) 20953 // if val is nil, then field does not exist in source, skip 20954 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 20955 if val != nil { 20956 path.WithIValue(val).SetTo(&target) 20957 } 20958 } 20959 } 20960 20961 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 20962 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X)) 20963 } 20964 20965 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X { 20966 if source == nil { 20967 return nil 20968 } 20969 if fieldMask == nil { 20970 return source 20971 } 20972 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X{} 20973 20974 for _, p := range fieldMask.Paths { 20975 switch tp := p.(type) { 20976 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldTerminalPath: 20977 switch tp.selector { 20978 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPathSelectorEcio: 20979 result.Ecio = source.Ecio 20980 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPathSelectorErrorRate: 20981 result.ErrorRate = source.ErrorRate 20982 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPathSelectorRssi: 20983 result.Rssi = source.Rssi 20984 } 20985 } 20986 } 20987 return result 20988 } 20989 20990 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 20991 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X)) 20992 } 20993 20994 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask) PathsCount() int { 20995 if fieldMask == nil { 20996 return 0 20997 } 20998 return len(fieldMask.Paths) 20999 } 21000 21001 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask struct { 21002 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath 21003 } 21004 21005 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask { 21006 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask{} 21007 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorEcio}) 21008 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorErrorRate}) 21009 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorIo}) 21010 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorRssi}) 21011 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorSinr}) 21012 return res 21013 } 21014 21015 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) String() string { 21016 if fieldMask == nil { 21017 return "<nil>" 21018 } 21019 pathsStr := make([]string, 0, len(fieldMask.Paths)) 21020 for _, path := range fieldMask.Paths { 21021 pathsStr = append(pathsStr, path.String()) 21022 } 21023 return strings.Join(pathsStr, ", ") 21024 } 21025 21026 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) IsFull() bool { 21027 if fieldMask == nil { 21028 return false 21029 } 21030 presentSelectors := make([]bool, 5) 21031 for _, path := range fieldMask.Paths { 21032 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath); ok { 21033 presentSelectors[int(asFinal.selector)] = true 21034 } 21035 } 21036 for _, flag := range presentSelectors { 21037 if !flag { 21038 return false 21039 } 21040 } 21041 return true 21042 } 21043 21044 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) ProtoReflect() preflect.Message { 21045 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 21046 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath(raw) 21047 }) 21048 } 21049 21050 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) ProtoMessage() { 21051 } 21052 21053 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Reset() { 21054 if fieldMask != nil { 21055 fieldMask.Paths = nil 21056 } 21057 } 21058 21059 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask { 21060 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask{} 21061 removedSelectors := make([]bool, 5) 21062 21063 for _, path := range other.GetPaths() { 21064 switch tp := path.(type) { 21065 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath: 21066 removedSelectors[int(tp.selector)] = true 21067 } 21068 } 21069 for _, path := range fieldMask.GetPaths() { 21070 if !removedSelectors[int(path.Selector())] { 21071 result.Paths = append(result.Paths, path) 21072 } 21073 } 21074 21075 if len(result.Paths) == 0 { 21076 return nil 21077 } 21078 return result 21079 } 21080 21081 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 21082 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask)) 21083 } 21084 21085 // FilterInputFields generates copy of field paths with output_only field paths removed 21086 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask { 21087 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask{} 21088 result.Paths = append(result.Paths, fieldMask.Paths...) 21089 return result 21090 } 21091 21092 // ToFieldMask is used for proto conversions 21093 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 21094 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21095 for _, path := range fieldMask.Paths { 21096 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 21097 } 21098 return protoFieldMask 21099 } 21100 21101 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 21102 if fieldMask == nil { 21103 return status.Error(codes.Internal, "target field mask is nil") 21104 } 21105 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath, 0, len(protoFieldMask.Paths)) 21106 for _, strPath := range protoFieldMask.Paths { 21107 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath(strPath) 21108 if err != nil { 21109 return err 21110 } 21111 fieldMask.Paths = append(fieldMask.Paths, path) 21112 } 21113 return nil 21114 } 21115 21116 // implement methods required by customType 21117 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Marshal() ([]byte, error) { 21118 protoFieldMask := fieldMask.ToProtoFieldMask() 21119 return proto.Marshal(protoFieldMask) 21120 } 21121 21122 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Unmarshal(data []byte) error { 21123 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21124 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 21125 return err 21126 } 21127 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21128 return err 21129 } 21130 return nil 21131 } 21132 21133 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Size() int { 21134 return proto.Size(fieldMask.ToProtoFieldMask()) 21135 } 21136 21137 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) MarshalJSON() ([]byte, error) { 21138 return json.Marshal(fieldMask.ToProtoFieldMask()) 21139 } 21140 21141 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) UnmarshalJSON(data []byte) error { 21142 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21143 if err := json.Unmarshal(data, protoFieldMask); err != nil { 21144 return err 21145 } 21146 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21147 return err 21148 } 21149 return nil 21150 } 21151 21152 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath) { 21153 fieldMask.Paths = append(fieldMask.Paths, path) 21154 } 21155 21156 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 21157 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath)) 21158 } 21159 21160 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath { 21161 if fieldMask == nil { 21162 return nil 21163 } 21164 return fieldMask.Paths 21165 } 21166 21167 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 21168 if fieldMask == nil { 21169 return nil 21170 } 21171 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 21172 for _, path := range fieldMask.Paths { 21173 rawPaths = append(rawPaths, path) 21174 } 21175 return rawPaths 21176 } 21177 21178 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) SetFromCliFlag(raw string) error { 21179 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath(raw) 21180 if err != nil { 21181 return err 21182 } 21183 fieldMask.Paths = append(fieldMask.Paths, path) 21184 return nil 21185 } 21186 21187 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo) { 21188 for _, path := range fieldMask.Paths { 21189 val, _ := path.GetSingle(source) 21190 // if val is nil, then field does not exist in source, skip 21191 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 21192 if val != nil { 21193 path.WithIValue(val).SetTo(&target) 21194 } 21195 } 21196 } 21197 21198 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 21199 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo)) 21200 } 21201 21202 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo { 21203 if source == nil { 21204 return nil 21205 } 21206 if fieldMask == nil { 21207 return source 21208 } 21209 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo{} 21210 21211 for _, p := range fieldMask.Paths { 21212 switch tp := p.(type) { 21213 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldTerminalPath: 21214 switch tp.selector { 21215 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorEcio: 21216 result.Ecio = source.Ecio 21217 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorErrorRate: 21218 result.ErrorRate = source.ErrorRate 21219 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorIo: 21220 result.Io = source.Io 21221 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorRssi: 21222 result.Rssi = source.Rssi 21223 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPathSelectorSinr: 21224 result.Sinr = source.Sinr 21225 } 21226 } 21227 } 21228 return result 21229 } 21230 21231 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 21232 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo)) 21233 } 21234 21235 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask) PathsCount() int { 21236 if fieldMask == nil { 21237 return 0 21238 } 21239 return len(fieldMask.Paths) 21240 } 21241 21242 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask struct { 21243 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath 21244 } 21245 21246 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask { 21247 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask{} 21248 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPathSelectorErrorRate}) 21249 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPathSelectorRssi}) 21250 return res 21251 } 21252 21253 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) String() string { 21254 if fieldMask == nil { 21255 return "<nil>" 21256 } 21257 pathsStr := make([]string, 0, len(fieldMask.Paths)) 21258 for _, path := range fieldMask.Paths { 21259 pathsStr = append(pathsStr, path.String()) 21260 } 21261 return strings.Join(pathsStr, ", ") 21262 } 21263 21264 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) IsFull() bool { 21265 if fieldMask == nil { 21266 return false 21267 } 21268 presentSelectors := make([]bool, 2) 21269 for _, path := range fieldMask.Paths { 21270 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldTerminalPath); ok { 21271 presentSelectors[int(asFinal.selector)] = true 21272 } 21273 } 21274 for _, flag := range presentSelectors { 21275 if !flag { 21276 return false 21277 } 21278 } 21279 return true 21280 } 21281 21282 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) ProtoReflect() preflect.Message { 21283 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 21284 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath(raw) 21285 }) 21286 } 21287 21288 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) ProtoMessage() { 21289 } 21290 21291 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Reset() { 21292 if fieldMask != nil { 21293 fieldMask.Paths = nil 21294 } 21295 } 21296 21297 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask { 21298 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask{} 21299 removedSelectors := make([]bool, 2) 21300 21301 for _, path := range other.GetPaths() { 21302 switch tp := path.(type) { 21303 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldTerminalPath: 21304 removedSelectors[int(tp.selector)] = true 21305 } 21306 } 21307 for _, path := range fieldMask.GetPaths() { 21308 if !removedSelectors[int(path.Selector())] { 21309 result.Paths = append(result.Paths, path) 21310 } 21311 } 21312 21313 if len(result.Paths) == 0 { 21314 return nil 21315 } 21316 return result 21317 } 21318 21319 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 21320 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask)) 21321 } 21322 21323 // FilterInputFields generates copy of field paths with output_only field paths removed 21324 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask { 21325 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask{} 21326 result.Paths = append(result.Paths, fieldMask.Paths...) 21327 return result 21328 } 21329 21330 // ToFieldMask is used for proto conversions 21331 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 21332 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21333 for _, path := range fieldMask.Paths { 21334 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 21335 } 21336 return protoFieldMask 21337 } 21338 21339 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 21340 if fieldMask == nil { 21341 return status.Error(codes.Internal, "target field mask is nil") 21342 } 21343 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath, 0, len(protoFieldMask.Paths)) 21344 for _, strPath := range protoFieldMask.Paths { 21345 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath(strPath) 21346 if err != nil { 21347 return err 21348 } 21349 fieldMask.Paths = append(fieldMask.Paths, path) 21350 } 21351 return nil 21352 } 21353 21354 // implement methods required by customType 21355 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Marshal() ([]byte, error) { 21356 protoFieldMask := fieldMask.ToProtoFieldMask() 21357 return proto.Marshal(protoFieldMask) 21358 } 21359 21360 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Unmarshal(data []byte) error { 21361 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21362 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 21363 return err 21364 } 21365 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21366 return err 21367 } 21368 return nil 21369 } 21370 21371 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Size() int { 21372 return proto.Size(fieldMask.ToProtoFieldMask()) 21373 } 21374 21375 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) MarshalJSON() ([]byte, error) { 21376 return json.Marshal(fieldMask.ToProtoFieldMask()) 21377 } 21378 21379 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) UnmarshalJSON(data []byte) error { 21380 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21381 if err := json.Unmarshal(data, protoFieldMask); err != nil { 21382 return err 21383 } 21384 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21385 return err 21386 } 21387 return nil 21388 } 21389 21390 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath) { 21391 fieldMask.Paths = append(fieldMask.Paths, path) 21392 } 21393 21394 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 21395 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath)) 21396 } 21397 21398 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath { 21399 if fieldMask == nil { 21400 return nil 21401 } 21402 return fieldMask.Paths 21403 } 21404 21405 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) GetRawPaths() []gotenobject.FieldPath { 21406 if fieldMask == nil { 21407 return nil 21408 } 21409 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 21410 for _, path := range fieldMask.Paths { 21411 rawPaths = append(rawPaths, path) 21412 } 21413 return rawPaths 21414 } 21415 21416 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) SetFromCliFlag(raw string) error { 21417 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath(raw) 21418 if err != nil { 21419 return err 21420 } 21421 fieldMask.Paths = append(fieldMask.Paths, path) 21422 return nil 21423 } 21424 21425 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm) { 21426 for _, path := range fieldMask.Paths { 21427 val, _ := path.GetSingle(source) 21428 // if val is nil, then field does not exist in source, skip 21429 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 21430 if val != nil { 21431 path.WithIValue(val).SetTo(&target) 21432 } 21433 } 21434 } 21435 21436 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 21437 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm)) 21438 } 21439 21440 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm { 21441 if source == nil { 21442 return nil 21443 } 21444 if fieldMask == nil { 21445 return source 21446 } 21447 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm{} 21448 21449 for _, p := range fieldMask.Paths { 21450 switch tp := p.(type) { 21451 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldTerminalPath: 21452 switch tp.selector { 21453 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPathSelectorErrorRate: 21454 result.ErrorRate = source.ErrorRate 21455 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPathSelectorRssi: 21456 result.Rssi = source.Rssi 21457 } 21458 } 21459 } 21460 return result 21461 } 21462 21463 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 21464 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm)) 21465 } 21466 21467 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask) PathsCount() int { 21468 if fieldMask == nil { 21469 return 0 21470 } 21471 return len(fieldMask.Paths) 21472 } 21473 21474 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask struct { 21475 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath 21476 } 21477 21478 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask { 21479 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask{} 21480 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorErrorRate}) 21481 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorRsrp}) 21482 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorRsrq}) 21483 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorRssi}) 21484 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorSnr}) 21485 return res 21486 } 21487 21488 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) String() string { 21489 if fieldMask == nil { 21490 return "<nil>" 21491 } 21492 pathsStr := make([]string, 0, len(fieldMask.Paths)) 21493 for _, path := range fieldMask.Paths { 21494 pathsStr = append(pathsStr, path.String()) 21495 } 21496 return strings.Join(pathsStr, ", ") 21497 } 21498 21499 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) IsFull() bool { 21500 if fieldMask == nil { 21501 return false 21502 } 21503 presentSelectors := make([]bool, 5) 21504 for _, path := range fieldMask.Paths { 21505 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath); ok { 21506 presentSelectors[int(asFinal.selector)] = true 21507 } 21508 } 21509 for _, flag := range presentSelectors { 21510 if !flag { 21511 return false 21512 } 21513 } 21514 return true 21515 } 21516 21517 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) ProtoReflect() preflect.Message { 21518 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 21519 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath(raw) 21520 }) 21521 } 21522 21523 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) ProtoMessage() { 21524 } 21525 21526 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Reset() { 21527 if fieldMask != nil { 21528 fieldMask.Paths = nil 21529 } 21530 } 21531 21532 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask { 21533 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask{} 21534 removedSelectors := make([]bool, 5) 21535 21536 for _, path := range other.GetPaths() { 21537 switch tp := path.(type) { 21538 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath: 21539 removedSelectors[int(tp.selector)] = true 21540 } 21541 } 21542 for _, path := range fieldMask.GetPaths() { 21543 if !removedSelectors[int(path.Selector())] { 21544 result.Paths = append(result.Paths, path) 21545 } 21546 } 21547 21548 if len(result.Paths) == 0 { 21549 return nil 21550 } 21551 return result 21552 } 21553 21554 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 21555 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask)) 21556 } 21557 21558 // FilterInputFields generates copy of field paths with output_only field paths removed 21559 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask { 21560 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask{} 21561 result.Paths = append(result.Paths, fieldMask.Paths...) 21562 return result 21563 } 21564 21565 // ToFieldMask is used for proto conversions 21566 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 21567 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21568 for _, path := range fieldMask.Paths { 21569 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 21570 } 21571 return protoFieldMask 21572 } 21573 21574 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 21575 if fieldMask == nil { 21576 return status.Error(codes.Internal, "target field mask is nil") 21577 } 21578 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath, 0, len(protoFieldMask.Paths)) 21579 for _, strPath := range protoFieldMask.Paths { 21580 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath(strPath) 21581 if err != nil { 21582 return err 21583 } 21584 fieldMask.Paths = append(fieldMask.Paths, path) 21585 } 21586 return nil 21587 } 21588 21589 // implement methods required by customType 21590 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Marshal() ([]byte, error) { 21591 protoFieldMask := fieldMask.ToProtoFieldMask() 21592 return proto.Marshal(protoFieldMask) 21593 } 21594 21595 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Unmarshal(data []byte) error { 21596 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21597 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 21598 return err 21599 } 21600 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21601 return err 21602 } 21603 return nil 21604 } 21605 21606 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Size() int { 21607 return proto.Size(fieldMask.ToProtoFieldMask()) 21608 } 21609 21610 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) MarshalJSON() ([]byte, error) { 21611 return json.Marshal(fieldMask.ToProtoFieldMask()) 21612 } 21613 21614 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) UnmarshalJSON(data []byte) error { 21615 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21616 if err := json.Unmarshal(data, protoFieldMask); err != nil { 21617 return err 21618 } 21619 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21620 return err 21621 } 21622 return nil 21623 } 21624 21625 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath) { 21626 fieldMask.Paths = append(fieldMask.Paths, path) 21627 } 21628 21629 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 21630 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath)) 21631 } 21632 21633 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath { 21634 if fieldMask == nil { 21635 return nil 21636 } 21637 return fieldMask.Paths 21638 } 21639 21640 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) GetRawPaths() []gotenobject.FieldPath { 21641 if fieldMask == nil { 21642 return nil 21643 } 21644 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 21645 for _, path := range fieldMask.Paths { 21646 rawPaths = append(rawPaths, path) 21647 } 21648 return rawPaths 21649 } 21650 21651 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) SetFromCliFlag(raw string) error { 21652 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath(raw) 21653 if err != nil { 21654 return err 21655 } 21656 fieldMask.Paths = append(fieldMask.Paths, path) 21657 return nil 21658 } 21659 21660 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte) { 21661 for _, path := range fieldMask.Paths { 21662 val, _ := path.GetSingle(source) 21663 // if val is nil, then field does not exist in source, skip 21664 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 21665 if val != nil { 21666 path.WithIValue(val).SetTo(&target) 21667 } 21668 } 21669 } 21670 21671 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 21672 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte)) 21673 } 21674 21675 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte { 21676 if source == nil { 21677 return nil 21678 } 21679 if fieldMask == nil { 21680 return source 21681 } 21682 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte{} 21683 21684 for _, p := range fieldMask.Paths { 21685 switch tp := p.(type) { 21686 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldTerminalPath: 21687 switch tp.selector { 21688 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorErrorRate: 21689 result.ErrorRate = source.ErrorRate 21690 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorRsrp: 21691 result.Rsrp = source.Rsrp 21692 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorRsrq: 21693 result.Rsrq = source.Rsrq 21694 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorRssi: 21695 result.Rssi = source.Rssi 21696 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPathSelectorSnr: 21697 result.Snr = source.Snr 21698 } 21699 } 21700 } 21701 return result 21702 } 21703 21704 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 21705 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte)) 21706 } 21707 21708 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask) PathsCount() int { 21709 if fieldMask == nil { 21710 return 0 21711 } 21712 return len(fieldMask.Paths) 21713 } 21714 21715 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask struct { 21716 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath 21717 } 21718 21719 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask { 21720 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask{} 21721 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPathSelectorRate}) 21722 return res 21723 } 21724 21725 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) String() string { 21726 if fieldMask == nil { 21727 return "<nil>" 21728 } 21729 pathsStr := make([]string, 0, len(fieldMask.Paths)) 21730 for _, path := range fieldMask.Paths { 21731 pathsStr = append(pathsStr, path.String()) 21732 } 21733 return strings.Join(pathsStr, ", ") 21734 } 21735 21736 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) IsFull() bool { 21737 if fieldMask == nil { 21738 return false 21739 } 21740 presentSelectors := make([]bool, 1) 21741 for _, path := range fieldMask.Paths { 21742 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldTerminalPath); ok { 21743 presentSelectors[int(asFinal.selector)] = true 21744 } 21745 } 21746 for _, flag := range presentSelectors { 21747 if !flag { 21748 return false 21749 } 21750 } 21751 return true 21752 } 21753 21754 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) ProtoReflect() preflect.Message { 21755 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 21756 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath(raw) 21757 }) 21758 } 21759 21760 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) ProtoMessage() { 21761 } 21762 21763 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Reset() { 21764 if fieldMask != nil { 21765 fieldMask.Paths = nil 21766 } 21767 } 21768 21769 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask { 21770 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask{} 21771 removedSelectors := make([]bool, 1) 21772 21773 for _, path := range other.GetPaths() { 21774 switch tp := path.(type) { 21775 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldTerminalPath: 21776 removedSelectors[int(tp.selector)] = true 21777 } 21778 } 21779 for _, path := range fieldMask.GetPaths() { 21780 if !removedSelectors[int(path.Selector())] { 21781 result.Paths = append(result.Paths, path) 21782 } 21783 } 21784 21785 if len(result.Paths) == 0 { 21786 return nil 21787 } 21788 return result 21789 } 21790 21791 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 21792 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask)) 21793 } 21794 21795 // FilterInputFields generates copy of field paths with output_only field paths removed 21796 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask { 21797 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask{} 21798 result.Paths = append(result.Paths, fieldMask.Paths...) 21799 return result 21800 } 21801 21802 // ToFieldMask is used for proto conversions 21803 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 21804 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21805 for _, path := range fieldMask.Paths { 21806 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 21807 } 21808 return protoFieldMask 21809 } 21810 21811 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 21812 if fieldMask == nil { 21813 return status.Error(codes.Internal, "target field mask is nil") 21814 } 21815 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath, 0, len(protoFieldMask.Paths)) 21816 for _, strPath := range protoFieldMask.Paths { 21817 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath(strPath) 21818 if err != nil { 21819 return err 21820 } 21821 fieldMask.Paths = append(fieldMask.Paths, path) 21822 } 21823 return nil 21824 } 21825 21826 // implement methods required by customType 21827 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Marshal() ([]byte, error) { 21828 protoFieldMask := fieldMask.ToProtoFieldMask() 21829 return proto.Marshal(protoFieldMask) 21830 } 21831 21832 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Unmarshal(data []byte) error { 21833 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21834 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 21835 return err 21836 } 21837 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21838 return err 21839 } 21840 return nil 21841 } 21842 21843 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Size() int { 21844 return proto.Size(fieldMask.ToProtoFieldMask()) 21845 } 21846 21847 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) MarshalJSON() ([]byte, error) { 21848 return json.Marshal(fieldMask.ToProtoFieldMask()) 21849 } 21850 21851 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) UnmarshalJSON(data []byte) error { 21852 protoFieldMask := &googlefieldmaskpb.FieldMask{} 21853 if err := json.Unmarshal(data, protoFieldMask); err != nil { 21854 return err 21855 } 21856 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 21857 return err 21858 } 21859 return nil 21860 } 21861 21862 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath) { 21863 fieldMask.Paths = append(fieldMask.Paths, path) 21864 } 21865 21866 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 21867 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath)) 21868 } 21869 21870 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath { 21871 if fieldMask == nil { 21872 return nil 21873 } 21874 return fieldMask.Paths 21875 } 21876 21877 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) GetRawPaths() []gotenobject.FieldPath { 21878 if fieldMask == nil { 21879 return nil 21880 } 21881 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 21882 for _, path := range fieldMask.Paths { 21883 rawPaths = append(rawPaths, path) 21884 } 21885 return rawPaths 21886 } 21887 21888 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) SetFromCliFlag(raw string) error { 21889 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath(raw) 21890 if err != nil { 21891 return err 21892 } 21893 fieldMask.Paths = append(fieldMask.Paths, path) 21894 return nil 21895 } 21896 21897 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh) { 21898 for _, path := range fieldMask.Paths { 21899 val, _ := path.GetSingle(source) 21900 // if val is nil, then field does not exist in source, skip 21901 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 21902 if val != nil { 21903 path.WithIValue(val).SetTo(&target) 21904 } 21905 } 21906 } 21907 21908 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 21909 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh)) 21910 } 21911 21912 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh { 21913 if source == nil { 21914 return nil 21915 } 21916 if fieldMask == nil { 21917 return source 21918 } 21919 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh{} 21920 21921 for _, p := range fieldMask.Paths { 21922 switch tp := p.(type) { 21923 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldTerminalPath: 21924 switch tp.selector { 21925 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPathSelectorRate: 21926 result.Rate = source.Rate 21927 } 21928 } 21929 } 21930 return result 21931 } 21932 21933 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 21934 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh)) 21935 } 21936 21937 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask) PathsCount() int { 21938 if fieldMask == nil { 21939 return 0 21940 } 21941 return len(fieldMask.Paths) 21942 } 21943 21944 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask struct { 21945 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath 21946 } 21947 21948 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask { 21949 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask{} 21950 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPathSelectorErrorRate}) 21951 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPathSelectorRssi}) 21952 return res 21953 } 21954 21955 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) String() string { 21956 if fieldMask == nil { 21957 return "<nil>" 21958 } 21959 pathsStr := make([]string, 0, len(fieldMask.Paths)) 21960 for _, path := range fieldMask.Paths { 21961 pathsStr = append(pathsStr, path.String()) 21962 } 21963 return strings.Join(pathsStr, ", ") 21964 } 21965 21966 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) IsFull() bool { 21967 if fieldMask == nil { 21968 return false 21969 } 21970 presentSelectors := make([]bool, 2) 21971 for _, path := range fieldMask.Paths { 21972 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldTerminalPath); ok { 21973 presentSelectors[int(asFinal.selector)] = true 21974 } 21975 } 21976 for _, flag := range presentSelectors { 21977 if !flag { 21978 return false 21979 } 21980 } 21981 return true 21982 } 21983 21984 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) ProtoReflect() preflect.Message { 21985 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 21986 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath(raw) 21987 }) 21988 } 21989 21990 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) ProtoMessage() { 21991 } 21992 21993 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Reset() { 21994 if fieldMask != nil { 21995 fieldMask.Paths = nil 21996 } 21997 } 21998 21999 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask { 22000 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask{} 22001 removedSelectors := make([]bool, 2) 22002 22003 for _, path := range other.GetPaths() { 22004 switch tp := path.(type) { 22005 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldTerminalPath: 22006 removedSelectors[int(tp.selector)] = true 22007 } 22008 } 22009 for _, path := range fieldMask.GetPaths() { 22010 if !removedSelectors[int(path.Selector())] { 22011 result.Paths = append(result.Paths, path) 22012 } 22013 } 22014 22015 if len(result.Paths) == 0 { 22016 return nil 22017 } 22018 return result 22019 } 22020 22021 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 22022 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask)) 22023 } 22024 22025 // FilterInputFields generates copy of field paths with output_only field paths removed 22026 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask { 22027 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask{} 22028 result.Paths = append(result.Paths, fieldMask.Paths...) 22029 return result 22030 } 22031 22032 // ToFieldMask is used for proto conversions 22033 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 22034 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22035 for _, path := range fieldMask.Paths { 22036 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 22037 } 22038 return protoFieldMask 22039 } 22040 22041 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 22042 if fieldMask == nil { 22043 return status.Error(codes.Internal, "target field mask is nil") 22044 } 22045 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath, 0, len(protoFieldMask.Paths)) 22046 for _, strPath := range protoFieldMask.Paths { 22047 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath(strPath) 22048 if err != nil { 22049 return err 22050 } 22051 fieldMask.Paths = append(fieldMask.Paths, path) 22052 } 22053 return nil 22054 } 22055 22056 // implement methods required by customType 22057 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Marshal() ([]byte, error) { 22058 protoFieldMask := fieldMask.ToProtoFieldMask() 22059 return proto.Marshal(protoFieldMask) 22060 } 22061 22062 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Unmarshal(data []byte) error { 22063 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22064 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 22065 return err 22066 } 22067 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22068 return err 22069 } 22070 return nil 22071 } 22072 22073 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Size() int { 22074 return proto.Size(fieldMask.ToProtoFieldMask()) 22075 } 22076 22077 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) MarshalJSON() ([]byte, error) { 22078 return json.Marshal(fieldMask.ToProtoFieldMask()) 22079 } 22080 22081 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) UnmarshalJSON(data []byte) error { 22082 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22083 if err := json.Unmarshal(data, protoFieldMask); err != nil { 22084 return err 22085 } 22086 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22087 return err 22088 } 22089 return nil 22090 } 22091 22092 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath) { 22093 fieldMask.Paths = append(fieldMask.Paths, path) 22094 } 22095 22096 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 22097 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath)) 22098 } 22099 22100 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath { 22101 if fieldMask == nil { 22102 return nil 22103 } 22104 return fieldMask.Paths 22105 } 22106 22107 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) GetRawPaths() []gotenobject.FieldPath { 22108 if fieldMask == nil { 22109 return nil 22110 } 22111 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 22112 for _, path := range fieldMask.Paths { 22113 rawPaths = append(rawPaths, path) 22114 } 22115 return rawPaths 22116 } 22117 22118 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) SetFromCliFlag(raw string) error { 22119 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath(raw) 22120 if err != nil { 22121 return err 22122 } 22123 fieldMask.Paths = append(fieldMask.Paths, path) 22124 return nil 22125 } 22126 22127 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold) { 22128 for _, path := range fieldMask.Paths { 22129 val, _ := path.GetSingle(source) 22130 // if val is nil, then field does not exist in source, skip 22131 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 22132 if val != nil { 22133 path.WithIValue(val).SetTo(&target) 22134 } 22135 } 22136 } 22137 22138 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 22139 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold)) 22140 } 22141 22142 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold { 22143 if source == nil { 22144 return nil 22145 } 22146 if fieldMask == nil { 22147 return source 22148 } 22149 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold{} 22150 22151 for _, p := range fieldMask.Paths { 22152 switch tp := p.(type) { 22153 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldTerminalPath: 22154 switch tp.selector { 22155 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPathSelectorErrorRate: 22156 result.ErrorRate = source.ErrorRate 22157 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPathSelectorRssi: 22158 result.Rssi = source.Rssi 22159 } 22160 } 22161 } 22162 return result 22163 } 22164 22165 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 22166 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold)) 22167 } 22168 22169 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask) PathsCount() int { 22170 if fieldMask == nil { 22171 return 0 22172 } 22173 return len(fieldMask.Paths) 22174 } 22175 22176 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask struct { 22177 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath 22178 } 22179 22180 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask { 22181 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask{} 22182 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorEcio}) 22183 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorErrorRate}) 22184 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorRscp}) 22185 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorRssi}) 22186 return res 22187 } 22188 22189 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) String() string { 22190 if fieldMask == nil { 22191 return "<nil>" 22192 } 22193 pathsStr := make([]string, 0, len(fieldMask.Paths)) 22194 for _, path := range fieldMask.Paths { 22195 pathsStr = append(pathsStr, path.String()) 22196 } 22197 return strings.Join(pathsStr, ", ") 22198 } 22199 22200 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) IsFull() bool { 22201 if fieldMask == nil { 22202 return false 22203 } 22204 presentSelectors := make([]bool, 4) 22205 for _, path := range fieldMask.Paths { 22206 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath); ok { 22207 presentSelectors[int(asFinal.selector)] = true 22208 } 22209 } 22210 for _, flag := range presentSelectors { 22211 if !flag { 22212 return false 22213 } 22214 } 22215 return true 22216 } 22217 22218 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) ProtoReflect() preflect.Message { 22219 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 22220 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath(raw) 22221 }) 22222 } 22223 22224 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) ProtoMessage() { 22225 } 22226 22227 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Reset() { 22228 if fieldMask != nil { 22229 fieldMask.Paths = nil 22230 } 22231 } 22232 22233 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask { 22234 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask{} 22235 removedSelectors := make([]bool, 4) 22236 22237 for _, path := range other.GetPaths() { 22238 switch tp := path.(type) { 22239 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath: 22240 removedSelectors[int(tp.selector)] = true 22241 } 22242 } 22243 for _, path := range fieldMask.GetPaths() { 22244 if !removedSelectors[int(path.Selector())] { 22245 result.Paths = append(result.Paths, path) 22246 } 22247 } 22248 22249 if len(result.Paths) == 0 { 22250 return nil 22251 } 22252 return result 22253 } 22254 22255 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 22256 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask)) 22257 } 22258 22259 // FilterInputFields generates copy of field paths with output_only field paths removed 22260 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask { 22261 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask{} 22262 result.Paths = append(result.Paths, fieldMask.Paths...) 22263 return result 22264 } 22265 22266 // ToFieldMask is used for proto conversions 22267 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 22268 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22269 for _, path := range fieldMask.Paths { 22270 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 22271 } 22272 return protoFieldMask 22273 } 22274 22275 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 22276 if fieldMask == nil { 22277 return status.Error(codes.Internal, "target field mask is nil") 22278 } 22279 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath, 0, len(protoFieldMask.Paths)) 22280 for _, strPath := range protoFieldMask.Paths { 22281 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath(strPath) 22282 if err != nil { 22283 return err 22284 } 22285 fieldMask.Paths = append(fieldMask.Paths, path) 22286 } 22287 return nil 22288 } 22289 22290 // implement methods required by customType 22291 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Marshal() ([]byte, error) { 22292 protoFieldMask := fieldMask.ToProtoFieldMask() 22293 return proto.Marshal(protoFieldMask) 22294 } 22295 22296 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Unmarshal(data []byte) error { 22297 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22298 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 22299 return err 22300 } 22301 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22302 return err 22303 } 22304 return nil 22305 } 22306 22307 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Size() int { 22308 return proto.Size(fieldMask.ToProtoFieldMask()) 22309 } 22310 22311 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) MarshalJSON() ([]byte, error) { 22312 return json.Marshal(fieldMask.ToProtoFieldMask()) 22313 } 22314 22315 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) UnmarshalJSON(data []byte) error { 22316 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22317 if err := json.Unmarshal(data, protoFieldMask); err != nil { 22318 return err 22319 } 22320 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22321 return err 22322 } 22323 return nil 22324 } 22325 22326 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath) { 22327 fieldMask.Paths = append(fieldMask.Paths, path) 22328 } 22329 22330 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 22331 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath)) 22332 } 22333 22334 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath { 22335 if fieldMask == nil { 22336 return nil 22337 } 22338 return fieldMask.Paths 22339 } 22340 22341 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) GetRawPaths() []gotenobject.FieldPath { 22342 if fieldMask == nil { 22343 return nil 22344 } 22345 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 22346 for _, path := range fieldMask.Paths { 22347 rawPaths = append(rawPaths, path) 22348 } 22349 return rawPaths 22350 } 22351 22352 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) SetFromCliFlag(raw string) error { 22353 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath(raw) 22354 if err != nil { 22355 return err 22356 } 22357 fieldMask.Paths = append(fieldMask.Paths, path) 22358 return nil 22359 } 22360 22361 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts) { 22362 for _, path := range fieldMask.Paths { 22363 val, _ := path.GetSingle(source) 22364 // if val is nil, then field does not exist in source, skip 22365 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 22366 if val != nil { 22367 path.WithIValue(val).SetTo(&target) 22368 } 22369 } 22370 } 22371 22372 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 22373 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts)) 22374 } 22375 22376 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts { 22377 if source == nil { 22378 return nil 22379 } 22380 if fieldMask == nil { 22381 return source 22382 } 22383 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts{} 22384 22385 for _, p := range fieldMask.Paths { 22386 switch tp := p.(type) { 22387 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldTerminalPath: 22388 switch tp.selector { 22389 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorEcio: 22390 result.Ecio = source.Ecio 22391 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorErrorRate: 22392 result.ErrorRate = source.ErrorRate 22393 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorRscp: 22394 result.Rscp = source.Rscp 22395 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPathSelectorRssi: 22396 result.Rssi = source.Rssi 22397 } 22398 } 22399 } 22400 return result 22401 } 22402 22403 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 22404 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts)) 22405 } 22406 22407 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask) PathsCount() int { 22408 if fieldMask == nil { 22409 return 0 22410 } 22411 return len(fieldMask.Paths) 22412 } 22413 22414 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask struct { 22415 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath 22416 } 22417 22418 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask { 22419 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask{} 22420 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG}) 22421 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X}) 22422 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo}) 22423 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm}) 22424 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal}) 22425 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh}) 22426 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold}) 22427 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts}) 22428 return res 22429 } 22430 22431 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) String() string { 22432 if fieldMask == nil { 22433 return "<nil>" 22434 } 22435 pathsStr := make([]string, 0, len(fieldMask.Paths)) 22436 for _, path := range fieldMask.Paths { 22437 pathsStr = append(pathsStr, path.String()) 22438 } 22439 return strings.Join(pathsStr, ", ") 22440 } 22441 22442 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) IsFull() bool { 22443 if fieldMask == nil { 22444 return false 22445 } 22446 presentSelectors := make([]bool, 8) 22447 for _, path := range fieldMask.Paths { 22448 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath); ok { 22449 presentSelectors[int(asFinal.selector)] = true 22450 } 22451 } 22452 for _, flag := range presentSelectors { 22453 if !flag { 22454 return false 22455 } 22456 } 22457 return true 22458 } 22459 22460 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) ProtoReflect() preflect.Message { 22461 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 22462 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath(raw) 22463 }) 22464 } 22465 22466 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) ProtoMessage() { 22467 } 22468 22469 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Reset() { 22470 if fieldMask != nil { 22471 fieldMask.Paths = nil 22472 } 22473 } 22474 22475 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask { 22476 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask{} 22477 removedSelectors := make([]bool, 8) 22478 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelector]gotenobject.FieldMask{ 22479 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask{}, 22480 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask{}, 22481 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask{}, 22482 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask{}, 22483 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask{}, 22484 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask{}, 22485 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask{}, 22486 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask{}, 22487 } 22488 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelector]gotenobject.FieldMask{ 22489 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask{}, 22490 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask{}, 22491 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask{}, 22492 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask{}, 22493 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask{}, 22494 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask{}, 22495 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask{}, 22496 DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask{}, 22497 } 22498 22499 for _, path := range other.GetPaths() { 22500 switch tp := path.(type) { 22501 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath: 22502 removedSelectors[int(tp.selector)] = true 22503 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldSubPath: 22504 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 22505 } 22506 } 22507 for _, path := range fieldMask.GetPaths() { 22508 if !removedSelectors[int(path.Selector())] { 22509 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 22510 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath); ok { 22511 switch tp.selector { 22512 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG: 22513 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask() 22514 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X: 22515 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask() 22516 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo: 22517 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask() 22518 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm: 22519 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask() 22520 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal: 22521 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask() 22522 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh: 22523 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask() 22524 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold: 22525 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask() 22526 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts: 22527 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask() 22528 } 22529 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldSubPath); ok { 22530 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 22531 } 22532 } else { 22533 result.Paths = append(result.Paths, path) 22534 } 22535 } 22536 } 22537 for selector, mySubMask := range mySubMasks { 22538 if mySubMask.PathsCount() > 0 { 22539 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 22540 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldSubPath{selector: selector, subPath: allowedPath}) 22541 } 22542 } 22543 } 22544 22545 if len(result.Paths) == 0 { 22546 return nil 22547 } 22548 return result 22549 } 22550 22551 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 22552 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask)) 22553 } 22554 22555 // FilterInputFields generates copy of field paths with output_only field paths removed 22556 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask { 22557 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask{} 22558 result.Paths = append(result.Paths, fieldMask.Paths...) 22559 return result 22560 } 22561 22562 // ToFieldMask is used for proto conversions 22563 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 22564 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22565 for _, path := range fieldMask.Paths { 22566 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 22567 } 22568 return protoFieldMask 22569 } 22570 22571 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 22572 if fieldMask == nil { 22573 return status.Error(codes.Internal, "target field mask is nil") 22574 } 22575 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath, 0, len(protoFieldMask.Paths)) 22576 for _, strPath := range protoFieldMask.Paths { 22577 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath(strPath) 22578 if err != nil { 22579 return err 22580 } 22581 fieldMask.Paths = append(fieldMask.Paths, path) 22582 } 22583 return nil 22584 } 22585 22586 // implement methods required by customType 22587 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Marshal() ([]byte, error) { 22588 protoFieldMask := fieldMask.ToProtoFieldMask() 22589 return proto.Marshal(protoFieldMask) 22590 } 22591 22592 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Unmarshal(data []byte) error { 22593 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22594 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 22595 return err 22596 } 22597 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22598 return err 22599 } 22600 return nil 22601 } 22602 22603 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Size() int { 22604 return proto.Size(fieldMask.ToProtoFieldMask()) 22605 } 22606 22607 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) MarshalJSON() ([]byte, error) { 22608 return json.Marshal(fieldMask.ToProtoFieldMask()) 22609 } 22610 22611 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) UnmarshalJSON(data []byte) error { 22612 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22613 if err := json.Unmarshal(data, protoFieldMask); err != nil { 22614 return err 22615 } 22616 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22617 return err 22618 } 22619 return nil 22620 } 22621 22622 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath) { 22623 fieldMask.Paths = append(fieldMask.Paths, path) 22624 } 22625 22626 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 22627 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath)) 22628 } 22629 22630 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath { 22631 if fieldMask == nil { 22632 return nil 22633 } 22634 return fieldMask.Paths 22635 } 22636 22637 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) GetRawPaths() []gotenobject.FieldPath { 22638 if fieldMask == nil { 22639 return nil 22640 } 22641 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 22642 for _, path := range fieldMask.Paths { 22643 rawPaths = append(rawPaths, path) 22644 } 22645 return rawPaths 22646 } 22647 22648 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) SetFromCliFlag(raw string) error { 22649 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath(raw) 22650 if err != nil { 22651 return err 22652 } 22653 fieldMask.Paths = append(fieldMask.Paths, path) 22654 return nil 22655 } 22656 22657 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal) { 22658 for _, path := range fieldMask.Paths { 22659 val, _ := path.GetSingle(source) 22660 // if val is nil, then field does not exist in source, skip 22661 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 22662 if val != nil { 22663 path.WithIValue(val).SetTo(&target) 22664 } 22665 } 22666 } 22667 22668 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 22669 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal)) 22670 } 22671 22672 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal { 22673 if source == nil { 22674 return nil 22675 } 22676 if fieldMask == nil { 22677 return source 22678 } 22679 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal{} 22680 fiveGMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal5G_FieldMask{} 22681 wholeFiveGAccepted := false 22682 cdma1XMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalCdma1X_FieldMask{} 22683 wholeCdma1XAccepted := false 22684 evdoMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalEvdo_FieldMask{} 22685 wholeEvdoAccepted := false 22686 gsmMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalGsm_FieldMask{} 22687 wholeGsmAccepted := false 22688 lteSignalMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalLte_FieldMask{} 22689 wholeLteSignalAccepted := false 22690 refreshMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalRefresh_FieldMask{} 22691 wholeRefreshAccepted := false 22692 thresholdMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalThreshold_FieldMask{} 22693 wholeThresholdAccepted := false 22694 umtsMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalUmts_FieldMask{} 22695 wholeUmtsAccepted := false 22696 22697 for _, p := range fieldMask.Paths { 22698 switch tp := p.(type) { 22699 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldTerminalPath: 22700 switch tp.selector { 22701 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG: 22702 result.FiveG = source.FiveG 22703 wholeFiveGAccepted = true 22704 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X: 22705 result.Cdma1X = source.Cdma1X 22706 wholeCdma1XAccepted = true 22707 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo: 22708 result.Evdo = source.Evdo 22709 wholeEvdoAccepted = true 22710 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm: 22711 result.Gsm = source.Gsm 22712 wholeGsmAccepted = true 22713 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal: 22714 result.LteSignal = source.LteSignal 22715 wholeLteSignalAccepted = true 22716 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh: 22717 result.Refresh = source.Refresh 22718 wholeRefreshAccepted = true 22719 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold: 22720 result.Threshold = source.Threshold 22721 wholeThresholdAccepted = true 22722 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts: 22723 result.Umts = source.Umts 22724 wholeUmtsAccepted = true 22725 } 22726 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldSubPath: 22727 switch tp.selector { 22728 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorFiveG: 22729 fiveGMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignal5G_FieldPath)) 22730 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorCdma1X: 22731 cdma1XMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalCdma1X_FieldPath)) 22732 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorEvdo: 22733 evdoMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalEvdo_FieldPath)) 22734 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorGsm: 22735 gsmMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalGsm_FieldPath)) 22736 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorLteSignal: 22737 lteSignalMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalLte_FieldPath)) 22738 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorRefresh: 22739 refreshMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalRefresh_FieldPath)) 22740 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorThreshold: 22741 thresholdMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalThreshold_FieldPath)) 22742 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPathSelectorUmts: 22743 umtsMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalUmts_FieldPath)) 22744 } 22745 } 22746 } 22747 if wholeFiveGAccepted == false && len(fiveGMask.Paths) > 0 { 22748 result.FiveG = fiveGMask.Project(source.GetFiveG()) 22749 } 22750 if wholeCdma1XAccepted == false && len(cdma1XMask.Paths) > 0 { 22751 result.Cdma1X = cdma1XMask.Project(source.GetCdma1X()) 22752 } 22753 if wholeEvdoAccepted == false && len(evdoMask.Paths) > 0 { 22754 result.Evdo = evdoMask.Project(source.GetEvdo()) 22755 } 22756 if wholeGsmAccepted == false && len(gsmMask.Paths) > 0 { 22757 result.Gsm = gsmMask.Project(source.GetGsm()) 22758 } 22759 if wholeLteSignalAccepted == false && len(lteSignalMask.Paths) > 0 { 22760 result.LteSignal = lteSignalMask.Project(source.GetLteSignal()) 22761 } 22762 if wholeRefreshAccepted == false && len(refreshMask.Paths) > 0 { 22763 result.Refresh = refreshMask.Project(source.GetRefresh()) 22764 } 22765 if wholeThresholdAccepted == false && len(thresholdMask.Paths) > 0 { 22766 result.Threshold = thresholdMask.Project(source.GetThreshold()) 22767 } 22768 if wholeUmtsAccepted == false && len(umtsMask.Paths) > 0 { 22769 result.Umts = umtsMask.Project(source.GetUmts()) 22770 } 22771 return result 22772 } 22773 22774 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 22775 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal)) 22776 } 22777 22778 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask) PathsCount() int { 22779 if fieldMask == nil { 22780 return 0 22781 } 22782 return len(fieldMask.Paths) 22783 } 22784 22785 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask struct { 22786 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath 22787 } 22788 22789 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask { 22790 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask{} 22791 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath}) 22792 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive}) 22793 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid}) 22794 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers}) 22795 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus}) 22796 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1}) 22797 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2}) 22798 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid}) 22799 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi}) 22800 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode}) 22801 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName}) 22802 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability}) 22803 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType}) 22804 return res 22805 } 22806 22807 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) String() string { 22808 if fieldMask == nil { 22809 return "<nil>" 22810 } 22811 pathsStr := make([]string, 0, len(fieldMask.Paths)) 22812 for _, path := range fieldMask.Paths { 22813 pathsStr = append(pathsStr, path.String()) 22814 } 22815 return strings.Join(pathsStr, ", ") 22816 } 22817 22818 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) IsFull() bool { 22819 if fieldMask == nil { 22820 return false 22821 } 22822 presentSelectors := make([]bool, 13) 22823 for _, path := range fieldMask.Paths { 22824 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath); ok { 22825 presentSelectors[int(asFinal.selector)] = true 22826 } 22827 } 22828 for _, flag := range presentSelectors { 22829 if !flag { 22830 return false 22831 } 22832 } 22833 return true 22834 } 22835 22836 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) ProtoReflect() preflect.Message { 22837 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 22838 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(raw) 22839 }) 22840 } 22841 22842 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) ProtoMessage() { 22843 } 22844 22845 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Reset() { 22846 if fieldMask != nil { 22847 fieldMask.Paths = nil 22848 } 22849 } 22850 22851 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask { 22852 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask{} 22853 removedSelectors := make([]bool, 13) 22854 22855 for _, path := range other.GetPaths() { 22856 switch tp := path.(type) { 22857 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: 22858 removedSelectors[int(tp.selector)] = true 22859 } 22860 } 22861 for _, path := range fieldMask.GetPaths() { 22862 if !removedSelectors[int(path.Selector())] { 22863 result.Paths = append(result.Paths, path) 22864 } 22865 } 22866 22867 if len(result.Paths) == 0 { 22868 return nil 22869 } 22870 return result 22871 } 22872 22873 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 22874 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask)) 22875 } 22876 22877 // FilterInputFields generates copy of field paths with output_only field paths removed 22878 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask { 22879 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask{} 22880 result.Paths = append(result.Paths, fieldMask.Paths...) 22881 return result 22882 } 22883 22884 // ToFieldMask is used for proto conversions 22885 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 22886 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22887 for _, path := range fieldMask.Paths { 22888 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 22889 } 22890 return protoFieldMask 22891 } 22892 22893 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 22894 if fieldMask == nil { 22895 return status.Error(codes.Internal, "target field mask is nil") 22896 } 22897 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath, 0, len(protoFieldMask.Paths)) 22898 for _, strPath := range protoFieldMask.Paths { 22899 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(strPath) 22900 if err != nil { 22901 return err 22902 } 22903 fieldMask.Paths = append(fieldMask.Paths, path) 22904 } 22905 return nil 22906 } 22907 22908 // implement methods required by customType 22909 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Marshal() ([]byte, error) { 22910 protoFieldMask := fieldMask.ToProtoFieldMask() 22911 return proto.Marshal(protoFieldMask) 22912 } 22913 22914 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Unmarshal(data []byte) error { 22915 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22916 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 22917 return err 22918 } 22919 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22920 return err 22921 } 22922 return nil 22923 } 22924 22925 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Size() int { 22926 return proto.Size(fieldMask.ToProtoFieldMask()) 22927 } 22928 22929 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) MarshalJSON() ([]byte, error) { 22930 return json.Marshal(fieldMask.ToProtoFieldMask()) 22931 } 22932 22933 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) UnmarshalJSON(data []byte) error { 22934 protoFieldMask := &googlefieldmaskpb.FieldMask{} 22935 if err := json.Unmarshal(data, protoFieldMask); err != nil { 22936 return err 22937 } 22938 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 22939 return err 22940 } 22941 return nil 22942 } 22943 22944 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath) { 22945 fieldMask.Paths = append(fieldMask.Paths, path) 22946 } 22947 22948 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 22949 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath)) 22950 } 22951 22952 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath { 22953 if fieldMask == nil { 22954 return nil 22955 } 22956 return fieldMask.Paths 22957 } 22958 22959 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) GetRawPaths() []gotenobject.FieldPath { 22960 if fieldMask == nil { 22961 return nil 22962 } 22963 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 22964 for _, path := range fieldMask.Paths { 22965 rawPaths = append(rawPaths, path) 22966 } 22967 return rawPaths 22968 } 22969 22970 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) SetFromCliFlag(raw string) error { 22971 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(raw) 22972 if err != nil { 22973 return err 22974 } 22975 fieldMask.Paths = append(fieldMask.Paths, path) 22976 return nil 22977 } 22978 22979 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) { 22980 for _, path := range fieldMask.Paths { 22981 val, _ := path.GetSingle(source) 22982 // if val is nil, then field does not exist in source, skip 22983 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 22984 if val != nil { 22985 path.WithIValue(val).SetTo(&target) 22986 } 22987 } 22988 } 22989 22990 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 22991 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 22992 } 22993 22994 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus { 22995 if source == nil { 22996 return nil 22997 } 22998 if fieldMask == nil { 22999 return source 23000 } 23001 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus{} 23002 23003 for _, p := range fieldMask.Paths { 23004 switch tp := p.(type) { 23005 case *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: 23006 switch tp.selector { 23007 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 23008 result.DbusPath = source.DbusPath 23009 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 23010 result.Active = source.Active 23011 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 23012 result.Eid = source.Eid 23013 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 23014 result.EmergencyNumbers = source.EmergencyNumbers 23015 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 23016 result.EsimStatus = source.EsimStatus 23017 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 23018 result.Gid1 = source.Gid1 23019 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 23020 result.Gid2 = source.Gid2 23021 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 23022 result.Iccid = source.Iccid 23023 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 23024 result.Imsi = source.Imsi 23025 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 23026 result.OperatorCode = source.OperatorCode 23027 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 23028 result.OperatorName = source.OperatorName 23029 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 23030 result.Removability = source.Removability 23031 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 23032 result.SimType = source.SimType 23033 } 23034 } 23035 } 23036 return result 23037 } 23038 23039 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 23040 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 23041 } 23042 23043 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus_FieldMask) PathsCount() int { 23044 if fieldMask == nil { 23045 return 0 23046 } 23047 return len(fieldMask.Paths) 23048 } 23049 23050 type Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask struct { 23051 Paths []DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 23052 } 23053 23054 func FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask { 23055 res := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask{} 23056 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp}) 23057 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma}) 23058 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath}) 23059 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric}) 23060 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal}) 23061 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus}) 23062 return res 23063 } 23064 23065 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) String() string { 23066 if fieldMask == nil { 23067 return "<nil>" 23068 } 23069 pathsStr := make([]string, 0, len(fieldMask.Paths)) 23070 for _, path := range fieldMask.Paths { 23071 pathsStr = append(pathsStr, path.String()) 23072 } 23073 return strings.Join(pathsStr, ", ") 23074 } 23075 23076 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) IsFull() bool { 23077 if fieldMask == nil { 23078 return false 23079 } 23080 presentSelectors := make([]bool, 6) 23081 for _, path := range fieldMask.Paths { 23082 if asFinal, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath); ok { 23083 presentSelectors[int(asFinal.selector)] = true 23084 } 23085 } 23086 for _, flag := range presentSelectors { 23087 if !flag { 23088 return false 23089 } 23090 } 23091 return true 23092 } 23093 23094 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) ProtoReflect() preflect.Message { 23095 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 23096 return ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(raw) 23097 }) 23098 } 23099 23100 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) ProtoMessage() { 23101 } 23102 23103 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Reset() { 23104 if fieldMask != nil { 23105 fieldMask.Paths = nil 23106 } 23107 } 23108 23109 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Subtract(other *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask { 23110 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask{} 23111 removedSelectors := make([]bool, 6) 23112 otherSubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector]gotenobject.FieldMask{ 23113 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask{}, 23114 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask{}, 23115 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask{}, 23116 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask{}, 23117 } 23118 mySubMasks := map[DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector]gotenobject.FieldMask{ 23119 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask{}, 23120 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask{}, 23121 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask{}, 23122 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal: &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask{}, 23123 } 23124 23125 for _, path := range other.GetPaths() { 23126 switch tp := path.(type) { 23127 case *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: 23128 removedSelectors[int(tp.selector)] = true 23129 case *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath: 23130 otherSubMasks[tp.selector].AppendRawPath(tp.subPath) 23131 } 23132 } 23133 for _, path := range fieldMask.GetPaths() { 23134 if !removedSelectors[int(path.Selector())] { 23135 if otherSubMask := otherSubMasks[path.Selector()]; otherSubMask != nil && otherSubMask.PathsCount() > 0 { 23136 if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath); ok { 23137 switch tp.selector { 23138 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 23139 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask() 23140 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 23141 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask() 23142 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 23143 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask() 23144 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal: 23145 mySubMasks[DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal] = FullDevice_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask() 23146 } 23147 } else if tp, ok := path.(*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath); ok { 23148 mySubMasks[tp.selector].AppendRawPath(tp.subPath) 23149 } 23150 } else { 23151 result.Paths = append(result.Paths, path) 23152 } 23153 } 23154 } 23155 for selector, mySubMask := range mySubMasks { 23156 if mySubMask.PathsCount() > 0 { 23157 for _, allowedPath := range mySubMask.SubtractRaw(otherSubMasks[selector]).GetRawPaths() { 23158 result.Paths = append(result.Paths, &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath{selector: selector, subPath: allowedPath}) 23159 } 23160 } 23161 } 23162 23163 if len(result.Paths) == 0 { 23164 return nil 23165 } 23166 return result 23167 } 23168 23169 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 23170 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask)) 23171 } 23172 23173 // FilterInputFields generates copy of field paths with output_only field paths removed 23174 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask { 23175 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask{} 23176 result.Paths = append(result.Paths, fieldMask.Paths...) 23177 return result 23178 } 23179 23180 // ToFieldMask is used for proto conversions 23181 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 23182 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23183 for _, path := range fieldMask.Paths { 23184 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 23185 } 23186 return protoFieldMask 23187 } 23188 23189 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 23190 if fieldMask == nil { 23191 return status.Error(codes.Internal, "target field mask is nil") 23192 } 23193 fieldMask.Paths = make([]DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath, 0, len(protoFieldMask.Paths)) 23194 for _, strPath := range protoFieldMask.Paths { 23195 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(strPath) 23196 if err != nil { 23197 return err 23198 } 23199 fieldMask.Paths = append(fieldMask.Paths, path) 23200 } 23201 return nil 23202 } 23203 23204 // implement methods required by customType 23205 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Marshal() ([]byte, error) { 23206 protoFieldMask := fieldMask.ToProtoFieldMask() 23207 return proto.Marshal(protoFieldMask) 23208 } 23209 23210 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Unmarshal(data []byte) error { 23211 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23212 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 23213 return err 23214 } 23215 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 23216 return err 23217 } 23218 return nil 23219 } 23220 23221 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Size() int { 23222 return proto.Size(fieldMask.ToProtoFieldMask()) 23223 } 23224 23225 func (fieldMask Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) MarshalJSON() ([]byte, error) { 23226 return json.Marshal(fieldMask.ToProtoFieldMask()) 23227 } 23228 23229 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) UnmarshalJSON(data []byte) error { 23230 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23231 if err := json.Unmarshal(data, protoFieldMask); err != nil { 23232 return err 23233 } 23234 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 23235 return err 23236 } 23237 return nil 23238 } 23239 23240 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) AppendPath(path DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath) { 23241 fieldMask.Paths = append(fieldMask.Paths, path) 23242 } 23243 23244 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 23245 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath)) 23246 } 23247 23248 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) GetPaths() []DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath { 23249 if fieldMask == nil { 23250 return nil 23251 } 23252 return fieldMask.Paths 23253 } 23254 23255 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) GetRawPaths() []gotenobject.FieldPath { 23256 if fieldMask == nil { 23257 return nil 23258 } 23259 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 23260 for _, path := range fieldMask.Paths { 23261 rawPaths = append(rawPaths, path) 23262 } 23263 return rawPaths 23264 } 23265 23266 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) SetFromCliFlag(raw string) error { 23267 path, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(raw) 23268 if err != nil { 23269 return err 23270 } 23271 fieldMask.Paths = append(fieldMask.Paths, path) 23272 return nil 23273 } 23274 23275 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Set(target, source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 23276 for _, path := range fieldMask.Paths { 23277 val, _ := path.GetSingle(source) 23278 // if val is nil, then field does not exist in source, skip 23279 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 23280 if val != nil { 23281 path.WithIValue(val).SetTo(&target) 23282 } 23283 } 23284 } 23285 23286 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 23287 fieldMask.Set(target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem), source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 23288 } 23289 23290 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) Project(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem { 23291 if source == nil { 23292 return nil 23293 } 23294 if fieldMask == nil { 23295 return source 23296 } 23297 result := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem{} 23298 threeGPpMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp_FieldMask{} 23299 wholeThreeGPpAccepted := false 23300 cdmaMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma_FieldMask{} 23301 wholeCdmaAccepted := false 23302 genericMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic_FieldMask{} 23303 wholeGenericAccepted := false 23304 signalMask := &Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Signal_FieldMask{} 23305 wholeSignalAccepted := false 23306 var simStatusMapKeys []string 23307 wholeSimStatusAccepted := false 23308 23309 for _, p := range fieldMask.Paths { 23310 switch tp := p.(type) { 23311 case *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: 23312 switch tp.selector { 23313 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 23314 result.ThreeGPp = source.ThreeGPp 23315 wholeThreeGPpAccepted = true 23316 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 23317 result.Cdma = source.Cdma 23318 wholeCdmaAccepted = true 23319 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 23320 result.DbusPath = source.DbusPath 23321 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 23322 result.Generic = source.Generic 23323 wholeGenericAccepted = true 23324 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal: 23325 result.Signal = source.Signal 23326 wholeSignalAccepted = true 23327 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 23328 result.SimStatus = source.SimStatus 23329 wholeSimStatusAccepted = true 23330 } 23331 case *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath: 23332 switch tp.selector { 23333 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 23334 threeGPpMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath)) 23335 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 23336 cdmaMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath)) 23337 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 23338 genericMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath)) 23339 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSignal: 23340 signalMask.AppendPath(tp.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignal_FieldPath)) 23341 } 23342 case *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap: 23343 switch tp.selector { 23344 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 23345 simStatusMapKeys = append(simStatusMapKeys, tp.key) 23346 } 23347 } 23348 } 23349 if wholeThreeGPpAccepted == false && len(threeGPpMask.Paths) > 0 { 23350 result.ThreeGPp = threeGPpMask.Project(source.GetThreeGPp()) 23351 } 23352 if wholeCdmaAccepted == false && len(cdmaMask.Paths) > 0 { 23353 result.Cdma = cdmaMask.Project(source.GetCdma()) 23354 } 23355 if wholeGenericAccepted == false && len(genericMask.Paths) > 0 { 23356 result.Generic = genericMask.Project(source.GetGeneric()) 23357 } 23358 if wholeSignalAccepted == false && len(signalMask.Paths) > 0 { 23359 result.Signal = signalMask.Project(source.GetSignal()) 23360 } 23361 if wholeSimStatusAccepted == false && len(simStatusMapKeys) > 0 && source.GetSimStatus() != nil { 23362 copiedMap := map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus{} 23363 sourceMap := source.GetSimStatus() 23364 for _, key := range simStatusMapKeys { 23365 copiedMap[key] = sourceMap[key] 23366 } 23367 result.SimStatus = copiedMap 23368 } 23369 return result 23370 } 23371 23372 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 23373 return fieldMask.Project(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 23374 } 23375 23376 func (fieldMask *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem_FieldMask) PathsCount() int { 23377 if fieldMask == nil { 23378 return 0 23379 } 23380 return len(fieldMask.Paths) 23381 } 23382 23383 type Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask struct { 23384 Paths []DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath 23385 } 23386 23387 func FullDevice_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask() *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask { 23388 res := &Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask{} 23389 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn}) 23390 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName}) 23391 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain}) 23392 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes}) 23393 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType}) 23394 return res 23395 } 23396 23397 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) String() string { 23398 if fieldMask == nil { 23399 return "<nil>" 23400 } 23401 pathsStr := make([]string, 0, len(fieldMask.Paths)) 23402 for _, path := range fieldMask.Paths { 23403 pathsStr = append(pathsStr, path.String()) 23404 } 23405 return strings.Join(pathsStr, ", ") 23406 } 23407 23408 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) IsFull() bool { 23409 if fieldMask == nil { 23410 return false 23411 } 23412 presentSelectors := make([]bool, 5) 23413 for _, path := range fieldMask.Paths { 23414 if asFinal, ok := path.(*DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath); ok { 23415 presentSelectors[int(asFinal.selector)] = true 23416 } 23417 } 23418 for _, flag := range presentSelectors { 23419 if !flag { 23420 return false 23421 } 23422 } 23423 return true 23424 } 23425 23426 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) ProtoReflect() preflect.Message { 23427 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 23428 return ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(raw) 23429 }) 23430 } 23431 23432 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) ProtoMessage() {} 23433 23434 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Reset() { 23435 if fieldMask != nil { 23436 fieldMask.Paths = nil 23437 } 23438 } 23439 23440 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Subtract(other *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask { 23441 result := &Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask{} 23442 removedSelectors := make([]bool, 5) 23443 23444 for _, path := range other.GetPaths() { 23445 switch tp := path.(type) { 23446 case *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: 23447 removedSelectors[int(tp.selector)] = true 23448 } 23449 } 23450 for _, path := range fieldMask.GetPaths() { 23451 if !removedSelectors[int(path.Selector())] { 23452 result.Paths = append(result.Paths, path) 23453 } 23454 } 23455 23456 if len(result.Paths) == 0 { 23457 return nil 23458 } 23459 return result 23460 } 23461 23462 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 23463 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask)) 23464 } 23465 23466 // FilterInputFields generates copy of field paths with output_only field paths removed 23467 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask { 23468 result := &Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask{} 23469 result.Paths = append(result.Paths, fieldMask.Paths...) 23470 return result 23471 } 23472 23473 // ToFieldMask is used for proto conversions 23474 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 23475 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23476 for _, path := range fieldMask.Paths { 23477 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 23478 } 23479 return protoFieldMask 23480 } 23481 23482 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 23483 if fieldMask == nil { 23484 return status.Error(codes.Internal, "target field mask is nil") 23485 } 23486 fieldMask.Paths = make([]DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath, 0, len(protoFieldMask.Paths)) 23487 for _, strPath := range protoFieldMask.Paths { 23488 path, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(strPath) 23489 if err != nil { 23490 return err 23491 } 23492 fieldMask.Paths = append(fieldMask.Paths, path) 23493 } 23494 return nil 23495 } 23496 23497 // implement methods required by customType 23498 func (fieldMask Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Marshal() ([]byte, error) { 23499 protoFieldMask := fieldMask.ToProtoFieldMask() 23500 return proto.Marshal(protoFieldMask) 23501 } 23502 23503 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Unmarshal(data []byte) error { 23504 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23505 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 23506 return err 23507 } 23508 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 23509 return err 23510 } 23511 return nil 23512 } 23513 23514 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Size() int { 23515 return proto.Size(fieldMask.ToProtoFieldMask()) 23516 } 23517 23518 func (fieldMask Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) MarshalJSON() ([]byte, error) { 23519 return json.Marshal(fieldMask.ToProtoFieldMask()) 23520 } 23521 23522 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) UnmarshalJSON(data []byte) error { 23523 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23524 if err := json.Unmarshal(data, protoFieldMask); err != nil { 23525 return err 23526 } 23527 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 23528 return err 23529 } 23530 return nil 23531 } 23532 23533 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) AppendPath(path DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath) { 23534 fieldMask.Paths = append(fieldMask.Paths, path) 23535 } 23536 23537 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 23538 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath)) 23539 } 23540 23541 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) GetPaths() []DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath { 23542 if fieldMask == nil { 23543 return nil 23544 } 23545 return fieldMask.Paths 23546 } 23547 23548 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) GetRawPaths() []gotenobject.FieldPath { 23549 if fieldMask == nil { 23550 return nil 23551 } 23552 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 23553 for _, path := range fieldMask.Paths { 23554 rawPaths = append(rawPaths, path) 23555 } 23556 return rawPaths 23557 } 23558 23559 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) SetFromCliFlag(raw string) error { 23560 path, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(raw) 23561 if err != nil { 23562 return err 23563 } 23564 fieldMask.Paths = append(fieldMask.Paths, path) 23565 return nil 23566 } 23567 23568 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Set(target, source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) { 23569 for _, path := range fieldMask.Paths { 23570 val, _ := path.GetSingle(source) 23571 // if val is nil, then field does not exist in source, skip 23572 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 23573 if val != nil { 23574 path.WithIValue(val).SetTo(&target) 23575 } 23576 } 23577 } 23578 23579 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 23580 fieldMask.Set(target.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo), source.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 23581 } 23582 23583 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) Project(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) *Device_Status_DeviceInfo_NetworkInterface_ASInfo { 23584 if source == nil { 23585 return nil 23586 } 23587 if fieldMask == nil { 23588 return source 23589 } 23590 result := &Device_Status_DeviceInfo_NetworkInterface_ASInfo{} 23591 23592 for _, p := range fieldMask.Paths { 23593 switch tp := p.(type) { 23594 case *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: 23595 switch tp.selector { 23596 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 23597 result.Asn = source.Asn 23598 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 23599 result.Name = source.Name 23600 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 23601 result.Domain = source.Domain 23602 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 23603 result.Routes = source.Routes 23604 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 23605 result.AsnType = source.AsnType 23606 } 23607 } 23608 } 23609 return result 23610 } 23611 23612 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 23613 return fieldMask.Project(source.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 23614 } 23615 23616 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_ASInfo_FieldMask) PathsCount() int { 23617 if fieldMask == nil { 23618 return 0 23619 } 23620 return len(fieldMask.Paths) 23621 } 23622 23623 type Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask struct { 23624 Paths []DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath 23625 } 23626 23627 func FullDevice_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask() *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask { 23628 res := &Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask{} 23629 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName}) 23630 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode}) 23631 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode}) 23632 res.Paths = append(res.Paths, &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode}) 23633 return res 23634 } 23635 23636 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) String() string { 23637 if fieldMask == nil { 23638 return "<nil>" 23639 } 23640 pathsStr := make([]string, 0, len(fieldMask.Paths)) 23641 for _, path := range fieldMask.Paths { 23642 pathsStr = append(pathsStr, path.String()) 23643 } 23644 return strings.Join(pathsStr, ", ") 23645 } 23646 23647 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) IsFull() bool { 23648 if fieldMask == nil { 23649 return false 23650 } 23651 presentSelectors := make([]bool, 4) 23652 for _, path := range fieldMask.Paths { 23653 if asFinal, ok := path.(*DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath); ok { 23654 presentSelectors[int(asFinal.selector)] = true 23655 } 23656 } 23657 for _, flag := range presentSelectors { 23658 if !flag { 23659 return false 23660 } 23661 } 23662 return true 23663 } 23664 23665 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) ProtoReflect() preflect.Message { 23666 return gotenobject.MakeFieldMaskReflection(fieldMask, func(raw string) (gotenobject.FieldPath, error) { 23667 return ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(raw) 23668 }) 23669 } 23670 23671 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) ProtoMessage() {} 23672 23673 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Reset() { 23674 if fieldMask != nil { 23675 fieldMask.Paths = nil 23676 } 23677 } 23678 23679 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Subtract(other *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask { 23680 result := &Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask{} 23681 removedSelectors := make([]bool, 4) 23682 23683 for _, path := range other.GetPaths() { 23684 switch tp := path.(type) { 23685 case *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: 23686 removedSelectors[int(tp.selector)] = true 23687 } 23688 } 23689 for _, path := range fieldMask.GetPaths() { 23690 if !removedSelectors[int(path.Selector())] { 23691 result.Paths = append(result.Paths, path) 23692 } 23693 } 23694 23695 if len(result.Paths) == 0 { 23696 return nil 23697 } 23698 return result 23699 } 23700 23701 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) SubtractRaw(other gotenobject.FieldMask) gotenobject.FieldMask { 23702 return fieldMask.Subtract(other.(*Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask)) 23703 } 23704 23705 // FilterInputFields generates copy of field paths with output_only field paths removed 23706 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) FilterInputFields() *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask { 23707 result := &Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask{} 23708 result.Paths = append(result.Paths, fieldMask.Paths...) 23709 return result 23710 } 23711 23712 // ToFieldMask is used for proto conversions 23713 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) ToProtoFieldMask() *googlefieldmaskpb.FieldMask { 23714 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23715 for _, path := range fieldMask.Paths { 23716 protoFieldMask.Paths = append(protoFieldMask.Paths, path.String()) 23717 } 23718 return protoFieldMask 23719 } 23720 23721 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) FromProtoFieldMask(protoFieldMask *googlefieldmaskpb.FieldMask) error { 23722 if fieldMask == nil { 23723 return status.Error(codes.Internal, "target field mask is nil") 23724 } 23725 fieldMask.Paths = make([]DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath, 0, len(protoFieldMask.Paths)) 23726 for _, strPath := range protoFieldMask.Paths { 23727 path, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(strPath) 23728 if err != nil { 23729 return err 23730 } 23731 fieldMask.Paths = append(fieldMask.Paths, path) 23732 } 23733 return nil 23734 } 23735 23736 // implement methods required by customType 23737 func (fieldMask Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Marshal() ([]byte, error) { 23738 protoFieldMask := fieldMask.ToProtoFieldMask() 23739 return proto.Marshal(protoFieldMask) 23740 } 23741 23742 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Unmarshal(data []byte) error { 23743 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23744 if err := proto.Unmarshal(data, protoFieldMask); err != nil { 23745 return err 23746 } 23747 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 23748 return err 23749 } 23750 return nil 23751 } 23752 23753 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Size() int { 23754 return proto.Size(fieldMask.ToProtoFieldMask()) 23755 } 23756 23757 func (fieldMask Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) MarshalJSON() ([]byte, error) { 23758 return json.Marshal(fieldMask.ToProtoFieldMask()) 23759 } 23760 23761 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) UnmarshalJSON(data []byte) error { 23762 protoFieldMask := &googlefieldmaskpb.FieldMask{} 23763 if err := json.Unmarshal(data, protoFieldMask); err != nil { 23764 return err 23765 } 23766 if err := fieldMask.FromProtoFieldMask(protoFieldMask); err != nil { 23767 return err 23768 } 23769 return nil 23770 } 23771 23772 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) AppendPath(path DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath) { 23773 fieldMask.Paths = append(fieldMask.Paths, path) 23774 } 23775 23776 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) AppendRawPath(path gotenobject.FieldPath) { 23777 fieldMask.Paths = append(fieldMask.Paths, path.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath)) 23778 } 23779 23780 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) GetPaths() []DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath { 23781 if fieldMask == nil { 23782 return nil 23783 } 23784 return fieldMask.Paths 23785 } 23786 23787 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) GetRawPaths() []gotenobject.FieldPath { 23788 if fieldMask == nil { 23789 return nil 23790 } 23791 rawPaths := make([]gotenobject.FieldPath, 0, len(fieldMask.Paths)) 23792 for _, path := range fieldMask.Paths { 23793 rawPaths = append(rawPaths, path) 23794 } 23795 return rawPaths 23796 } 23797 23798 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) SetFromCliFlag(raw string) error { 23799 path, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(raw) 23800 if err != nil { 23801 return err 23802 } 23803 fieldMask.Paths = append(fieldMask.Paths, path) 23804 return nil 23805 } 23806 23807 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Set(target, source *Device_Status_DeviceInfo_NetworkInterface_Carrier) { 23808 for _, path := range fieldMask.Paths { 23809 val, _ := path.GetSingle(source) 23810 // if val is nil, then field does not exist in source, skip 23811 // otherwise, process (can still reflect.ValueOf(val).IsNil!) 23812 if val != nil { 23813 path.WithIValue(val).SetTo(&target) 23814 } 23815 } 23816 } 23817 23818 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) SetRaw(target, source gotenobject.GotenObjectExt) { 23819 fieldMask.Set(target.(*Device_Status_DeviceInfo_NetworkInterface_Carrier), source.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 23820 } 23821 23822 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) Project(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) *Device_Status_DeviceInfo_NetworkInterface_Carrier { 23823 if source == nil { 23824 return nil 23825 } 23826 if fieldMask == nil { 23827 return source 23828 } 23829 result := &Device_Status_DeviceInfo_NetworkInterface_Carrier{} 23830 23831 for _, p := range fieldMask.Paths { 23832 switch tp := p.(type) { 23833 case *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: 23834 switch tp.selector { 23835 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 23836 result.Name = source.Name 23837 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 23838 result.MobileCountryCode = source.MobileCountryCode 23839 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 23840 result.MobileNetworkCode = source.MobileNetworkCode 23841 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 23842 result.LocationAreaCode = source.LocationAreaCode 23843 } 23844 } 23845 } 23846 return result 23847 } 23848 23849 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) ProjectRaw(source gotenobject.GotenObjectExt) gotenobject.GotenObjectExt { 23850 return fieldMask.Project(source.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 23851 } 23852 23853 func (fieldMask *Device_Status_DeviceInfo_NetworkInterface_Carrier_FieldMask) PathsCount() int { 23854 if fieldMask == nil { 23855 return 0 23856 } 23857 return len(fieldMask.Paths) 23858 }