github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1/device/device.pb.fieldpath.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/devices/proto/v1/device.proto 3 // DO NOT EDIT!!! 4 5 package device 6 7 import ( 8 "encoding/json" 9 "fmt" 10 "reflect" 11 "strings" 12 "time" 13 14 "google.golang.org/grpc/codes" 15 "google.golang.org/grpc/status" 16 "google.golang.org/protobuf/encoding/protojson" 17 "google.golang.org/protobuf/proto" 18 "google.golang.org/protobuf/reflect/protoregistry" 19 20 gotenobject "github.com/cloudwan/goten-sdk/runtime/object" 21 "github.com/cloudwan/goten-sdk/runtime/strcase" 22 ) 23 24 // proto imports 25 import ( 26 api "github.com/cloudwan/edgelq-sdk/common/api" 27 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project" 28 iam_attestation_domain "github.com/cloudwan/edgelq-sdk/iam/resources/v1/attestation_domain" 29 iam_iam_common "github.com/cloudwan/edgelq-sdk/iam/resources/v1/common" 30 iam_service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account" 31 logging_bucket "github.com/cloudwan/edgelq-sdk/logging/resources/v1/bucket" 32 monitoring_bucket "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/bucket" 33 meta "github.com/cloudwan/goten-sdk/types/meta" 34 latlng "google.golang.org/genproto/googleapis/type/latlng" 35 durationpb "google.golang.org/protobuf/types/known/durationpb" 36 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 37 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 38 ) 39 40 // ensure the imports are used 41 var ( 42 _ = new(json.Marshaler) 43 _ = new(fmt.Stringer) 44 _ = reflect.DeepEqual 45 _ = strings.Builder{} 46 _ = time.Second 47 48 _ = strcase.ToLowerCamel 49 _ = codes.NotFound 50 _ = status.Status{} 51 _ = protojson.UnmarshalOptions{} 52 _ = new(proto.Message) 53 _ = protoregistry.GlobalTypes 54 55 _ = new(gotenobject.FieldPath) 56 ) 57 58 // make sure we're using proto imports 59 var ( 60 _ = &api.HealthCheckSpec{} 61 _ = &project.Project{} 62 _ = &iam_attestation_domain.AttestationDomain{} 63 _ = &iam_iam_common.PCR{} 64 _ = &iam_service_account.ServiceAccount{} 65 _ = &logging_bucket.Bucket{} 66 _ = &monitoring_bucket.Bucket{} 67 _ = &durationpb.Duration{} 68 _ = &fieldmaskpb.FieldMask{} 69 _ = ×tamppb.Timestamp{} 70 _ = &latlng.LatLng{} 71 _ = &meta.Meta{} 72 ) 73 74 // FieldPath provides implementation to handle 75 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 76 type Device_FieldPath interface { 77 gotenobject.FieldPath 78 Selector() Device_FieldPathSelector 79 Get(source *Device) []interface{} 80 GetSingle(source *Device) (interface{}, bool) 81 ClearValue(item *Device) 82 83 // Those methods build corresponding Device_FieldPathValue 84 // (or array of values) and holds passed value. Panics if injected type is incorrect. 85 WithIValue(value interface{}) Device_FieldPathValue 86 WithIArrayOfValues(values interface{}) Device_FieldPathArrayOfValues 87 WithIArrayItemValue(value interface{}) Device_FieldPathArrayItemValue 88 } 89 90 type Device_FieldPathSelector int32 91 92 const ( 93 Device_FieldPathSelectorName Device_FieldPathSelector = 0 94 Device_FieldPathSelectorMetadata Device_FieldPathSelector = 1 95 Device_FieldPathSelectorDisplayName Device_FieldPathSelector = 2 96 Device_FieldPathSelectorDescription Device_FieldPathSelector = 3 97 Device_FieldPathSelectorSpec Device_FieldPathSelector = 4 98 Device_FieldPathSelectorStatus Device_FieldPathSelector = 5 99 Device_FieldPathSelectorPublicListingSpec Device_FieldPathSelector = 6 100 ) 101 102 func (s Device_FieldPathSelector) String() string { 103 switch s { 104 case Device_FieldPathSelectorName: 105 return "name" 106 case Device_FieldPathSelectorMetadata: 107 return "metadata" 108 case Device_FieldPathSelectorDisplayName: 109 return "display_name" 110 case Device_FieldPathSelectorDescription: 111 return "description" 112 case Device_FieldPathSelectorSpec: 113 return "spec" 114 case Device_FieldPathSelectorStatus: 115 return "status" 116 case Device_FieldPathSelectorPublicListingSpec: 117 return "public_listing_spec" 118 default: 119 panic(fmt.Sprintf("Invalid selector for Device: %d", s)) 120 } 121 } 122 123 func BuildDevice_FieldPath(fp gotenobject.RawFieldPath) (Device_FieldPath, error) { 124 if len(fp) == 0 { 125 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device") 126 } 127 if len(fp) == 1 { 128 switch fp[0] { 129 case "name": 130 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorName}, nil 131 case "metadata": 132 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorMetadata}, nil 133 case "display_name", "displayName", "display-name": 134 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorDisplayName}, nil 135 case "description": 136 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorDescription}, nil 137 case "spec": 138 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorSpec}, nil 139 case "status": 140 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorStatus}, nil 141 case "public_listing_spec", "publicListingSpec", "public-listing-spec": 142 return &Device_FieldTerminalPath{selector: Device_FieldPathSelectorPublicListingSpec}, nil 143 } 144 } else { 145 switch fp[0] { 146 case "metadata": 147 if subpath, err := meta.BuildMeta_FieldPath(fp[1:]); err != nil { 148 return nil, err 149 } else { 150 return &Device_FieldSubPath{selector: Device_FieldPathSelectorMetadata, subPath: subpath}, nil 151 } 152 case "spec": 153 if subpath, err := BuildDeviceSpec_FieldPath(fp[1:]); err != nil { 154 return nil, err 155 } else { 156 return &Device_FieldSubPath{selector: Device_FieldPathSelectorSpec, subPath: subpath}, nil 157 } 158 case "status": 159 if subpath, err := BuildDeviceStatus_FieldPath(fp[1:]); err != nil { 160 return nil, err 161 } else { 162 return &Device_FieldSubPath{selector: Device_FieldPathSelectorStatus, subPath: subpath}, nil 163 } 164 case "public_listing_spec", "publicListingSpec", "public-listing-spec": 165 if subpath, err := BuildDevicePublicListingSpec_FieldPath(fp[1:]); err != nil { 166 return nil, err 167 } else { 168 return &Device_FieldSubPath{selector: Device_FieldPathSelectorPublicListingSpec, subPath: subpath}, nil 169 } 170 } 171 } 172 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device", fp) 173 } 174 175 func ParseDevice_FieldPath(rawField string) (Device_FieldPath, error) { 176 fp, err := gotenobject.ParseRawFieldPath(rawField) 177 if err != nil { 178 return nil, err 179 } 180 return BuildDevice_FieldPath(fp) 181 } 182 183 func MustParseDevice_FieldPath(rawField string) Device_FieldPath { 184 fp, err := ParseDevice_FieldPath(rawField) 185 if err != nil { 186 panic(err) 187 } 188 return fp 189 } 190 191 type Device_FieldTerminalPath struct { 192 selector Device_FieldPathSelector 193 } 194 195 var _ Device_FieldPath = (*Device_FieldTerminalPath)(nil) 196 197 func (fp *Device_FieldTerminalPath) Selector() Device_FieldPathSelector { 198 return fp.selector 199 } 200 201 // String returns path representation in proto convention 202 func (fp *Device_FieldTerminalPath) String() string { 203 return fp.selector.String() 204 } 205 206 // JSONString returns path representation is JSON convention 207 func (fp *Device_FieldTerminalPath) JSONString() string { 208 return strcase.ToLowerCamel(fp.String()) 209 } 210 211 // Get returns all values pointed by specific field from source Device 212 func (fp *Device_FieldTerminalPath) Get(source *Device) (values []interface{}) { 213 if source != nil { 214 switch fp.selector { 215 case Device_FieldPathSelectorName: 216 if source.Name != nil { 217 values = append(values, source.Name) 218 } 219 case Device_FieldPathSelectorMetadata: 220 if source.Metadata != nil { 221 values = append(values, source.Metadata) 222 } 223 case Device_FieldPathSelectorDisplayName: 224 values = append(values, source.DisplayName) 225 case Device_FieldPathSelectorDescription: 226 values = append(values, source.Description) 227 case Device_FieldPathSelectorSpec: 228 if source.Spec != nil { 229 values = append(values, source.Spec) 230 } 231 case Device_FieldPathSelectorStatus: 232 if source.Status != nil { 233 values = append(values, source.Status) 234 } 235 case Device_FieldPathSelectorPublicListingSpec: 236 if source.PublicListingSpec != nil { 237 values = append(values, source.PublicListingSpec) 238 } 239 default: 240 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 241 } 242 } 243 return 244 } 245 246 func (fp *Device_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 247 return fp.Get(source.(*Device)) 248 } 249 250 // GetSingle returns value pointed by specific field of from source Device 251 func (fp *Device_FieldTerminalPath) GetSingle(source *Device) (interface{}, bool) { 252 switch fp.selector { 253 case Device_FieldPathSelectorName: 254 res := source.GetName() 255 return res, res != nil 256 case Device_FieldPathSelectorMetadata: 257 res := source.GetMetadata() 258 return res, res != nil 259 case Device_FieldPathSelectorDisplayName: 260 return source.GetDisplayName(), source != nil 261 case Device_FieldPathSelectorDescription: 262 return source.GetDescription(), source != nil 263 case Device_FieldPathSelectorSpec: 264 res := source.GetSpec() 265 return res, res != nil 266 case Device_FieldPathSelectorStatus: 267 res := source.GetStatus() 268 return res, res != nil 269 case Device_FieldPathSelectorPublicListingSpec: 270 res := source.GetPublicListingSpec() 271 return res, res != nil 272 default: 273 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 274 } 275 } 276 277 func (fp *Device_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 278 return fp.GetSingle(source.(*Device)) 279 } 280 281 // GetDefault returns a default value of the field type 282 func (fp *Device_FieldTerminalPath) GetDefault() interface{} { 283 switch fp.selector { 284 case Device_FieldPathSelectorName: 285 return (*Name)(nil) 286 case Device_FieldPathSelectorMetadata: 287 return (*meta.Meta)(nil) 288 case Device_FieldPathSelectorDisplayName: 289 return "" 290 case Device_FieldPathSelectorDescription: 291 return "" 292 case Device_FieldPathSelectorSpec: 293 return (*Device_Spec)(nil) 294 case Device_FieldPathSelectorStatus: 295 return (*Device_Status)(nil) 296 case Device_FieldPathSelectorPublicListingSpec: 297 return (*Device_PublicListingSpec)(nil) 298 default: 299 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 300 } 301 } 302 303 func (fp *Device_FieldTerminalPath) ClearValue(item *Device) { 304 if item != nil { 305 switch fp.selector { 306 case Device_FieldPathSelectorName: 307 item.Name = nil 308 case Device_FieldPathSelectorMetadata: 309 item.Metadata = nil 310 case Device_FieldPathSelectorDisplayName: 311 item.DisplayName = "" 312 case Device_FieldPathSelectorDescription: 313 item.Description = "" 314 case Device_FieldPathSelectorSpec: 315 item.Spec = nil 316 case Device_FieldPathSelectorStatus: 317 item.Status = nil 318 case Device_FieldPathSelectorPublicListingSpec: 319 item.PublicListingSpec = nil 320 default: 321 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 322 } 323 } 324 } 325 326 func (fp *Device_FieldTerminalPath) ClearValueRaw(item proto.Message) { 327 fp.ClearValue(item.(*Device)) 328 } 329 330 // IsLeaf - whether field path is holds simple value 331 func (fp *Device_FieldTerminalPath) IsLeaf() bool { 332 return fp.selector == Device_FieldPathSelectorName || 333 fp.selector == Device_FieldPathSelectorDisplayName || 334 fp.selector == Device_FieldPathSelectorDescription 335 } 336 337 func (fp *Device_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 338 return []gotenobject.FieldPath{fp} 339 } 340 341 func (fp *Device_FieldTerminalPath) WithIValue(value interface{}) Device_FieldPathValue { 342 switch fp.selector { 343 case Device_FieldPathSelectorName: 344 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(*Name)} 345 case Device_FieldPathSelectorMetadata: 346 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(*meta.Meta)} 347 case Device_FieldPathSelectorDisplayName: 348 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(string)} 349 case Device_FieldPathSelectorDescription: 350 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(string)} 351 case Device_FieldPathSelectorSpec: 352 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(*Device_Spec)} 353 case Device_FieldPathSelectorStatus: 354 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(*Device_Status)} 355 case Device_FieldPathSelectorPublicListingSpec: 356 return &Device_FieldTerminalPathValue{Device_FieldTerminalPath: *fp, value: value.(*Device_PublicListingSpec)} 357 default: 358 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 359 } 360 } 361 362 func (fp *Device_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 363 return fp.WithIValue(value) 364 } 365 366 func (fp *Device_FieldTerminalPath) WithIArrayOfValues(values interface{}) Device_FieldPathArrayOfValues { 367 fpaov := &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp} 368 switch fp.selector { 369 case Device_FieldPathSelectorName: 370 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]*Name)} 371 case Device_FieldPathSelectorMetadata: 372 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]*meta.Meta)} 373 case Device_FieldPathSelectorDisplayName: 374 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]string)} 375 case Device_FieldPathSelectorDescription: 376 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]string)} 377 case Device_FieldPathSelectorSpec: 378 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]*Device_Spec)} 379 case Device_FieldPathSelectorStatus: 380 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]*Device_Status)} 381 case Device_FieldPathSelectorPublicListingSpec: 382 return &Device_FieldTerminalPathArrayOfValues{Device_FieldTerminalPath: *fp, values: values.([]*Device_PublicListingSpec)} 383 default: 384 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 385 } 386 return fpaov 387 } 388 389 func (fp *Device_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 390 return fp.WithIArrayOfValues(values) 391 } 392 393 func (fp *Device_FieldTerminalPath) WithIArrayItemValue(value interface{}) Device_FieldPathArrayItemValue { 394 switch fp.selector { 395 default: 396 panic(fmt.Sprintf("Invalid selector for Device: %d", fp.selector)) 397 } 398 } 399 400 func (fp *Device_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 401 return fp.WithIArrayItemValue(value) 402 } 403 404 type Device_FieldSubPath struct { 405 selector Device_FieldPathSelector 406 subPath gotenobject.FieldPath 407 } 408 409 var _ Device_FieldPath = (*Device_FieldSubPath)(nil) 410 411 func (fps *Device_FieldSubPath) Selector() Device_FieldPathSelector { 412 return fps.selector 413 } 414 func (fps *Device_FieldSubPath) AsMetadataSubPath() (meta.Meta_FieldPath, bool) { 415 res, ok := fps.subPath.(meta.Meta_FieldPath) 416 return res, ok 417 } 418 func (fps *Device_FieldSubPath) AsSpecSubPath() (DeviceSpec_FieldPath, bool) { 419 res, ok := fps.subPath.(DeviceSpec_FieldPath) 420 return res, ok 421 } 422 func (fps *Device_FieldSubPath) AsStatusSubPath() (DeviceStatus_FieldPath, bool) { 423 res, ok := fps.subPath.(DeviceStatus_FieldPath) 424 return res, ok 425 } 426 func (fps *Device_FieldSubPath) AsPublicListingSpecSubPath() (DevicePublicListingSpec_FieldPath, bool) { 427 res, ok := fps.subPath.(DevicePublicListingSpec_FieldPath) 428 return res, ok 429 } 430 431 // String returns path representation in proto convention 432 func (fps *Device_FieldSubPath) String() string { 433 return fps.selector.String() + "." + fps.subPath.String() 434 } 435 436 // JSONString returns path representation is JSON convention 437 func (fps *Device_FieldSubPath) JSONString() string { 438 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 439 } 440 441 // Get returns all values pointed by selected field from source Device 442 func (fps *Device_FieldSubPath) Get(source *Device) (values []interface{}) { 443 switch fps.selector { 444 case Device_FieldPathSelectorMetadata: 445 values = append(values, fps.subPath.GetRaw(source.GetMetadata())...) 446 case Device_FieldPathSelectorSpec: 447 values = append(values, fps.subPath.GetRaw(source.GetSpec())...) 448 case Device_FieldPathSelectorStatus: 449 values = append(values, fps.subPath.GetRaw(source.GetStatus())...) 450 case Device_FieldPathSelectorPublicListingSpec: 451 values = append(values, fps.subPath.GetRaw(source.GetPublicListingSpec())...) 452 default: 453 panic(fmt.Sprintf("Invalid selector for Device: %d", fps.selector)) 454 } 455 return 456 } 457 458 func (fps *Device_FieldSubPath) GetRaw(source proto.Message) []interface{} { 459 return fps.Get(source.(*Device)) 460 } 461 462 // GetSingle returns value of selected field from source Device 463 func (fps *Device_FieldSubPath) GetSingle(source *Device) (interface{}, bool) { 464 switch fps.selector { 465 case Device_FieldPathSelectorMetadata: 466 if source.GetMetadata() == nil { 467 return nil, false 468 } 469 return fps.subPath.GetSingleRaw(source.GetMetadata()) 470 case Device_FieldPathSelectorSpec: 471 if source.GetSpec() == nil { 472 return nil, false 473 } 474 return fps.subPath.GetSingleRaw(source.GetSpec()) 475 case Device_FieldPathSelectorStatus: 476 if source.GetStatus() == nil { 477 return nil, false 478 } 479 return fps.subPath.GetSingleRaw(source.GetStatus()) 480 case Device_FieldPathSelectorPublicListingSpec: 481 if source.GetPublicListingSpec() == nil { 482 return nil, false 483 } 484 return fps.subPath.GetSingleRaw(source.GetPublicListingSpec()) 485 default: 486 panic(fmt.Sprintf("Invalid selector for Device: %d", fps.selector)) 487 } 488 } 489 490 func (fps *Device_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 491 return fps.GetSingle(source.(*Device)) 492 } 493 494 // GetDefault returns a default value of the field type 495 func (fps *Device_FieldSubPath) GetDefault() interface{} { 496 return fps.subPath.GetDefault() 497 } 498 499 func (fps *Device_FieldSubPath) ClearValue(item *Device) { 500 if item != nil { 501 switch fps.selector { 502 case Device_FieldPathSelectorMetadata: 503 fps.subPath.ClearValueRaw(item.Metadata) 504 case Device_FieldPathSelectorSpec: 505 fps.subPath.ClearValueRaw(item.Spec) 506 case Device_FieldPathSelectorStatus: 507 fps.subPath.ClearValueRaw(item.Status) 508 case Device_FieldPathSelectorPublicListingSpec: 509 fps.subPath.ClearValueRaw(item.PublicListingSpec) 510 default: 511 panic(fmt.Sprintf("Invalid selector for Device: %d", fps.selector)) 512 } 513 } 514 } 515 516 func (fps *Device_FieldSubPath) ClearValueRaw(item proto.Message) { 517 fps.ClearValue(item.(*Device)) 518 } 519 520 // IsLeaf - whether field path is holds simple value 521 func (fps *Device_FieldSubPath) IsLeaf() bool { 522 return fps.subPath.IsLeaf() 523 } 524 525 func (fps *Device_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 526 iPaths := []gotenobject.FieldPath{&Device_FieldTerminalPath{selector: fps.selector}} 527 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 528 return iPaths 529 } 530 531 func (fps *Device_FieldSubPath) WithIValue(value interface{}) Device_FieldPathValue { 532 return &Device_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 533 } 534 535 func (fps *Device_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 536 return fps.WithIValue(value) 537 } 538 539 func (fps *Device_FieldSubPath) WithIArrayOfValues(values interface{}) Device_FieldPathArrayOfValues { 540 return &Device_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 541 } 542 543 func (fps *Device_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 544 return fps.WithIArrayOfValues(values) 545 } 546 547 func (fps *Device_FieldSubPath) WithIArrayItemValue(value interface{}) Device_FieldPathArrayItemValue { 548 return &Device_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 549 } 550 551 func (fps *Device_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 552 return fps.WithIArrayItemValue(value) 553 } 554 555 // Device_FieldPathValue allows storing values for Device fields according to their type 556 type Device_FieldPathValue interface { 557 Device_FieldPath 558 gotenobject.FieldPathValue 559 SetTo(target **Device) 560 CompareWith(*Device) (cmp int, comparable bool) 561 } 562 563 func ParseDevice_FieldPathValue(pathStr, valueStr string) (Device_FieldPathValue, error) { 564 fp, err := ParseDevice_FieldPath(pathStr) 565 if err != nil { 566 return nil, err 567 } 568 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 569 if err != nil { 570 return nil, status.Errorf(codes.InvalidArgument, "error parsing Device field path value from %s: %v", valueStr, err) 571 } 572 return fpv.(Device_FieldPathValue), nil 573 } 574 575 func MustParseDevice_FieldPathValue(pathStr, valueStr string) Device_FieldPathValue { 576 fpv, err := ParseDevice_FieldPathValue(pathStr, valueStr) 577 if err != nil { 578 panic(err) 579 } 580 return fpv 581 } 582 583 type Device_FieldTerminalPathValue struct { 584 Device_FieldTerminalPath 585 value interface{} 586 } 587 588 var _ Device_FieldPathValue = (*Device_FieldTerminalPathValue)(nil) 589 590 // GetRawValue returns raw value stored under selected path for 'Device' as interface{} 591 func (fpv *Device_FieldTerminalPathValue) GetRawValue() interface{} { 592 return fpv.value 593 } 594 func (fpv *Device_FieldTerminalPathValue) AsNameValue() (*Name, bool) { 595 res, ok := fpv.value.(*Name) 596 return res, ok 597 } 598 func (fpv *Device_FieldTerminalPathValue) AsMetadataValue() (*meta.Meta, bool) { 599 res, ok := fpv.value.(*meta.Meta) 600 return res, ok 601 } 602 func (fpv *Device_FieldTerminalPathValue) AsDisplayNameValue() (string, bool) { 603 res, ok := fpv.value.(string) 604 return res, ok 605 } 606 func (fpv *Device_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 607 res, ok := fpv.value.(string) 608 return res, ok 609 } 610 func (fpv *Device_FieldTerminalPathValue) AsSpecValue() (*Device_Spec, bool) { 611 res, ok := fpv.value.(*Device_Spec) 612 return res, ok 613 } 614 func (fpv *Device_FieldTerminalPathValue) AsStatusValue() (*Device_Status, bool) { 615 res, ok := fpv.value.(*Device_Status) 616 return res, ok 617 } 618 func (fpv *Device_FieldTerminalPathValue) AsPublicListingSpecValue() (*Device_PublicListingSpec, bool) { 619 res, ok := fpv.value.(*Device_PublicListingSpec) 620 return res, ok 621 } 622 623 // SetTo stores value for selected field for object Device 624 func (fpv *Device_FieldTerminalPathValue) SetTo(target **Device) { 625 if *target == nil { 626 *target = new(Device) 627 } 628 switch fpv.selector { 629 case Device_FieldPathSelectorName: 630 (*target).Name = fpv.value.(*Name) 631 case Device_FieldPathSelectorMetadata: 632 (*target).Metadata = fpv.value.(*meta.Meta) 633 case Device_FieldPathSelectorDisplayName: 634 (*target).DisplayName = fpv.value.(string) 635 case Device_FieldPathSelectorDescription: 636 (*target).Description = fpv.value.(string) 637 case Device_FieldPathSelectorSpec: 638 (*target).Spec = fpv.value.(*Device_Spec) 639 case Device_FieldPathSelectorStatus: 640 (*target).Status = fpv.value.(*Device_Status) 641 case Device_FieldPathSelectorPublicListingSpec: 642 (*target).PublicListingSpec = fpv.value.(*Device_PublicListingSpec) 643 default: 644 panic(fmt.Sprintf("Invalid selector for Device: %d", fpv.selector)) 645 } 646 } 647 648 func (fpv *Device_FieldTerminalPathValue) SetToRaw(target proto.Message) { 649 typedObject := target.(*Device) 650 fpv.SetTo(&typedObject) 651 } 652 653 // CompareWith compares value in the 'Device_FieldTerminalPathValue' with the value under path in 'Device'. 654 func (fpv *Device_FieldTerminalPathValue) CompareWith(source *Device) (int, bool) { 655 switch fpv.selector { 656 case Device_FieldPathSelectorName: 657 leftValue := fpv.value.(*Name) 658 rightValue := source.GetName() 659 if leftValue == nil { 660 if rightValue != nil { 661 return -1, true 662 } 663 return 0, true 664 } 665 if rightValue == nil { 666 return 1, true 667 } 668 if leftValue.String() == rightValue.String() { 669 return 0, true 670 } else if leftValue.String() < rightValue.String() { 671 return -1, true 672 } else { 673 return 1, true 674 } 675 case Device_FieldPathSelectorMetadata: 676 return 0, false 677 case Device_FieldPathSelectorDisplayName: 678 leftValue := fpv.value.(string) 679 rightValue := source.GetDisplayName() 680 if (leftValue) == (rightValue) { 681 return 0, true 682 } else if (leftValue) < (rightValue) { 683 return -1, true 684 } else { 685 return 1, true 686 } 687 case Device_FieldPathSelectorDescription: 688 leftValue := fpv.value.(string) 689 rightValue := source.GetDescription() 690 if (leftValue) == (rightValue) { 691 return 0, true 692 } else if (leftValue) < (rightValue) { 693 return -1, true 694 } else { 695 return 1, true 696 } 697 case Device_FieldPathSelectorSpec: 698 return 0, false 699 case Device_FieldPathSelectorStatus: 700 return 0, false 701 case Device_FieldPathSelectorPublicListingSpec: 702 return 0, false 703 default: 704 panic(fmt.Sprintf("Invalid selector for Device: %d", fpv.selector)) 705 } 706 } 707 708 func (fpv *Device_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 709 return fpv.CompareWith(source.(*Device)) 710 } 711 712 type Device_FieldSubPathValue struct { 713 Device_FieldPath 714 subPathValue gotenobject.FieldPathValue 715 } 716 717 var _ Device_FieldPathValue = (*Device_FieldSubPathValue)(nil) 718 719 func (fpvs *Device_FieldSubPathValue) AsMetadataPathValue() (meta.Meta_FieldPathValue, bool) { 720 res, ok := fpvs.subPathValue.(meta.Meta_FieldPathValue) 721 return res, ok 722 } 723 func (fpvs *Device_FieldSubPathValue) AsSpecPathValue() (DeviceSpec_FieldPathValue, bool) { 724 res, ok := fpvs.subPathValue.(DeviceSpec_FieldPathValue) 725 return res, ok 726 } 727 func (fpvs *Device_FieldSubPathValue) AsStatusPathValue() (DeviceStatus_FieldPathValue, bool) { 728 res, ok := fpvs.subPathValue.(DeviceStatus_FieldPathValue) 729 return res, ok 730 } 731 func (fpvs *Device_FieldSubPathValue) AsPublicListingSpecPathValue() (DevicePublicListingSpec_FieldPathValue, bool) { 732 res, ok := fpvs.subPathValue.(DevicePublicListingSpec_FieldPathValue) 733 return res, ok 734 } 735 736 func (fpvs *Device_FieldSubPathValue) SetTo(target **Device) { 737 if *target == nil { 738 *target = new(Device) 739 } 740 switch fpvs.Selector() { 741 case Device_FieldPathSelectorMetadata: 742 fpvs.subPathValue.(meta.Meta_FieldPathValue).SetTo(&(*target).Metadata) 743 case Device_FieldPathSelectorSpec: 744 fpvs.subPathValue.(DeviceSpec_FieldPathValue).SetTo(&(*target).Spec) 745 case Device_FieldPathSelectorStatus: 746 fpvs.subPathValue.(DeviceStatus_FieldPathValue).SetTo(&(*target).Status) 747 case Device_FieldPathSelectorPublicListingSpec: 748 fpvs.subPathValue.(DevicePublicListingSpec_FieldPathValue).SetTo(&(*target).PublicListingSpec) 749 default: 750 panic(fmt.Sprintf("Invalid selector for Device: %d", fpvs.Selector())) 751 } 752 } 753 754 func (fpvs *Device_FieldSubPathValue) SetToRaw(target proto.Message) { 755 typedObject := target.(*Device) 756 fpvs.SetTo(&typedObject) 757 } 758 759 func (fpvs *Device_FieldSubPathValue) GetRawValue() interface{} { 760 return fpvs.subPathValue.GetRawValue() 761 } 762 763 func (fpvs *Device_FieldSubPathValue) CompareWith(source *Device) (int, bool) { 764 switch fpvs.Selector() { 765 case Device_FieldPathSelectorMetadata: 766 return fpvs.subPathValue.(meta.Meta_FieldPathValue).CompareWith(source.GetMetadata()) 767 case Device_FieldPathSelectorSpec: 768 return fpvs.subPathValue.(DeviceSpec_FieldPathValue).CompareWith(source.GetSpec()) 769 case Device_FieldPathSelectorStatus: 770 return fpvs.subPathValue.(DeviceStatus_FieldPathValue).CompareWith(source.GetStatus()) 771 case Device_FieldPathSelectorPublicListingSpec: 772 return fpvs.subPathValue.(DevicePublicListingSpec_FieldPathValue).CompareWith(source.GetPublicListingSpec()) 773 default: 774 panic(fmt.Sprintf("Invalid selector for Device: %d", fpvs.Selector())) 775 } 776 } 777 778 func (fpvs *Device_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 779 return fpvs.CompareWith(source.(*Device)) 780 } 781 782 // Device_FieldPathArrayItemValue allows storing single item in Path-specific values for Device according to their type 783 // Present only for array (repeated) types. 784 type Device_FieldPathArrayItemValue interface { 785 gotenobject.FieldPathArrayItemValue 786 Device_FieldPath 787 ContainsValue(*Device) bool 788 } 789 790 // ParseDevice_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 791 func ParseDevice_FieldPathArrayItemValue(pathStr, valueStr string) (Device_FieldPathArrayItemValue, error) { 792 fp, err := ParseDevice_FieldPath(pathStr) 793 if err != nil { 794 return nil, err 795 } 796 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 797 if err != nil { 798 return nil, status.Errorf(codes.InvalidArgument, "error parsing Device field path array item value from %s: %v", valueStr, err) 799 } 800 return fpaiv.(Device_FieldPathArrayItemValue), nil 801 } 802 803 func MustParseDevice_FieldPathArrayItemValue(pathStr, valueStr string) Device_FieldPathArrayItemValue { 804 fpaiv, err := ParseDevice_FieldPathArrayItemValue(pathStr, valueStr) 805 if err != nil { 806 panic(err) 807 } 808 return fpaiv 809 } 810 811 type Device_FieldTerminalPathArrayItemValue struct { 812 Device_FieldTerminalPath 813 value interface{} 814 } 815 816 var _ Device_FieldPathArrayItemValue = (*Device_FieldTerminalPathArrayItemValue)(nil) 817 818 // GetRawValue returns stored element value for array in object Device as interface{} 819 func (fpaiv *Device_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 820 return fpaiv.value 821 } 822 823 func (fpaiv *Device_FieldTerminalPathArrayItemValue) GetSingle(source *Device) (interface{}, bool) { 824 return nil, false 825 } 826 827 func (fpaiv *Device_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 828 return fpaiv.GetSingle(source.(*Device)) 829 } 830 831 // Contains returns a boolean indicating if value that is being held is present in given 'Device' 832 func (fpaiv *Device_FieldTerminalPathArrayItemValue) ContainsValue(source *Device) bool { 833 slice := fpaiv.Device_FieldTerminalPath.Get(source) 834 for _, v := range slice { 835 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 836 if proto.Equal(asProtoMsg, v.(proto.Message)) { 837 return true 838 } 839 } else if reflect.DeepEqual(v, fpaiv.value) { 840 return true 841 } 842 } 843 return false 844 } 845 846 type Device_FieldSubPathArrayItemValue struct { 847 Device_FieldPath 848 subPathItemValue gotenobject.FieldPathArrayItemValue 849 } 850 851 // GetRawValue returns stored array item value 852 func (fpaivs *Device_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 853 return fpaivs.subPathItemValue.GetRawItemValue() 854 } 855 func (fpaivs *Device_FieldSubPathArrayItemValue) AsMetadataPathItemValue() (meta.Meta_FieldPathArrayItemValue, bool) { 856 res, ok := fpaivs.subPathItemValue.(meta.Meta_FieldPathArrayItemValue) 857 return res, ok 858 } 859 func (fpaivs *Device_FieldSubPathArrayItemValue) AsSpecPathItemValue() (DeviceSpec_FieldPathArrayItemValue, bool) { 860 res, ok := fpaivs.subPathItemValue.(DeviceSpec_FieldPathArrayItemValue) 861 return res, ok 862 } 863 func (fpaivs *Device_FieldSubPathArrayItemValue) AsStatusPathItemValue() (DeviceStatus_FieldPathArrayItemValue, bool) { 864 res, ok := fpaivs.subPathItemValue.(DeviceStatus_FieldPathArrayItemValue) 865 return res, ok 866 } 867 func (fpaivs *Device_FieldSubPathArrayItemValue) AsPublicListingSpecPathItemValue() (DevicePublicListingSpec_FieldPathArrayItemValue, bool) { 868 res, ok := fpaivs.subPathItemValue.(DevicePublicListingSpec_FieldPathArrayItemValue) 869 return res, ok 870 } 871 872 // Contains returns a boolean indicating if value that is being held is present in given 'Device' 873 func (fpaivs *Device_FieldSubPathArrayItemValue) ContainsValue(source *Device) bool { 874 switch fpaivs.Selector() { 875 case Device_FieldPathSelectorMetadata: 876 return fpaivs.subPathItemValue.(meta.Meta_FieldPathArrayItemValue).ContainsValue(source.GetMetadata()) 877 case Device_FieldPathSelectorSpec: 878 return fpaivs.subPathItemValue.(DeviceSpec_FieldPathArrayItemValue).ContainsValue(source.GetSpec()) 879 case Device_FieldPathSelectorStatus: 880 return fpaivs.subPathItemValue.(DeviceStatus_FieldPathArrayItemValue).ContainsValue(source.GetStatus()) 881 case Device_FieldPathSelectorPublicListingSpec: 882 return fpaivs.subPathItemValue.(DevicePublicListingSpec_FieldPathArrayItemValue).ContainsValue(source.GetPublicListingSpec()) 883 default: 884 panic(fmt.Sprintf("Invalid selector for Device: %d", fpaivs.Selector())) 885 } 886 } 887 888 // Device_FieldPathArrayOfValues allows storing slice of values for Device fields according to their type 889 type Device_FieldPathArrayOfValues interface { 890 gotenobject.FieldPathArrayOfValues 891 Device_FieldPath 892 } 893 894 func ParseDevice_FieldPathArrayOfValues(pathStr, valuesStr string) (Device_FieldPathArrayOfValues, error) { 895 fp, err := ParseDevice_FieldPath(pathStr) 896 if err != nil { 897 return nil, err 898 } 899 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 900 if err != nil { 901 return nil, status.Errorf(codes.InvalidArgument, "error parsing Device field path array of values from %s: %v", valuesStr, err) 902 } 903 return fpaov.(Device_FieldPathArrayOfValues), nil 904 } 905 906 func MustParseDevice_FieldPathArrayOfValues(pathStr, valuesStr string) Device_FieldPathArrayOfValues { 907 fpaov, err := ParseDevice_FieldPathArrayOfValues(pathStr, valuesStr) 908 if err != nil { 909 panic(err) 910 } 911 return fpaov 912 } 913 914 type Device_FieldTerminalPathArrayOfValues struct { 915 Device_FieldTerminalPath 916 values interface{} 917 } 918 919 var _ Device_FieldPathArrayOfValues = (*Device_FieldTerminalPathArrayOfValues)(nil) 920 921 func (fpaov *Device_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 922 switch fpaov.selector { 923 case Device_FieldPathSelectorName: 924 for _, v := range fpaov.values.([]*Name) { 925 values = append(values, v) 926 } 927 case Device_FieldPathSelectorMetadata: 928 for _, v := range fpaov.values.([]*meta.Meta) { 929 values = append(values, v) 930 } 931 case Device_FieldPathSelectorDisplayName: 932 for _, v := range fpaov.values.([]string) { 933 values = append(values, v) 934 } 935 case Device_FieldPathSelectorDescription: 936 for _, v := range fpaov.values.([]string) { 937 values = append(values, v) 938 } 939 case Device_FieldPathSelectorSpec: 940 for _, v := range fpaov.values.([]*Device_Spec) { 941 values = append(values, v) 942 } 943 case Device_FieldPathSelectorStatus: 944 for _, v := range fpaov.values.([]*Device_Status) { 945 values = append(values, v) 946 } 947 case Device_FieldPathSelectorPublicListingSpec: 948 for _, v := range fpaov.values.([]*Device_PublicListingSpec) { 949 values = append(values, v) 950 } 951 } 952 return 953 } 954 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]*Name, bool) { 955 res, ok := fpaov.values.([]*Name) 956 return res, ok 957 } 958 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsMetadataArrayOfValues() ([]*meta.Meta, bool) { 959 res, ok := fpaov.values.([]*meta.Meta) 960 return res, ok 961 } 962 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsDisplayNameArrayOfValues() ([]string, bool) { 963 res, ok := fpaov.values.([]string) 964 return res, ok 965 } 966 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 967 res, ok := fpaov.values.([]string) 968 return res, ok 969 } 970 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsSpecArrayOfValues() ([]*Device_Spec, bool) { 971 res, ok := fpaov.values.([]*Device_Spec) 972 return res, ok 973 } 974 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsStatusArrayOfValues() ([]*Device_Status, bool) { 975 res, ok := fpaov.values.([]*Device_Status) 976 return res, ok 977 } 978 func (fpaov *Device_FieldTerminalPathArrayOfValues) AsPublicListingSpecArrayOfValues() ([]*Device_PublicListingSpec, bool) { 979 res, ok := fpaov.values.([]*Device_PublicListingSpec) 980 return res, ok 981 } 982 983 type Device_FieldSubPathArrayOfValues struct { 984 Device_FieldPath 985 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 986 } 987 988 var _ Device_FieldPathArrayOfValues = (*Device_FieldSubPathArrayOfValues)(nil) 989 990 func (fpsaov *Device_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 991 return fpsaov.subPathArrayOfValues.GetRawValues() 992 } 993 func (fpsaov *Device_FieldSubPathArrayOfValues) AsMetadataPathArrayOfValues() (meta.Meta_FieldPathArrayOfValues, bool) { 994 res, ok := fpsaov.subPathArrayOfValues.(meta.Meta_FieldPathArrayOfValues) 995 return res, ok 996 } 997 func (fpsaov *Device_FieldSubPathArrayOfValues) AsSpecPathArrayOfValues() (DeviceSpec_FieldPathArrayOfValues, bool) { 998 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpec_FieldPathArrayOfValues) 999 return res, ok 1000 } 1001 func (fpsaov *Device_FieldSubPathArrayOfValues) AsStatusPathArrayOfValues() (DeviceStatus_FieldPathArrayOfValues, bool) { 1002 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatus_FieldPathArrayOfValues) 1003 return res, ok 1004 } 1005 func (fpsaov *Device_FieldSubPathArrayOfValues) AsPublicListingSpecPathArrayOfValues() (DevicePublicListingSpec_FieldPathArrayOfValues, bool) { 1006 res, ok := fpsaov.subPathArrayOfValues.(DevicePublicListingSpec_FieldPathArrayOfValues) 1007 return res, ok 1008 } 1009 1010 // FieldPath provides implementation to handle 1011 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 1012 type DeviceSpec_FieldPath interface { 1013 gotenobject.FieldPath 1014 Selector() DeviceSpec_FieldPathSelector 1015 Get(source *Device_Spec) []interface{} 1016 GetSingle(source *Device_Spec) (interface{}, bool) 1017 ClearValue(item *Device_Spec) 1018 1019 // Those methods build corresponding DeviceSpec_FieldPathValue 1020 // (or array of values) and holds passed value. Panics if injected type is incorrect. 1021 WithIValue(value interface{}) DeviceSpec_FieldPathValue 1022 WithIArrayOfValues(values interface{}) DeviceSpec_FieldPathArrayOfValues 1023 WithIArrayItemValue(value interface{}) DeviceSpec_FieldPathArrayItemValue 1024 } 1025 1026 type DeviceSpec_FieldPathSelector int32 1027 1028 const ( 1029 DeviceSpec_FieldPathSelectorServiceAccount DeviceSpec_FieldPathSelector = 0 1030 DeviceSpec_FieldPathSelectorLogBucket DeviceSpec_FieldPathSelector = 1 1031 DeviceSpec_FieldPathSelectorMetricsBucket DeviceSpec_FieldPathSelector = 2 1032 DeviceSpec_FieldPathSelectorOsVersion DeviceSpec_FieldPathSelector = 3 1033 DeviceSpec_FieldPathSelectorNetplanYamlConfig DeviceSpec_FieldPathSelector = 4 1034 DeviceSpec_FieldPathSelectorNetplanApiConfigMode DeviceSpec_FieldPathSelector = 5 1035 DeviceSpec_FieldPathSelectorOsImageUrl DeviceSpec_FieldPathSelector = 6 1036 DeviceSpec_FieldPathSelectorSshConfig DeviceSpec_FieldPathSelector = 7 1037 DeviceSpec_FieldPathSelectorAttestationConfig DeviceSpec_FieldPathSelector = 8 1038 DeviceSpec_FieldPathSelectorDisableDeviceDiscovery DeviceSpec_FieldPathSelector = 9 1039 DeviceSpec_FieldPathSelectorLoggingConfig DeviceSpec_FieldPathSelector = 10 1040 DeviceSpec_FieldPathSelectorProxyConfig DeviceSpec_FieldPathSelector = 11 1041 DeviceSpec_FieldPathSelectorLocation DeviceSpec_FieldPathSelector = 12 1042 DeviceSpec_FieldPathSelectorUsbGuard DeviceSpec_FieldPathSelector = 13 1043 DeviceSpec_FieldPathSelectorHealthChecks DeviceSpec_FieldPathSelector = 14 1044 DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback DeviceSpec_FieldPathSelector = 15 1045 ) 1046 1047 func (s DeviceSpec_FieldPathSelector) String() string { 1048 switch s { 1049 case DeviceSpec_FieldPathSelectorServiceAccount: 1050 return "service_account" 1051 case DeviceSpec_FieldPathSelectorLogBucket: 1052 return "log_bucket" 1053 case DeviceSpec_FieldPathSelectorMetricsBucket: 1054 return "metrics_bucket" 1055 case DeviceSpec_FieldPathSelectorOsVersion: 1056 return "os_version" 1057 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1058 return "netplan_yaml_config" 1059 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1060 return "netplan_api_config_mode" 1061 case DeviceSpec_FieldPathSelectorOsImageUrl: 1062 return "os_image_url" 1063 case DeviceSpec_FieldPathSelectorSshConfig: 1064 return "ssh_config" 1065 case DeviceSpec_FieldPathSelectorAttestationConfig: 1066 return "attestation_config" 1067 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1068 return "disable_device_discovery" 1069 case DeviceSpec_FieldPathSelectorLoggingConfig: 1070 return "logging_config" 1071 case DeviceSpec_FieldPathSelectorProxyConfig: 1072 return "proxy_config" 1073 case DeviceSpec_FieldPathSelectorLocation: 1074 return "location" 1075 case DeviceSpec_FieldPathSelectorUsbGuard: 1076 return "usb_guard" 1077 case DeviceSpec_FieldPathSelectorHealthChecks: 1078 return "health_checks" 1079 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1080 return "disable_network_config_fallback" 1081 default: 1082 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", s)) 1083 } 1084 } 1085 1086 func BuildDeviceSpec_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpec_FieldPath, error) { 1087 if len(fp) == 0 { 1088 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec") 1089 } 1090 if len(fp) == 1 { 1091 switch fp[0] { 1092 case "service_account", "serviceAccount", "service-account": 1093 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorServiceAccount}, nil 1094 case "log_bucket", "logBucket", "log-bucket": 1095 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorLogBucket}, nil 1096 case "metrics_bucket", "metricsBucket", "metrics-bucket": 1097 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorMetricsBucket}, nil 1098 case "os_version", "osVersion", "os-version": 1099 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorOsVersion}, nil 1100 case "netplan_yaml_config", "netplanYamlConfig", "netplan-yaml-config": 1101 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorNetplanYamlConfig}, nil 1102 case "netplan_api_config_mode", "netplanApiConfigMode", "netplan-api-config-mode": 1103 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorNetplanApiConfigMode}, nil 1104 case "os_image_url", "osImageUrl", "os-image-url": 1105 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorOsImageUrl}, nil 1106 case "ssh_config", "sshConfig", "ssh-config": 1107 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorSshConfig}, nil 1108 case "attestation_config", "attestationConfig", "attestation-config": 1109 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorAttestationConfig}, nil 1110 case "disable_device_discovery", "disableDeviceDiscovery", "disable-device-discovery": 1111 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorDisableDeviceDiscovery}, nil 1112 case "logging_config", "loggingConfig", "logging-config": 1113 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorLoggingConfig}, nil 1114 case "proxy_config", "proxyConfig", "proxy-config": 1115 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorProxyConfig}, nil 1116 case "location": 1117 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorLocation}, nil 1118 case "usb_guard", "usbGuard", "usb-guard": 1119 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorUsbGuard}, nil 1120 case "health_checks", "healthChecks", "health-checks": 1121 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorHealthChecks}, nil 1122 case "disable_network_config_fallback", "disableNetworkConfigFallback", "disable-network-config-fallback": 1123 return &DeviceSpec_FieldTerminalPath{selector: DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback}, nil 1124 } 1125 } else { 1126 switch fp[0] { 1127 case "ssh_config", "sshConfig", "ssh-config": 1128 if subpath, err := BuildDeviceSpecSSHConfig_FieldPath(fp[1:]); err != nil { 1129 return nil, err 1130 } else { 1131 return &DeviceSpec_FieldSubPath{selector: DeviceSpec_FieldPathSelectorSshConfig, subPath: subpath}, nil 1132 } 1133 case "attestation_config", "attestationConfig", "attestation-config": 1134 if subpath, err := BuildDeviceSpecAttestationConfig_FieldPath(fp[1:]); err != nil { 1135 return nil, err 1136 } else { 1137 return &DeviceSpec_FieldSubPath{selector: DeviceSpec_FieldPathSelectorAttestationConfig, subPath: subpath}, nil 1138 } 1139 case "logging_config", "loggingConfig", "logging-config": 1140 if subpath, err := BuildDeviceSpecLoggingConfig_FieldPath(fp[1:]); err != nil { 1141 return nil, err 1142 } else { 1143 return &DeviceSpec_FieldSubPath{selector: DeviceSpec_FieldPathSelectorLoggingConfig, subPath: subpath}, nil 1144 } 1145 case "proxy_config", "proxyConfig", "proxy-config": 1146 if subpath, err := BuildDeviceSpecProxyConfig_FieldPath(fp[1:]); err != nil { 1147 return nil, err 1148 } else { 1149 return &DeviceSpec_FieldSubPath{selector: DeviceSpec_FieldPathSelectorProxyConfig, subPath: subpath}, nil 1150 } 1151 case "location": 1152 if subpath, err := BuildDeviceSpecLocation_FieldPath(fp[1:]); err != nil { 1153 return nil, err 1154 } else { 1155 return &DeviceSpec_FieldSubPath{selector: DeviceSpec_FieldPathSelectorLocation, subPath: subpath}, nil 1156 } 1157 case "usb_guard", "usbGuard", "usb-guard": 1158 if subpath, err := BuildDeviceSpecUSBGuard_FieldPath(fp[1:]); err != nil { 1159 return nil, err 1160 } else { 1161 return &DeviceSpec_FieldSubPath{selector: DeviceSpec_FieldPathSelectorUsbGuard, subPath: subpath}, nil 1162 } 1163 } 1164 } 1165 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec", fp) 1166 } 1167 1168 func ParseDeviceSpec_FieldPath(rawField string) (DeviceSpec_FieldPath, error) { 1169 fp, err := gotenobject.ParseRawFieldPath(rawField) 1170 if err != nil { 1171 return nil, err 1172 } 1173 return BuildDeviceSpec_FieldPath(fp) 1174 } 1175 1176 func MustParseDeviceSpec_FieldPath(rawField string) DeviceSpec_FieldPath { 1177 fp, err := ParseDeviceSpec_FieldPath(rawField) 1178 if err != nil { 1179 panic(err) 1180 } 1181 return fp 1182 } 1183 1184 type DeviceSpec_FieldTerminalPath struct { 1185 selector DeviceSpec_FieldPathSelector 1186 } 1187 1188 var _ DeviceSpec_FieldPath = (*DeviceSpec_FieldTerminalPath)(nil) 1189 1190 func (fp *DeviceSpec_FieldTerminalPath) Selector() DeviceSpec_FieldPathSelector { 1191 return fp.selector 1192 } 1193 1194 // String returns path representation in proto convention 1195 func (fp *DeviceSpec_FieldTerminalPath) String() string { 1196 return fp.selector.String() 1197 } 1198 1199 // JSONString returns path representation is JSON convention 1200 func (fp *DeviceSpec_FieldTerminalPath) JSONString() string { 1201 return strcase.ToLowerCamel(fp.String()) 1202 } 1203 1204 // Get returns all values pointed by specific field from source Device_Spec 1205 func (fp *DeviceSpec_FieldTerminalPath) Get(source *Device_Spec) (values []interface{}) { 1206 if source != nil { 1207 switch fp.selector { 1208 case DeviceSpec_FieldPathSelectorServiceAccount: 1209 if source.ServiceAccount != nil { 1210 values = append(values, source.ServiceAccount) 1211 } 1212 case DeviceSpec_FieldPathSelectorLogBucket: 1213 if source.LogBucket != nil { 1214 values = append(values, source.LogBucket) 1215 } 1216 case DeviceSpec_FieldPathSelectorMetricsBucket: 1217 if source.MetricsBucket != nil { 1218 values = append(values, source.MetricsBucket) 1219 } 1220 case DeviceSpec_FieldPathSelectorOsVersion: 1221 values = append(values, source.OsVersion) 1222 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1223 values = append(values, source.NetplanYamlConfig) 1224 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1225 values = append(values, source.NetplanApiConfigMode) 1226 case DeviceSpec_FieldPathSelectorOsImageUrl: 1227 values = append(values, source.OsImageUrl) 1228 case DeviceSpec_FieldPathSelectorSshConfig: 1229 if source.SshConfig != nil { 1230 values = append(values, source.SshConfig) 1231 } 1232 case DeviceSpec_FieldPathSelectorAttestationConfig: 1233 if source.AttestationConfig != nil { 1234 values = append(values, source.AttestationConfig) 1235 } 1236 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1237 values = append(values, source.DisableDeviceDiscovery) 1238 case DeviceSpec_FieldPathSelectorLoggingConfig: 1239 if source.LoggingConfig != nil { 1240 values = append(values, source.LoggingConfig) 1241 } 1242 case DeviceSpec_FieldPathSelectorProxyConfig: 1243 if source.ProxyConfig != nil { 1244 values = append(values, source.ProxyConfig) 1245 } 1246 case DeviceSpec_FieldPathSelectorLocation: 1247 if source.Location != nil { 1248 values = append(values, source.Location) 1249 } 1250 case DeviceSpec_FieldPathSelectorUsbGuard: 1251 if source.UsbGuard != nil { 1252 values = append(values, source.UsbGuard) 1253 } 1254 case DeviceSpec_FieldPathSelectorHealthChecks: 1255 for _, value := range source.GetHealthChecks() { 1256 values = append(values, value) 1257 } 1258 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1259 values = append(values, source.DisableNetworkConfigFallback) 1260 default: 1261 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1262 } 1263 } 1264 return 1265 } 1266 1267 func (fp *DeviceSpec_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 1268 return fp.Get(source.(*Device_Spec)) 1269 } 1270 1271 // GetSingle returns value pointed by specific field of from source Device_Spec 1272 func (fp *DeviceSpec_FieldTerminalPath) GetSingle(source *Device_Spec) (interface{}, bool) { 1273 switch fp.selector { 1274 case DeviceSpec_FieldPathSelectorServiceAccount: 1275 res := source.GetServiceAccount() 1276 return res, res != nil 1277 case DeviceSpec_FieldPathSelectorLogBucket: 1278 res := source.GetLogBucket() 1279 return res, res != nil 1280 case DeviceSpec_FieldPathSelectorMetricsBucket: 1281 res := source.GetMetricsBucket() 1282 return res, res != nil 1283 case DeviceSpec_FieldPathSelectorOsVersion: 1284 return source.GetOsVersion(), source != nil 1285 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1286 return source.GetNetplanYamlConfig(), source != nil 1287 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1288 return source.GetNetplanApiConfigMode(), source != nil 1289 case DeviceSpec_FieldPathSelectorOsImageUrl: 1290 return source.GetOsImageUrl(), source != nil 1291 case DeviceSpec_FieldPathSelectorSshConfig: 1292 res := source.GetSshConfig() 1293 return res, res != nil 1294 case DeviceSpec_FieldPathSelectorAttestationConfig: 1295 res := source.GetAttestationConfig() 1296 return res, res != nil 1297 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1298 return source.GetDisableDeviceDiscovery(), source != nil 1299 case DeviceSpec_FieldPathSelectorLoggingConfig: 1300 res := source.GetLoggingConfig() 1301 return res, res != nil 1302 case DeviceSpec_FieldPathSelectorProxyConfig: 1303 res := source.GetProxyConfig() 1304 return res, res != nil 1305 case DeviceSpec_FieldPathSelectorLocation: 1306 res := source.GetLocation() 1307 return res, res != nil 1308 case DeviceSpec_FieldPathSelectorUsbGuard: 1309 res := source.GetUsbGuard() 1310 return res, res != nil 1311 case DeviceSpec_FieldPathSelectorHealthChecks: 1312 res := source.GetHealthChecks() 1313 return res, res != nil 1314 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1315 return source.GetDisableNetworkConfigFallback(), source != nil 1316 default: 1317 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1318 } 1319 } 1320 1321 func (fp *DeviceSpec_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 1322 return fp.GetSingle(source.(*Device_Spec)) 1323 } 1324 1325 // GetDefault returns a default value of the field type 1326 func (fp *DeviceSpec_FieldTerminalPath) GetDefault() interface{} { 1327 switch fp.selector { 1328 case DeviceSpec_FieldPathSelectorServiceAccount: 1329 return (*iam_service_account.Reference)(nil) 1330 case DeviceSpec_FieldPathSelectorLogBucket: 1331 return (*logging_bucket.Reference)(nil) 1332 case DeviceSpec_FieldPathSelectorMetricsBucket: 1333 return (*monitoring_bucket.Reference)(nil) 1334 case DeviceSpec_FieldPathSelectorOsVersion: 1335 return "" 1336 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1337 return "" 1338 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1339 return Device_Spec_MERGE 1340 case DeviceSpec_FieldPathSelectorOsImageUrl: 1341 return "" 1342 case DeviceSpec_FieldPathSelectorSshConfig: 1343 return (*Device_Spec_SSHConfig)(nil) 1344 case DeviceSpec_FieldPathSelectorAttestationConfig: 1345 return (*Device_Spec_AttestationConfig)(nil) 1346 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1347 return false 1348 case DeviceSpec_FieldPathSelectorLoggingConfig: 1349 return (*Device_Spec_LoggingConfig)(nil) 1350 case DeviceSpec_FieldPathSelectorProxyConfig: 1351 return (*Device_Spec_ProxyConfig)(nil) 1352 case DeviceSpec_FieldPathSelectorLocation: 1353 return (*Device_Spec_Location)(nil) 1354 case DeviceSpec_FieldPathSelectorUsbGuard: 1355 return (*Device_Spec_USBGuard)(nil) 1356 case DeviceSpec_FieldPathSelectorHealthChecks: 1357 return ([]*api.HealthCheckSpec)(nil) 1358 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1359 return false 1360 default: 1361 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1362 } 1363 } 1364 1365 func (fp *DeviceSpec_FieldTerminalPath) ClearValue(item *Device_Spec) { 1366 if item != nil { 1367 switch fp.selector { 1368 case DeviceSpec_FieldPathSelectorServiceAccount: 1369 item.ServiceAccount = nil 1370 case DeviceSpec_FieldPathSelectorLogBucket: 1371 item.LogBucket = nil 1372 case DeviceSpec_FieldPathSelectorMetricsBucket: 1373 item.MetricsBucket = nil 1374 case DeviceSpec_FieldPathSelectorOsVersion: 1375 item.OsVersion = "" 1376 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1377 item.NetplanYamlConfig = "" 1378 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1379 item.NetplanApiConfigMode = Device_Spec_MERGE 1380 case DeviceSpec_FieldPathSelectorOsImageUrl: 1381 item.OsImageUrl = "" 1382 case DeviceSpec_FieldPathSelectorSshConfig: 1383 item.SshConfig = nil 1384 case DeviceSpec_FieldPathSelectorAttestationConfig: 1385 item.AttestationConfig = nil 1386 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1387 item.DisableDeviceDiscovery = false 1388 case DeviceSpec_FieldPathSelectorLoggingConfig: 1389 item.LoggingConfig = nil 1390 case DeviceSpec_FieldPathSelectorProxyConfig: 1391 item.ProxyConfig = nil 1392 case DeviceSpec_FieldPathSelectorLocation: 1393 item.Location = nil 1394 case DeviceSpec_FieldPathSelectorUsbGuard: 1395 item.UsbGuard = nil 1396 case DeviceSpec_FieldPathSelectorHealthChecks: 1397 item.HealthChecks = nil 1398 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1399 item.DisableNetworkConfigFallback = false 1400 default: 1401 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1402 } 1403 } 1404 } 1405 1406 func (fp *DeviceSpec_FieldTerminalPath) ClearValueRaw(item proto.Message) { 1407 fp.ClearValue(item.(*Device_Spec)) 1408 } 1409 1410 // IsLeaf - whether field path is holds simple value 1411 func (fp *DeviceSpec_FieldTerminalPath) IsLeaf() bool { 1412 return fp.selector == DeviceSpec_FieldPathSelectorServiceAccount || 1413 fp.selector == DeviceSpec_FieldPathSelectorLogBucket || 1414 fp.selector == DeviceSpec_FieldPathSelectorMetricsBucket || 1415 fp.selector == DeviceSpec_FieldPathSelectorOsVersion || 1416 fp.selector == DeviceSpec_FieldPathSelectorNetplanYamlConfig || 1417 fp.selector == DeviceSpec_FieldPathSelectorNetplanApiConfigMode || 1418 fp.selector == DeviceSpec_FieldPathSelectorOsImageUrl || 1419 fp.selector == DeviceSpec_FieldPathSelectorDisableDeviceDiscovery || 1420 fp.selector == DeviceSpec_FieldPathSelectorHealthChecks || 1421 fp.selector == DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback 1422 } 1423 1424 func (fp *DeviceSpec_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 1425 return []gotenobject.FieldPath{fp} 1426 } 1427 1428 func (fp *DeviceSpec_FieldTerminalPath) WithIValue(value interface{}) DeviceSpec_FieldPathValue { 1429 switch fp.selector { 1430 case DeviceSpec_FieldPathSelectorServiceAccount: 1431 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*iam_service_account.Reference)} 1432 case DeviceSpec_FieldPathSelectorLogBucket: 1433 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*logging_bucket.Reference)} 1434 case DeviceSpec_FieldPathSelectorMetricsBucket: 1435 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*monitoring_bucket.Reference)} 1436 case DeviceSpec_FieldPathSelectorOsVersion: 1437 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(string)} 1438 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1439 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(string)} 1440 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1441 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(Device_Spec_NetworkConfigMode)} 1442 case DeviceSpec_FieldPathSelectorOsImageUrl: 1443 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(string)} 1444 case DeviceSpec_FieldPathSelectorSshConfig: 1445 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*Device_Spec_SSHConfig)} 1446 case DeviceSpec_FieldPathSelectorAttestationConfig: 1447 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*Device_Spec_AttestationConfig)} 1448 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1449 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(bool)} 1450 case DeviceSpec_FieldPathSelectorLoggingConfig: 1451 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*Device_Spec_LoggingConfig)} 1452 case DeviceSpec_FieldPathSelectorProxyConfig: 1453 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*Device_Spec_ProxyConfig)} 1454 case DeviceSpec_FieldPathSelectorLocation: 1455 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*Device_Spec_Location)} 1456 case DeviceSpec_FieldPathSelectorUsbGuard: 1457 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*Device_Spec_USBGuard)} 1458 case DeviceSpec_FieldPathSelectorHealthChecks: 1459 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.([]*api.HealthCheckSpec)} 1460 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1461 return &DeviceSpec_FieldTerminalPathValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(bool)} 1462 default: 1463 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1464 } 1465 } 1466 1467 func (fp *DeviceSpec_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 1468 return fp.WithIValue(value) 1469 } 1470 1471 func (fp *DeviceSpec_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpec_FieldPathArrayOfValues { 1472 fpaov := &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp} 1473 switch fp.selector { 1474 case DeviceSpec_FieldPathSelectorServiceAccount: 1475 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*iam_service_account.Reference)} 1476 case DeviceSpec_FieldPathSelectorLogBucket: 1477 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*logging_bucket.Reference)} 1478 case DeviceSpec_FieldPathSelectorMetricsBucket: 1479 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*monitoring_bucket.Reference)} 1480 case DeviceSpec_FieldPathSelectorOsVersion: 1481 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]string)} 1482 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1483 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]string)} 1484 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1485 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]Device_Spec_NetworkConfigMode)} 1486 case DeviceSpec_FieldPathSelectorOsImageUrl: 1487 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]string)} 1488 case DeviceSpec_FieldPathSelectorSshConfig: 1489 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*Device_Spec_SSHConfig)} 1490 case DeviceSpec_FieldPathSelectorAttestationConfig: 1491 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*Device_Spec_AttestationConfig)} 1492 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1493 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]bool)} 1494 case DeviceSpec_FieldPathSelectorLoggingConfig: 1495 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*Device_Spec_LoggingConfig)} 1496 case DeviceSpec_FieldPathSelectorProxyConfig: 1497 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*Device_Spec_ProxyConfig)} 1498 case DeviceSpec_FieldPathSelectorLocation: 1499 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*Device_Spec_Location)} 1500 case DeviceSpec_FieldPathSelectorUsbGuard: 1501 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]*Device_Spec_USBGuard)} 1502 case DeviceSpec_FieldPathSelectorHealthChecks: 1503 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([][]*api.HealthCheckSpec)} 1504 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1505 return &DeviceSpec_FieldTerminalPathArrayOfValues{DeviceSpec_FieldTerminalPath: *fp, values: values.([]bool)} 1506 default: 1507 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1508 } 1509 return fpaov 1510 } 1511 1512 func (fp *DeviceSpec_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 1513 return fp.WithIArrayOfValues(values) 1514 } 1515 1516 func (fp *DeviceSpec_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpec_FieldPathArrayItemValue { 1517 switch fp.selector { 1518 case DeviceSpec_FieldPathSelectorHealthChecks: 1519 return &DeviceSpec_FieldTerminalPathArrayItemValue{DeviceSpec_FieldTerminalPath: *fp, value: value.(*api.HealthCheckSpec)} 1520 default: 1521 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fp.selector)) 1522 } 1523 } 1524 1525 func (fp *DeviceSpec_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 1526 return fp.WithIArrayItemValue(value) 1527 } 1528 1529 type DeviceSpec_FieldSubPath struct { 1530 selector DeviceSpec_FieldPathSelector 1531 subPath gotenobject.FieldPath 1532 } 1533 1534 var _ DeviceSpec_FieldPath = (*DeviceSpec_FieldSubPath)(nil) 1535 1536 func (fps *DeviceSpec_FieldSubPath) Selector() DeviceSpec_FieldPathSelector { 1537 return fps.selector 1538 } 1539 func (fps *DeviceSpec_FieldSubPath) AsSshConfigSubPath() (DeviceSpecSSHConfig_FieldPath, bool) { 1540 res, ok := fps.subPath.(DeviceSpecSSHConfig_FieldPath) 1541 return res, ok 1542 } 1543 func (fps *DeviceSpec_FieldSubPath) AsAttestationConfigSubPath() (DeviceSpecAttestationConfig_FieldPath, bool) { 1544 res, ok := fps.subPath.(DeviceSpecAttestationConfig_FieldPath) 1545 return res, ok 1546 } 1547 func (fps *DeviceSpec_FieldSubPath) AsLoggingConfigSubPath() (DeviceSpecLoggingConfig_FieldPath, bool) { 1548 res, ok := fps.subPath.(DeviceSpecLoggingConfig_FieldPath) 1549 return res, ok 1550 } 1551 func (fps *DeviceSpec_FieldSubPath) AsProxyConfigSubPath() (DeviceSpecProxyConfig_FieldPath, bool) { 1552 res, ok := fps.subPath.(DeviceSpecProxyConfig_FieldPath) 1553 return res, ok 1554 } 1555 func (fps *DeviceSpec_FieldSubPath) AsLocationSubPath() (DeviceSpecLocation_FieldPath, bool) { 1556 res, ok := fps.subPath.(DeviceSpecLocation_FieldPath) 1557 return res, ok 1558 } 1559 func (fps *DeviceSpec_FieldSubPath) AsUsbGuardSubPath() (DeviceSpecUSBGuard_FieldPath, bool) { 1560 res, ok := fps.subPath.(DeviceSpecUSBGuard_FieldPath) 1561 return res, ok 1562 } 1563 1564 // String returns path representation in proto convention 1565 func (fps *DeviceSpec_FieldSubPath) String() string { 1566 return fps.selector.String() + "." + fps.subPath.String() 1567 } 1568 1569 // JSONString returns path representation is JSON convention 1570 func (fps *DeviceSpec_FieldSubPath) JSONString() string { 1571 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 1572 } 1573 1574 // Get returns all values pointed by selected field from source Device_Spec 1575 func (fps *DeviceSpec_FieldSubPath) Get(source *Device_Spec) (values []interface{}) { 1576 switch fps.selector { 1577 case DeviceSpec_FieldPathSelectorSshConfig: 1578 values = append(values, fps.subPath.GetRaw(source.GetSshConfig())...) 1579 case DeviceSpec_FieldPathSelectorAttestationConfig: 1580 values = append(values, fps.subPath.GetRaw(source.GetAttestationConfig())...) 1581 case DeviceSpec_FieldPathSelectorLoggingConfig: 1582 values = append(values, fps.subPath.GetRaw(source.GetLoggingConfig())...) 1583 case DeviceSpec_FieldPathSelectorProxyConfig: 1584 values = append(values, fps.subPath.GetRaw(source.GetProxyConfig())...) 1585 case DeviceSpec_FieldPathSelectorLocation: 1586 values = append(values, fps.subPath.GetRaw(source.GetLocation())...) 1587 case DeviceSpec_FieldPathSelectorUsbGuard: 1588 values = append(values, fps.subPath.GetRaw(source.GetUsbGuard())...) 1589 default: 1590 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fps.selector)) 1591 } 1592 return 1593 } 1594 1595 func (fps *DeviceSpec_FieldSubPath) GetRaw(source proto.Message) []interface{} { 1596 return fps.Get(source.(*Device_Spec)) 1597 } 1598 1599 // GetSingle returns value of selected field from source Device_Spec 1600 func (fps *DeviceSpec_FieldSubPath) GetSingle(source *Device_Spec) (interface{}, bool) { 1601 switch fps.selector { 1602 case DeviceSpec_FieldPathSelectorSshConfig: 1603 if source.GetSshConfig() == nil { 1604 return nil, false 1605 } 1606 return fps.subPath.GetSingleRaw(source.GetSshConfig()) 1607 case DeviceSpec_FieldPathSelectorAttestationConfig: 1608 if source.GetAttestationConfig() == nil { 1609 return nil, false 1610 } 1611 return fps.subPath.GetSingleRaw(source.GetAttestationConfig()) 1612 case DeviceSpec_FieldPathSelectorLoggingConfig: 1613 if source.GetLoggingConfig() == nil { 1614 return nil, false 1615 } 1616 return fps.subPath.GetSingleRaw(source.GetLoggingConfig()) 1617 case DeviceSpec_FieldPathSelectorProxyConfig: 1618 if source.GetProxyConfig() == nil { 1619 return nil, false 1620 } 1621 return fps.subPath.GetSingleRaw(source.GetProxyConfig()) 1622 case DeviceSpec_FieldPathSelectorLocation: 1623 if source.GetLocation() == nil { 1624 return nil, false 1625 } 1626 return fps.subPath.GetSingleRaw(source.GetLocation()) 1627 case DeviceSpec_FieldPathSelectorUsbGuard: 1628 if source.GetUsbGuard() == nil { 1629 return nil, false 1630 } 1631 return fps.subPath.GetSingleRaw(source.GetUsbGuard()) 1632 default: 1633 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fps.selector)) 1634 } 1635 } 1636 1637 func (fps *DeviceSpec_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 1638 return fps.GetSingle(source.(*Device_Spec)) 1639 } 1640 1641 // GetDefault returns a default value of the field type 1642 func (fps *DeviceSpec_FieldSubPath) GetDefault() interface{} { 1643 return fps.subPath.GetDefault() 1644 } 1645 1646 func (fps *DeviceSpec_FieldSubPath) ClearValue(item *Device_Spec) { 1647 if item != nil { 1648 switch fps.selector { 1649 case DeviceSpec_FieldPathSelectorSshConfig: 1650 fps.subPath.ClearValueRaw(item.SshConfig) 1651 case DeviceSpec_FieldPathSelectorAttestationConfig: 1652 fps.subPath.ClearValueRaw(item.AttestationConfig) 1653 case DeviceSpec_FieldPathSelectorLoggingConfig: 1654 fps.subPath.ClearValueRaw(item.LoggingConfig) 1655 case DeviceSpec_FieldPathSelectorProxyConfig: 1656 fps.subPath.ClearValueRaw(item.ProxyConfig) 1657 case DeviceSpec_FieldPathSelectorLocation: 1658 fps.subPath.ClearValueRaw(item.Location) 1659 case DeviceSpec_FieldPathSelectorUsbGuard: 1660 fps.subPath.ClearValueRaw(item.UsbGuard) 1661 default: 1662 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fps.selector)) 1663 } 1664 } 1665 } 1666 1667 func (fps *DeviceSpec_FieldSubPath) ClearValueRaw(item proto.Message) { 1668 fps.ClearValue(item.(*Device_Spec)) 1669 } 1670 1671 // IsLeaf - whether field path is holds simple value 1672 func (fps *DeviceSpec_FieldSubPath) IsLeaf() bool { 1673 return fps.subPath.IsLeaf() 1674 } 1675 1676 func (fps *DeviceSpec_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 1677 iPaths := []gotenobject.FieldPath{&DeviceSpec_FieldTerminalPath{selector: fps.selector}} 1678 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 1679 return iPaths 1680 } 1681 1682 func (fps *DeviceSpec_FieldSubPath) WithIValue(value interface{}) DeviceSpec_FieldPathValue { 1683 return &DeviceSpec_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 1684 } 1685 1686 func (fps *DeviceSpec_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 1687 return fps.WithIValue(value) 1688 } 1689 1690 func (fps *DeviceSpec_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceSpec_FieldPathArrayOfValues { 1691 return &DeviceSpec_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 1692 } 1693 1694 func (fps *DeviceSpec_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 1695 return fps.WithIArrayOfValues(values) 1696 } 1697 1698 func (fps *DeviceSpec_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceSpec_FieldPathArrayItemValue { 1699 return &DeviceSpec_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 1700 } 1701 1702 func (fps *DeviceSpec_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 1703 return fps.WithIArrayItemValue(value) 1704 } 1705 1706 // DeviceSpec_FieldPathValue allows storing values for Spec fields according to their type 1707 type DeviceSpec_FieldPathValue interface { 1708 DeviceSpec_FieldPath 1709 gotenobject.FieldPathValue 1710 SetTo(target **Device_Spec) 1711 CompareWith(*Device_Spec) (cmp int, comparable bool) 1712 } 1713 1714 func ParseDeviceSpec_FieldPathValue(pathStr, valueStr string) (DeviceSpec_FieldPathValue, error) { 1715 fp, err := ParseDeviceSpec_FieldPath(pathStr) 1716 if err != nil { 1717 return nil, err 1718 } 1719 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 1720 if err != nil { 1721 return nil, status.Errorf(codes.InvalidArgument, "error parsing Spec field path value from %s: %v", valueStr, err) 1722 } 1723 return fpv.(DeviceSpec_FieldPathValue), nil 1724 } 1725 1726 func MustParseDeviceSpec_FieldPathValue(pathStr, valueStr string) DeviceSpec_FieldPathValue { 1727 fpv, err := ParseDeviceSpec_FieldPathValue(pathStr, valueStr) 1728 if err != nil { 1729 panic(err) 1730 } 1731 return fpv 1732 } 1733 1734 type DeviceSpec_FieldTerminalPathValue struct { 1735 DeviceSpec_FieldTerminalPath 1736 value interface{} 1737 } 1738 1739 var _ DeviceSpec_FieldPathValue = (*DeviceSpec_FieldTerminalPathValue)(nil) 1740 1741 // GetRawValue returns raw value stored under selected path for 'Spec' as interface{} 1742 func (fpv *DeviceSpec_FieldTerminalPathValue) GetRawValue() interface{} { 1743 return fpv.value 1744 } 1745 func (fpv *DeviceSpec_FieldTerminalPathValue) AsServiceAccountValue() (*iam_service_account.Reference, bool) { 1746 res, ok := fpv.value.(*iam_service_account.Reference) 1747 return res, ok 1748 } 1749 func (fpv *DeviceSpec_FieldTerminalPathValue) AsLogBucketValue() (*logging_bucket.Reference, bool) { 1750 res, ok := fpv.value.(*logging_bucket.Reference) 1751 return res, ok 1752 } 1753 func (fpv *DeviceSpec_FieldTerminalPathValue) AsMetricsBucketValue() (*monitoring_bucket.Reference, bool) { 1754 res, ok := fpv.value.(*monitoring_bucket.Reference) 1755 return res, ok 1756 } 1757 func (fpv *DeviceSpec_FieldTerminalPathValue) AsOsVersionValue() (string, bool) { 1758 res, ok := fpv.value.(string) 1759 return res, ok 1760 } 1761 func (fpv *DeviceSpec_FieldTerminalPathValue) AsNetplanYamlConfigValue() (string, bool) { 1762 res, ok := fpv.value.(string) 1763 return res, ok 1764 } 1765 func (fpv *DeviceSpec_FieldTerminalPathValue) AsNetplanApiConfigModeValue() (Device_Spec_NetworkConfigMode, bool) { 1766 res, ok := fpv.value.(Device_Spec_NetworkConfigMode) 1767 return res, ok 1768 } 1769 func (fpv *DeviceSpec_FieldTerminalPathValue) AsOsImageUrlValue() (string, bool) { 1770 res, ok := fpv.value.(string) 1771 return res, ok 1772 } 1773 func (fpv *DeviceSpec_FieldTerminalPathValue) AsSshConfigValue() (*Device_Spec_SSHConfig, bool) { 1774 res, ok := fpv.value.(*Device_Spec_SSHConfig) 1775 return res, ok 1776 } 1777 func (fpv *DeviceSpec_FieldTerminalPathValue) AsAttestationConfigValue() (*Device_Spec_AttestationConfig, bool) { 1778 res, ok := fpv.value.(*Device_Spec_AttestationConfig) 1779 return res, ok 1780 } 1781 func (fpv *DeviceSpec_FieldTerminalPathValue) AsDisableDeviceDiscoveryValue() (bool, bool) { 1782 res, ok := fpv.value.(bool) 1783 return res, ok 1784 } 1785 func (fpv *DeviceSpec_FieldTerminalPathValue) AsLoggingConfigValue() (*Device_Spec_LoggingConfig, bool) { 1786 res, ok := fpv.value.(*Device_Spec_LoggingConfig) 1787 return res, ok 1788 } 1789 func (fpv *DeviceSpec_FieldTerminalPathValue) AsProxyConfigValue() (*Device_Spec_ProxyConfig, bool) { 1790 res, ok := fpv.value.(*Device_Spec_ProxyConfig) 1791 return res, ok 1792 } 1793 func (fpv *DeviceSpec_FieldTerminalPathValue) AsLocationValue() (*Device_Spec_Location, bool) { 1794 res, ok := fpv.value.(*Device_Spec_Location) 1795 return res, ok 1796 } 1797 func (fpv *DeviceSpec_FieldTerminalPathValue) AsUsbGuardValue() (*Device_Spec_USBGuard, bool) { 1798 res, ok := fpv.value.(*Device_Spec_USBGuard) 1799 return res, ok 1800 } 1801 func (fpv *DeviceSpec_FieldTerminalPathValue) AsHealthChecksValue() ([]*api.HealthCheckSpec, bool) { 1802 res, ok := fpv.value.([]*api.HealthCheckSpec) 1803 return res, ok 1804 } 1805 func (fpv *DeviceSpec_FieldTerminalPathValue) AsDisableNetworkConfigFallbackValue() (bool, bool) { 1806 res, ok := fpv.value.(bool) 1807 return res, ok 1808 } 1809 1810 // SetTo stores value for selected field for object Spec 1811 func (fpv *DeviceSpec_FieldTerminalPathValue) SetTo(target **Device_Spec) { 1812 if *target == nil { 1813 *target = new(Device_Spec) 1814 } 1815 switch fpv.selector { 1816 case DeviceSpec_FieldPathSelectorServiceAccount: 1817 (*target).ServiceAccount = fpv.value.(*iam_service_account.Reference) 1818 case DeviceSpec_FieldPathSelectorLogBucket: 1819 (*target).LogBucket = fpv.value.(*logging_bucket.Reference) 1820 case DeviceSpec_FieldPathSelectorMetricsBucket: 1821 (*target).MetricsBucket = fpv.value.(*monitoring_bucket.Reference) 1822 case DeviceSpec_FieldPathSelectorOsVersion: 1823 (*target).OsVersion = fpv.value.(string) 1824 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1825 (*target).NetplanYamlConfig = fpv.value.(string) 1826 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1827 (*target).NetplanApiConfigMode = fpv.value.(Device_Spec_NetworkConfigMode) 1828 case DeviceSpec_FieldPathSelectorOsImageUrl: 1829 (*target).OsImageUrl = fpv.value.(string) 1830 case DeviceSpec_FieldPathSelectorSshConfig: 1831 (*target).SshConfig = fpv.value.(*Device_Spec_SSHConfig) 1832 case DeviceSpec_FieldPathSelectorAttestationConfig: 1833 (*target).AttestationConfig = fpv.value.(*Device_Spec_AttestationConfig) 1834 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1835 (*target).DisableDeviceDiscovery = fpv.value.(bool) 1836 case DeviceSpec_FieldPathSelectorLoggingConfig: 1837 (*target).LoggingConfig = fpv.value.(*Device_Spec_LoggingConfig) 1838 case DeviceSpec_FieldPathSelectorProxyConfig: 1839 (*target).ProxyConfig = fpv.value.(*Device_Spec_ProxyConfig) 1840 case DeviceSpec_FieldPathSelectorLocation: 1841 (*target).Location = fpv.value.(*Device_Spec_Location) 1842 case DeviceSpec_FieldPathSelectorUsbGuard: 1843 (*target).UsbGuard = fpv.value.(*Device_Spec_USBGuard) 1844 case DeviceSpec_FieldPathSelectorHealthChecks: 1845 (*target).HealthChecks = fpv.value.([]*api.HealthCheckSpec) 1846 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1847 (*target).DisableNetworkConfigFallback = fpv.value.(bool) 1848 default: 1849 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fpv.selector)) 1850 } 1851 } 1852 1853 func (fpv *DeviceSpec_FieldTerminalPathValue) SetToRaw(target proto.Message) { 1854 typedObject := target.(*Device_Spec) 1855 fpv.SetTo(&typedObject) 1856 } 1857 1858 // CompareWith compares value in the 'DeviceSpec_FieldTerminalPathValue' with the value under path in 'Device_Spec'. 1859 func (fpv *DeviceSpec_FieldTerminalPathValue) CompareWith(source *Device_Spec) (int, bool) { 1860 switch fpv.selector { 1861 case DeviceSpec_FieldPathSelectorServiceAccount: 1862 leftValue := fpv.value.(*iam_service_account.Reference) 1863 rightValue := source.GetServiceAccount() 1864 if leftValue == nil { 1865 if rightValue != nil { 1866 return -1, true 1867 } 1868 return 0, true 1869 } 1870 if rightValue == nil { 1871 return 1, true 1872 } 1873 if leftValue.String() == rightValue.String() { 1874 return 0, true 1875 } else if leftValue.String() < rightValue.String() { 1876 return -1, true 1877 } else { 1878 return 1, true 1879 } 1880 case DeviceSpec_FieldPathSelectorLogBucket: 1881 leftValue := fpv.value.(*logging_bucket.Reference) 1882 rightValue := source.GetLogBucket() 1883 if leftValue == nil { 1884 if rightValue != nil { 1885 return -1, true 1886 } 1887 return 0, true 1888 } 1889 if rightValue == nil { 1890 return 1, true 1891 } 1892 if leftValue.String() == rightValue.String() { 1893 return 0, true 1894 } else if leftValue.String() < rightValue.String() { 1895 return -1, true 1896 } else { 1897 return 1, true 1898 } 1899 case DeviceSpec_FieldPathSelectorMetricsBucket: 1900 leftValue := fpv.value.(*monitoring_bucket.Reference) 1901 rightValue := source.GetMetricsBucket() 1902 if leftValue == nil { 1903 if rightValue != nil { 1904 return -1, true 1905 } 1906 return 0, true 1907 } 1908 if rightValue == nil { 1909 return 1, true 1910 } 1911 if leftValue.String() == rightValue.String() { 1912 return 0, true 1913 } else if leftValue.String() < rightValue.String() { 1914 return -1, true 1915 } else { 1916 return 1, true 1917 } 1918 case DeviceSpec_FieldPathSelectorOsVersion: 1919 leftValue := fpv.value.(string) 1920 rightValue := source.GetOsVersion() 1921 if (leftValue) == (rightValue) { 1922 return 0, true 1923 } else if (leftValue) < (rightValue) { 1924 return -1, true 1925 } else { 1926 return 1, true 1927 } 1928 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 1929 leftValue := fpv.value.(string) 1930 rightValue := source.GetNetplanYamlConfig() 1931 if (leftValue) == (rightValue) { 1932 return 0, true 1933 } else if (leftValue) < (rightValue) { 1934 return -1, true 1935 } else { 1936 return 1, true 1937 } 1938 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 1939 leftValue := fpv.value.(Device_Spec_NetworkConfigMode) 1940 rightValue := source.GetNetplanApiConfigMode() 1941 if (leftValue) == (rightValue) { 1942 return 0, true 1943 } else if (leftValue) < (rightValue) { 1944 return -1, true 1945 } else { 1946 return 1, true 1947 } 1948 case DeviceSpec_FieldPathSelectorOsImageUrl: 1949 leftValue := fpv.value.(string) 1950 rightValue := source.GetOsImageUrl() 1951 if (leftValue) == (rightValue) { 1952 return 0, true 1953 } else if (leftValue) < (rightValue) { 1954 return -1, true 1955 } else { 1956 return 1, true 1957 } 1958 case DeviceSpec_FieldPathSelectorSshConfig: 1959 return 0, false 1960 case DeviceSpec_FieldPathSelectorAttestationConfig: 1961 return 0, false 1962 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 1963 leftValue := fpv.value.(bool) 1964 rightValue := source.GetDisableDeviceDiscovery() 1965 if (leftValue) == (rightValue) { 1966 return 0, true 1967 } else if !(leftValue) && (rightValue) { 1968 return -1, true 1969 } else { 1970 return 1, true 1971 } 1972 case DeviceSpec_FieldPathSelectorLoggingConfig: 1973 return 0, false 1974 case DeviceSpec_FieldPathSelectorProxyConfig: 1975 return 0, false 1976 case DeviceSpec_FieldPathSelectorLocation: 1977 return 0, false 1978 case DeviceSpec_FieldPathSelectorUsbGuard: 1979 return 0, false 1980 case DeviceSpec_FieldPathSelectorHealthChecks: 1981 return 0, false 1982 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 1983 leftValue := fpv.value.(bool) 1984 rightValue := source.GetDisableNetworkConfigFallback() 1985 if (leftValue) == (rightValue) { 1986 return 0, true 1987 } else if !(leftValue) && (rightValue) { 1988 return -1, true 1989 } else { 1990 return 1, true 1991 } 1992 default: 1993 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fpv.selector)) 1994 } 1995 } 1996 1997 func (fpv *DeviceSpec_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1998 return fpv.CompareWith(source.(*Device_Spec)) 1999 } 2000 2001 type DeviceSpec_FieldSubPathValue struct { 2002 DeviceSpec_FieldPath 2003 subPathValue gotenobject.FieldPathValue 2004 } 2005 2006 var _ DeviceSpec_FieldPathValue = (*DeviceSpec_FieldSubPathValue)(nil) 2007 2008 func (fpvs *DeviceSpec_FieldSubPathValue) AsSshConfigPathValue() (DeviceSpecSSHConfig_FieldPathValue, bool) { 2009 res, ok := fpvs.subPathValue.(DeviceSpecSSHConfig_FieldPathValue) 2010 return res, ok 2011 } 2012 func (fpvs *DeviceSpec_FieldSubPathValue) AsAttestationConfigPathValue() (DeviceSpecAttestationConfig_FieldPathValue, bool) { 2013 res, ok := fpvs.subPathValue.(DeviceSpecAttestationConfig_FieldPathValue) 2014 return res, ok 2015 } 2016 func (fpvs *DeviceSpec_FieldSubPathValue) AsLoggingConfigPathValue() (DeviceSpecLoggingConfig_FieldPathValue, bool) { 2017 res, ok := fpvs.subPathValue.(DeviceSpecLoggingConfig_FieldPathValue) 2018 return res, ok 2019 } 2020 func (fpvs *DeviceSpec_FieldSubPathValue) AsProxyConfigPathValue() (DeviceSpecProxyConfig_FieldPathValue, bool) { 2021 res, ok := fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue) 2022 return res, ok 2023 } 2024 func (fpvs *DeviceSpec_FieldSubPathValue) AsLocationPathValue() (DeviceSpecLocation_FieldPathValue, bool) { 2025 res, ok := fpvs.subPathValue.(DeviceSpecLocation_FieldPathValue) 2026 return res, ok 2027 } 2028 func (fpvs *DeviceSpec_FieldSubPathValue) AsUsbGuardPathValue() (DeviceSpecUSBGuard_FieldPathValue, bool) { 2029 res, ok := fpvs.subPathValue.(DeviceSpecUSBGuard_FieldPathValue) 2030 return res, ok 2031 } 2032 2033 func (fpvs *DeviceSpec_FieldSubPathValue) SetTo(target **Device_Spec) { 2034 if *target == nil { 2035 *target = new(Device_Spec) 2036 } 2037 switch fpvs.Selector() { 2038 case DeviceSpec_FieldPathSelectorSshConfig: 2039 fpvs.subPathValue.(DeviceSpecSSHConfig_FieldPathValue).SetTo(&(*target).SshConfig) 2040 case DeviceSpec_FieldPathSelectorAttestationConfig: 2041 fpvs.subPathValue.(DeviceSpecAttestationConfig_FieldPathValue).SetTo(&(*target).AttestationConfig) 2042 case DeviceSpec_FieldPathSelectorLoggingConfig: 2043 fpvs.subPathValue.(DeviceSpecLoggingConfig_FieldPathValue).SetTo(&(*target).LoggingConfig) 2044 case DeviceSpec_FieldPathSelectorProxyConfig: 2045 fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).SetTo(&(*target).ProxyConfig) 2046 case DeviceSpec_FieldPathSelectorLocation: 2047 fpvs.subPathValue.(DeviceSpecLocation_FieldPathValue).SetTo(&(*target).Location) 2048 case DeviceSpec_FieldPathSelectorUsbGuard: 2049 fpvs.subPathValue.(DeviceSpecUSBGuard_FieldPathValue).SetTo(&(*target).UsbGuard) 2050 default: 2051 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fpvs.Selector())) 2052 } 2053 } 2054 2055 func (fpvs *DeviceSpec_FieldSubPathValue) SetToRaw(target proto.Message) { 2056 typedObject := target.(*Device_Spec) 2057 fpvs.SetTo(&typedObject) 2058 } 2059 2060 func (fpvs *DeviceSpec_FieldSubPathValue) GetRawValue() interface{} { 2061 return fpvs.subPathValue.GetRawValue() 2062 } 2063 2064 func (fpvs *DeviceSpec_FieldSubPathValue) CompareWith(source *Device_Spec) (int, bool) { 2065 switch fpvs.Selector() { 2066 case DeviceSpec_FieldPathSelectorSshConfig: 2067 return fpvs.subPathValue.(DeviceSpecSSHConfig_FieldPathValue).CompareWith(source.GetSshConfig()) 2068 case DeviceSpec_FieldPathSelectorAttestationConfig: 2069 return fpvs.subPathValue.(DeviceSpecAttestationConfig_FieldPathValue).CompareWith(source.GetAttestationConfig()) 2070 case DeviceSpec_FieldPathSelectorLoggingConfig: 2071 return fpvs.subPathValue.(DeviceSpecLoggingConfig_FieldPathValue).CompareWith(source.GetLoggingConfig()) 2072 case DeviceSpec_FieldPathSelectorProxyConfig: 2073 return fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).CompareWith(source.GetProxyConfig()) 2074 case DeviceSpec_FieldPathSelectorLocation: 2075 return fpvs.subPathValue.(DeviceSpecLocation_FieldPathValue).CompareWith(source.GetLocation()) 2076 case DeviceSpec_FieldPathSelectorUsbGuard: 2077 return fpvs.subPathValue.(DeviceSpecUSBGuard_FieldPathValue).CompareWith(source.GetUsbGuard()) 2078 default: 2079 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fpvs.Selector())) 2080 } 2081 } 2082 2083 func (fpvs *DeviceSpec_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 2084 return fpvs.CompareWith(source.(*Device_Spec)) 2085 } 2086 2087 // DeviceSpec_FieldPathArrayItemValue allows storing single item in Path-specific values for Spec according to their type 2088 // Present only for array (repeated) types. 2089 type DeviceSpec_FieldPathArrayItemValue interface { 2090 gotenobject.FieldPathArrayItemValue 2091 DeviceSpec_FieldPath 2092 ContainsValue(*Device_Spec) bool 2093 } 2094 2095 // ParseDeviceSpec_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 2096 func ParseDeviceSpec_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpec_FieldPathArrayItemValue, error) { 2097 fp, err := ParseDeviceSpec_FieldPath(pathStr) 2098 if err != nil { 2099 return nil, err 2100 } 2101 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 2102 if err != nil { 2103 return nil, status.Errorf(codes.InvalidArgument, "error parsing Spec field path array item value from %s: %v", valueStr, err) 2104 } 2105 return fpaiv.(DeviceSpec_FieldPathArrayItemValue), nil 2106 } 2107 2108 func MustParseDeviceSpec_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpec_FieldPathArrayItemValue { 2109 fpaiv, err := ParseDeviceSpec_FieldPathArrayItemValue(pathStr, valueStr) 2110 if err != nil { 2111 panic(err) 2112 } 2113 return fpaiv 2114 } 2115 2116 type DeviceSpec_FieldTerminalPathArrayItemValue struct { 2117 DeviceSpec_FieldTerminalPath 2118 value interface{} 2119 } 2120 2121 var _ DeviceSpec_FieldPathArrayItemValue = (*DeviceSpec_FieldTerminalPathArrayItemValue)(nil) 2122 2123 // GetRawValue returns stored element value for array in object Device_Spec as interface{} 2124 func (fpaiv *DeviceSpec_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 2125 return fpaiv.value 2126 } 2127 func (fpaiv *DeviceSpec_FieldTerminalPathArrayItemValue) AsHealthChecksItemValue() (*api.HealthCheckSpec, bool) { 2128 res, ok := fpaiv.value.(*api.HealthCheckSpec) 2129 return res, ok 2130 } 2131 2132 func (fpaiv *DeviceSpec_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec) (interface{}, bool) { 2133 return nil, false 2134 } 2135 2136 func (fpaiv *DeviceSpec_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 2137 return fpaiv.GetSingle(source.(*Device_Spec)) 2138 } 2139 2140 // Contains returns a boolean indicating if value that is being held is present in given 'Spec' 2141 func (fpaiv *DeviceSpec_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec) bool { 2142 slice := fpaiv.DeviceSpec_FieldTerminalPath.Get(source) 2143 for _, v := range slice { 2144 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 2145 if proto.Equal(asProtoMsg, v.(proto.Message)) { 2146 return true 2147 } 2148 } else if reflect.DeepEqual(v, fpaiv.value) { 2149 return true 2150 } 2151 } 2152 return false 2153 } 2154 2155 type DeviceSpec_FieldSubPathArrayItemValue struct { 2156 DeviceSpec_FieldPath 2157 subPathItemValue gotenobject.FieldPathArrayItemValue 2158 } 2159 2160 // GetRawValue returns stored array item value 2161 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 2162 return fpaivs.subPathItemValue.GetRawItemValue() 2163 } 2164 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) AsSshConfigPathItemValue() (DeviceSpecSSHConfig_FieldPathArrayItemValue, bool) { 2165 res, ok := fpaivs.subPathItemValue.(DeviceSpecSSHConfig_FieldPathArrayItemValue) 2166 return res, ok 2167 } 2168 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) AsAttestationConfigPathItemValue() (DeviceSpecAttestationConfig_FieldPathArrayItemValue, bool) { 2169 res, ok := fpaivs.subPathItemValue.(DeviceSpecAttestationConfig_FieldPathArrayItemValue) 2170 return res, ok 2171 } 2172 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) AsLoggingConfigPathItemValue() (DeviceSpecLoggingConfig_FieldPathArrayItemValue, bool) { 2173 res, ok := fpaivs.subPathItemValue.(DeviceSpecLoggingConfig_FieldPathArrayItemValue) 2174 return res, ok 2175 } 2176 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) AsProxyConfigPathItemValue() (DeviceSpecProxyConfig_FieldPathArrayItemValue, bool) { 2177 res, ok := fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue) 2178 return res, ok 2179 } 2180 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) AsLocationPathItemValue() (DeviceSpecLocation_FieldPathArrayItemValue, bool) { 2181 res, ok := fpaivs.subPathItemValue.(DeviceSpecLocation_FieldPathArrayItemValue) 2182 return res, ok 2183 } 2184 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) AsUsbGuardPathItemValue() (DeviceSpecUSBGuard_FieldPathArrayItemValue, bool) { 2185 res, ok := fpaivs.subPathItemValue.(DeviceSpecUSBGuard_FieldPathArrayItemValue) 2186 return res, ok 2187 } 2188 2189 // Contains returns a boolean indicating if value that is being held is present in given 'Spec' 2190 func (fpaivs *DeviceSpec_FieldSubPathArrayItemValue) ContainsValue(source *Device_Spec) bool { 2191 switch fpaivs.Selector() { 2192 case DeviceSpec_FieldPathSelectorSshConfig: 2193 return fpaivs.subPathItemValue.(DeviceSpecSSHConfig_FieldPathArrayItemValue).ContainsValue(source.GetSshConfig()) 2194 case DeviceSpec_FieldPathSelectorAttestationConfig: 2195 return fpaivs.subPathItemValue.(DeviceSpecAttestationConfig_FieldPathArrayItemValue).ContainsValue(source.GetAttestationConfig()) 2196 case DeviceSpec_FieldPathSelectorLoggingConfig: 2197 return fpaivs.subPathItemValue.(DeviceSpecLoggingConfig_FieldPathArrayItemValue).ContainsValue(source.GetLoggingConfig()) 2198 case DeviceSpec_FieldPathSelectorProxyConfig: 2199 return fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue).ContainsValue(source.GetProxyConfig()) 2200 case DeviceSpec_FieldPathSelectorLocation: 2201 return fpaivs.subPathItemValue.(DeviceSpecLocation_FieldPathArrayItemValue).ContainsValue(source.GetLocation()) 2202 case DeviceSpec_FieldPathSelectorUsbGuard: 2203 return fpaivs.subPathItemValue.(DeviceSpecUSBGuard_FieldPathArrayItemValue).ContainsValue(source.GetUsbGuard()) 2204 default: 2205 panic(fmt.Sprintf("Invalid selector for Device_Spec: %d", fpaivs.Selector())) 2206 } 2207 } 2208 2209 // DeviceSpec_FieldPathArrayOfValues allows storing slice of values for Spec fields according to their type 2210 type DeviceSpec_FieldPathArrayOfValues interface { 2211 gotenobject.FieldPathArrayOfValues 2212 DeviceSpec_FieldPath 2213 } 2214 2215 func ParseDeviceSpec_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpec_FieldPathArrayOfValues, error) { 2216 fp, err := ParseDeviceSpec_FieldPath(pathStr) 2217 if err != nil { 2218 return nil, err 2219 } 2220 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 2221 if err != nil { 2222 return nil, status.Errorf(codes.InvalidArgument, "error parsing Spec field path array of values from %s: %v", valuesStr, err) 2223 } 2224 return fpaov.(DeviceSpec_FieldPathArrayOfValues), nil 2225 } 2226 2227 func MustParseDeviceSpec_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpec_FieldPathArrayOfValues { 2228 fpaov, err := ParseDeviceSpec_FieldPathArrayOfValues(pathStr, valuesStr) 2229 if err != nil { 2230 panic(err) 2231 } 2232 return fpaov 2233 } 2234 2235 type DeviceSpec_FieldTerminalPathArrayOfValues struct { 2236 DeviceSpec_FieldTerminalPath 2237 values interface{} 2238 } 2239 2240 var _ DeviceSpec_FieldPathArrayOfValues = (*DeviceSpec_FieldTerminalPathArrayOfValues)(nil) 2241 2242 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 2243 switch fpaov.selector { 2244 case DeviceSpec_FieldPathSelectorServiceAccount: 2245 for _, v := range fpaov.values.([]*iam_service_account.Reference) { 2246 values = append(values, v) 2247 } 2248 case DeviceSpec_FieldPathSelectorLogBucket: 2249 for _, v := range fpaov.values.([]*logging_bucket.Reference) { 2250 values = append(values, v) 2251 } 2252 case DeviceSpec_FieldPathSelectorMetricsBucket: 2253 for _, v := range fpaov.values.([]*monitoring_bucket.Reference) { 2254 values = append(values, v) 2255 } 2256 case DeviceSpec_FieldPathSelectorOsVersion: 2257 for _, v := range fpaov.values.([]string) { 2258 values = append(values, v) 2259 } 2260 case DeviceSpec_FieldPathSelectorNetplanYamlConfig: 2261 for _, v := range fpaov.values.([]string) { 2262 values = append(values, v) 2263 } 2264 case DeviceSpec_FieldPathSelectorNetplanApiConfigMode: 2265 for _, v := range fpaov.values.([]Device_Spec_NetworkConfigMode) { 2266 values = append(values, v) 2267 } 2268 case DeviceSpec_FieldPathSelectorOsImageUrl: 2269 for _, v := range fpaov.values.([]string) { 2270 values = append(values, v) 2271 } 2272 case DeviceSpec_FieldPathSelectorSshConfig: 2273 for _, v := range fpaov.values.([]*Device_Spec_SSHConfig) { 2274 values = append(values, v) 2275 } 2276 case DeviceSpec_FieldPathSelectorAttestationConfig: 2277 for _, v := range fpaov.values.([]*Device_Spec_AttestationConfig) { 2278 values = append(values, v) 2279 } 2280 case DeviceSpec_FieldPathSelectorDisableDeviceDiscovery: 2281 for _, v := range fpaov.values.([]bool) { 2282 values = append(values, v) 2283 } 2284 case DeviceSpec_FieldPathSelectorLoggingConfig: 2285 for _, v := range fpaov.values.([]*Device_Spec_LoggingConfig) { 2286 values = append(values, v) 2287 } 2288 case DeviceSpec_FieldPathSelectorProxyConfig: 2289 for _, v := range fpaov.values.([]*Device_Spec_ProxyConfig) { 2290 values = append(values, v) 2291 } 2292 case DeviceSpec_FieldPathSelectorLocation: 2293 for _, v := range fpaov.values.([]*Device_Spec_Location) { 2294 values = append(values, v) 2295 } 2296 case DeviceSpec_FieldPathSelectorUsbGuard: 2297 for _, v := range fpaov.values.([]*Device_Spec_USBGuard) { 2298 values = append(values, v) 2299 } 2300 case DeviceSpec_FieldPathSelectorHealthChecks: 2301 for _, v := range fpaov.values.([][]*api.HealthCheckSpec) { 2302 values = append(values, v) 2303 } 2304 case DeviceSpec_FieldPathSelectorDisableNetworkConfigFallback: 2305 for _, v := range fpaov.values.([]bool) { 2306 values = append(values, v) 2307 } 2308 } 2309 return 2310 } 2311 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsServiceAccountArrayOfValues() ([]*iam_service_account.Reference, bool) { 2312 res, ok := fpaov.values.([]*iam_service_account.Reference) 2313 return res, ok 2314 } 2315 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsLogBucketArrayOfValues() ([]*logging_bucket.Reference, bool) { 2316 res, ok := fpaov.values.([]*logging_bucket.Reference) 2317 return res, ok 2318 } 2319 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsMetricsBucketArrayOfValues() ([]*monitoring_bucket.Reference, bool) { 2320 res, ok := fpaov.values.([]*monitoring_bucket.Reference) 2321 return res, ok 2322 } 2323 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsOsVersionArrayOfValues() ([]string, bool) { 2324 res, ok := fpaov.values.([]string) 2325 return res, ok 2326 } 2327 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsNetplanYamlConfigArrayOfValues() ([]string, bool) { 2328 res, ok := fpaov.values.([]string) 2329 return res, ok 2330 } 2331 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsNetplanApiConfigModeArrayOfValues() ([]Device_Spec_NetworkConfigMode, bool) { 2332 res, ok := fpaov.values.([]Device_Spec_NetworkConfigMode) 2333 return res, ok 2334 } 2335 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsOsImageUrlArrayOfValues() ([]string, bool) { 2336 res, ok := fpaov.values.([]string) 2337 return res, ok 2338 } 2339 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsSshConfigArrayOfValues() ([]*Device_Spec_SSHConfig, bool) { 2340 res, ok := fpaov.values.([]*Device_Spec_SSHConfig) 2341 return res, ok 2342 } 2343 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsAttestationConfigArrayOfValues() ([]*Device_Spec_AttestationConfig, bool) { 2344 res, ok := fpaov.values.([]*Device_Spec_AttestationConfig) 2345 return res, ok 2346 } 2347 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsDisableDeviceDiscoveryArrayOfValues() ([]bool, bool) { 2348 res, ok := fpaov.values.([]bool) 2349 return res, ok 2350 } 2351 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsLoggingConfigArrayOfValues() ([]*Device_Spec_LoggingConfig, bool) { 2352 res, ok := fpaov.values.([]*Device_Spec_LoggingConfig) 2353 return res, ok 2354 } 2355 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsProxyConfigArrayOfValues() ([]*Device_Spec_ProxyConfig, bool) { 2356 res, ok := fpaov.values.([]*Device_Spec_ProxyConfig) 2357 return res, ok 2358 } 2359 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsLocationArrayOfValues() ([]*Device_Spec_Location, bool) { 2360 res, ok := fpaov.values.([]*Device_Spec_Location) 2361 return res, ok 2362 } 2363 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsUsbGuardArrayOfValues() ([]*Device_Spec_USBGuard, bool) { 2364 res, ok := fpaov.values.([]*Device_Spec_USBGuard) 2365 return res, ok 2366 } 2367 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsHealthChecksArrayOfValues() ([][]*api.HealthCheckSpec, bool) { 2368 res, ok := fpaov.values.([][]*api.HealthCheckSpec) 2369 return res, ok 2370 } 2371 func (fpaov *DeviceSpec_FieldTerminalPathArrayOfValues) AsDisableNetworkConfigFallbackArrayOfValues() ([]bool, bool) { 2372 res, ok := fpaov.values.([]bool) 2373 return res, ok 2374 } 2375 2376 type DeviceSpec_FieldSubPathArrayOfValues struct { 2377 DeviceSpec_FieldPath 2378 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 2379 } 2380 2381 var _ DeviceSpec_FieldPathArrayOfValues = (*DeviceSpec_FieldSubPathArrayOfValues)(nil) 2382 2383 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 2384 return fpsaov.subPathArrayOfValues.GetRawValues() 2385 } 2386 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) AsSshConfigPathArrayOfValues() (DeviceSpecSSHConfig_FieldPathArrayOfValues, bool) { 2387 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecSSHConfig_FieldPathArrayOfValues) 2388 return res, ok 2389 } 2390 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) AsAttestationConfigPathArrayOfValues() (DeviceSpecAttestationConfig_FieldPathArrayOfValues, bool) { 2391 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecAttestationConfig_FieldPathArrayOfValues) 2392 return res, ok 2393 } 2394 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) AsLoggingConfigPathArrayOfValues() (DeviceSpecLoggingConfig_FieldPathArrayOfValues, bool) { 2395 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecLoggingConfig_FieldPathArrayOfValues) 2396 return res, ok 2397 } 2398 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) AsProxyConfigPathArrayOfValues() (DeviceSpecProxyConfig_FieldPathArrayOfValues, bool) { 2399 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecProxyConfig_FieldPathArrayOfValues) 2400 return res, ok 2401 } 2402 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) AsLocationPathArrayOfValues() (DeviceSpecLocation_FieldPathArrayOfValues, bool) { 2403 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecLocation_FieldPathArrayOfValues) 2404 return res, ok 2405 } 2406 func (fpsaov *DeviceSpec_FieldSubPathArrayOfValues) AsUsbGuardPathArrayOfValues() (DeviceSpecUSBGuard_FieldPathArrayOfValues, bool) { 2407 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecUSBGuard_FieldPathArrayOfValues) 2408 return res, ok 2409 } 2410 2411 // FieldPath provides implementation to handle 2412 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 2413 type DeviceStatus_FieldPath interface { 2414 gotenobject.FieldPath 2415 Selector() DeviceStatus_FieldPathSelector 2416 Get(source *Device_Status) []interface{} 2417 GetSingle(source *Device_Status) (interface{}, bool) 2418 ClearValue(item *Device_Status) 2419 2420 // Those methods build corresponding DeviceStatus_FieldPathValue 2421 // (or array of values) and holds passed value. Panics if injected type is incorrect. 2422 WithIValue(value interface{}) DeviceStatus_FieldPathValue 2423 WithIArrayOfValues(values interface{}) DeviceStatus_FieldPathArrayOfValues 2424 WithIArrayItemValue(value interface{}) DeviceStatus_FieldPathArrayItemValue 2425 } 2426 2427 type DeviceStatus_FieldPathSelector int32 2428 2429 const ( 2430 DeviceStatus_FieldPathSelectorAddresses DeviceStatus_FieldPathSelector = 0 2431 DeviceStatus_FieldPathSelectorConditions DeviceStatus_FieldPathSelector = 1 2432 DeviceStatus_FieldPathSelectorNetworkConfigState DeviceStatus_FieldPathSelector = 2 2433 DeviceStatus_FieldPathSelectorProxyConfigStatus DeviceStatus_FieldPathSelector = 3 2434 DeviceStatus_FieldPathSelectorDeviceInfo DeviceStatus_FieldPathSelector = 4 2435 DeviceStatus_FieldPathSelectorAttestationStatus DeviceStatus_FieldPathSelector = 5 2436 DeviceStatus_FieldPathSelectorNormalizedAddress DeviceStatus_FieldPathSelector = 6 2437 DeviceStatus_FieldPathSelectorConnectionStatus DeviceStatus_FieldPathSelector = 7 2438 DeviceStatus_FieldPathSelectorConnectionStatusChangeTime DeviceStatus_FieldPathSelector = 8 2439 ) 2440 2441 func (s DeviceStatus_FieldPathSelector) String() string { 2442 switch s { 2443 case DeviceStatus_FieldPathSelectorAddresses: 2444 return "addresses" 2445 case DeviceStatus_FieldPathSelectorConditions: 2446 return "conditions" 2447 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2448 return "network_config_state" 2449 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2450 return "proxy_config_status" 2451 case DeviceStatus_FieldPathSelectorDeviceInfo: 2452 return "device_info" 2453 case DeviceStatus_FieldPathSelectorAttestationStatus: 2454 return "attestation_status" 2455 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2456 return "normalized_address" 2457 case DeviceStatus_FieldPathSelectorConnectionStatus: 2458 return "connection_status" 2459 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2460 return "connection_status_change_time" 2461 default: 2462 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", s)) 2463 } 2464 } 2465 2466 func BuildDeviceStatus_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatus_FieldPath, error) { 2467 if len(fp) == 0 { 2468 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status") 2469 } 2470 if len(fp) == 1 { 2471 switch fp[0] { 2472 case "addresses": 2473 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorAddresses}, nil 2474 case "conditions": 2475 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorConditions}, nil 2476 case "network_config_state", "networkConfigState", "network-config-state": 2477 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorNetworkConfigState}, nil 2478 case "proxy_config_status", "proxyConfigStatus", "proxy-config-status": 2479 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorProxyConfigStatus}, nil 2480 case "device_info", "deviceInfo", "device-info": 2481 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorDeviceInfo}, nil 2482 case "attestation_status", "attestationStatus", "attestation-status": 2483 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorAttestationStatus}, nil 2484 case "normalized_address", "normalizedAddress", "normalized-address": 2485 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorNormalizedAddress}, nil 2486 case "connection_status", "connectionStatus", "connection-status": 2487 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorConnectionStatus}, nil 2488 case "connection_status_change_time", "connectionStatusChangeTime", "connection-status-change-time": 2489 return &DeviceStatus_FieldTerminalPath{selector: DeviceStatus_FieldPathSelectorConnectionStatusChangeTime}, nil 2490 } 2491 } else { 2492 switch fp[0] { 2493 case "addresses": 2494 if subpath, err := BuildDeviceStatusAddress_FieldPath(fp[1:]); err != nil { 2495 return nil, err 2496 } else { 2497 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorAddresses, subPath: subpath}, nil 2498 } 2499 case "conditions": 2500 if subpath, err := BuildDeviceStatusCondition_FieldPath(fp[1:]); err != nil { 2501 return nil, err 2502 } else { 2503 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorConditions, subPath: subpath}, nil 2504 } 2505 case "network_config_state", "networkConfigState", "network-config-state": 2506 if subpath, err := BuildDeviceStatusNetworkConfigState_FieldPath(fp[1:]); err != nil { 2507 return nil, err 2508 } else { 2509 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorNetworkConfigState, subPath: subpath}, nil 2510 } 2511 case "proxy_config_status", "proxyConfigStatus", "proxy-config-status": 2512 if subpath, err := BuildDeviceStatusProxyConfigStatus_FieldPath(fp[1:]); err != nil { 2513 return nil, err 2514 } else { 2515 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorProxyConfigStatus, subPath: subpath}, nil 2516 } 2517 case "device_info", "deviceInfo", "device-info": 2518 if subpath, err := BuildDeviceStatusDeviceInfo_FieldPath(fp[1:]); err != nil { 2519 return nil, err 2520 } else { 2521 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorDeviceInfo, subPath: subpath}, nil 2522 } 2523 case "attestation_status", "attestationStatus", "attestation-status": 2524 if subpath, err := iam_iam_common.BuildPCR_FieldPath(fp[1:]); err != nil { 2525 return nil, err 2526 } else { 2527 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorAttestationStatus, subPath: subpath}, nil 2528 } 2529 case "normalized_address", "normalizedAddress", "normalized-address": 2530 if subpath, err := BuildDeviceStatusNormalizedAddress_FieldPath(fp[1:]); err != nil { 2531 return nil, err 2532 } else { 2533 return &DeviceStatus_FieldSubPath{selector: DeviceStatus_FieldPathSelectorNormalizedAddress, subPath: subpath}, nil 2534 } 2535 } 2536 } 2537 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status", fp) 2538 } 2539 2540 func ParseDeviceStatus_FieldPath(rawField string) (DeviceStatus_FieldPath, error) { 2541 fp, err := gotenobject.ParseRawFieldPath(rawField) 2542 if err != nil { 2543 return nil, err 2544 } 2545 return BuildDeviceStatus_FieldPath(fp) 2546 } 2547 2548 func MustParseDeviceStatus_FieldPath(rawField string) DeviceStatus_FieldPath { 2549 fp, err := ParseDeviceStatus_FieldPath(rawField) 2550 if err != nil { 2551 panic(err) 2552 } 2553 return fp 2554 } 2555 2556 type DeviceStatus_FieldTerminalPath struct { 2557 selector DeviceStatus_FieldPathSelector 2558 } 2559 2560 var _ DeviceStatus_FieldPath = (*DeviceStatus_FieldTerminalPath)(nil) 2561 2562 func (fp *DeviceStatus_FieldTerminalPath) Selector() DeviceStatus_FieldPathSelector { 2563 return fp.selector 2564 } 2565 2566 // String returns path representation in proto convention 2567 func (fp *DeviceStatus_FieldTerminalPath) String() string { 2568 return fp.selector.String() 2569 } 2570 2571 // JSONString returns path representation is JSON convention 2572 func (fp *DeviceStatus_FieldTerminalPath) JSONString() string { 2573 return strcase.ToLowerCamel(fp.String()) 2574 } 2575 2576 // Get returns all values pointed by specific field from source Device_Status 2577 func (fp *DeviceStatus_FieldTerminalPath) Get(source *Device_Status) (values []interface{}) { 2578 if source != nil { 2579 switch fp.selector { 2580 case DeviceStatus_FieldPathSelectorAddresses: 2581 for _, value := range source.GetAddresses() { 2582 values = append(values, value) 2583 } 2584 case DeviceStatus_FieldPathSelectorConditions: 2585 for _, value := range source.GetConditions() { 2586 values = append(values, value) 2587 } 2588 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2589 if source.NetworkConfigState != nil { 2590 values = append(values, source.NetworkConfigState) 2591 } 2592 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2593 if source.ProxyConfigStatus != nil { 2594 values = append(values, source.ProxyConfigStatus) 2595 } 2596 case DeviceStatus_FieldPathSelectorDeviceInfo: 2597 if source.DeviceInfo != nil { 2598 values = append(values, source.DeviceInfo) 2599 } 2600 case DeviceStatus_FieldPathSelectorAttestationStatus: 2601 for _, value := range source.GetAttestationStatus() { 2602 values = append(values, value) 2603 } 2604 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2605 if source.NormalizedAddress != nil { 2606 values = append(values, source.NormalizedAddress) 2607 } 2608 case DeviceStatus_FieldPathSelectorConnectionStatus: 2609 values = append(values, source.ConnectionStatus) 2610 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2611 if source.ConnectionStatusChangeTime != nil { 2612 values = append(values, source.ConnectionStatusChangeTime) 2613 } 2614 default: 2615 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2616 } 2617 } 2618 return 2619 } 2620 2621 func (fp *DeviceStatus_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 2622 return fp.Get(source.(*Device_Status)) 2623 } 2624 2625 // GetSingle returns value pointed by specific field of from source Device_Status 2626 func (fp *DeviceStatus_FieldTerminalPath) GetSingle(source *Device_Status) (interface{}, bool) { 2627 switch fp.selector { 2628 case DeviceStatus_FieldPathSelectorAddresses: 2629 res := source.GetAddresses() 2630 return res, res != nil 2631 case DeviceStatus_FieldPathSelectorConditions: 2632 res := source.GetConditions() 2633 return res, res != nil 2634 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2635 res := source.GetNetworkConfigState() 2636 return res, res != nil 2637 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2638 res := source.GetProxyConfigStatus() 2639 return res, res != nil 2640 case DeviceStatus_FieldPathSelectorDeviceInfo: 2641 res := source.GetDeviceInfo() 2642 return res, res != nil 2643 case DeviceStatus_FieldPathSelectorAttestationStatus: 2644 res := source.GetAttestationStatus() 2645 return res, res != nil 2646 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2647 res := source.GetNormalizedAddress() 2648 return res, res != nil 2649 case DeviceStatus_FieldPathSelectorConnectionStatus: 2650 return source.GetConnectionStatus(), source != nil 2651 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2652 res := source.GetConnectionStatusChangeTime() 2653 return res, res != nil 2654 default: 2655 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2656 } 2657 } 2658 2659 func (fp *DeviceStatus_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 2660 return fp.GetSingle(source.(*Device_Status)) 2661 } 2662 2663 // GetDefault returns a default value of the field type 2664 func (fp *DeviceStatus_FieldTerminalPath) GetDefault() interface{} { 2665 switch fp.selector { 2666 case DeviceStatus_FieldPathSelectorAddresses: 2667 return ([]*Device_Status_Address)(nil) 2668 case DeviceStatus_FieldPathSelectorConditions: 2669 return ([]*Device_Status_Condition)(nil) 2670 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2671 return (*Device_Status_NetworkConfigState)(nil) 2672 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2673 return (*Device_Status_ProxyConfigStatus)(nil) 2674 case DeviceStatus_FieldPathSelectorDeviceInfo: 2675 return (*Device_Status_DeviceInfo)(nil) 2676 case DeviceStatus_FieldPathSelectorAttestationStatus: 2677 return ([]*iam_iam_common.PCR)(nil) 2678 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2679 return (*Device_Status_NormalizedAddress)(nil) 2680 case DeviceStatus_FieldPathSelectorConnectionStatus: 2681 return Device_Status_CONNECTION_STATUS_UNSPECIFIED 2682 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2683 return (*timestamppb.Timestamp)(nil) 2684 default: 2685 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2686 } 2687 } 2688 2689 func (fp *DeviceStatus_FieldTerminalPath) ClearValue(item *Device_Status) { 2690 if item != nil { 2691 switch fp.selector { 2692 case DeviceStatus_FieldPathSelectorAddresses: 2693 item.Addresses = nil 2694 case DeviceStatus_FieldPathSelectorConditions: 2695 item.Conditions = nil 2696 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2697 item.NetworkConfigState = nil 2698 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2699 item.ProxyConfigStatus = nil 2700 case DeviceStatus_FieldPathSelectorDeviceInfo: 2701 item.DeviceInfo = nil 2702 case DeviceStatus_FieldPathSelectorAttestationStatus: 2703 item.AttestationStatus = nil 2704 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2705 item.NormalizedAddress = nil 2706 case DeviceStatus_FieldPathSelectorConnectionStatus: 2707 item.ConnectionStatus = Device_Status_CONNECTION_STATUS_UNSPECIFIED 2708 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2709 item.ConnectionStatusChangeTime = nil 2710 default: 2711 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2712 } 2713 } 2714 } 2715 2716 func (fp *DeviceStatus_FieldTerminalPath) ClearValueRaw(item proto.Message) { 2717 fp.ClearValue(item.(*Device_Status)) 2718 } 2719 2720 // IsLeaf - whether field path is holds simple value 2721 func (fp *DeviceStatus_FieldTerminalPath) IsLeaf() bool { 2722 return fp.selector == DeviceStatus_FieldPathSelectorConnectionStatus || 2723 fp.selector == DeviceStatus_FieldPathSelectorConnectionStatusChangeTime 2724 } 2725 2726 func (fp *DeviceStatus_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 2727 return []gotenobject.FieldPath{fp} 2728 } 2729 2730 func (fp *DeviceStatus_FieldTerminalPath) WithIValue(value interface{}) DeviceStatus_FieldPathValue { 2731 switch fp.selector { 2732 case DeviceStatus_FieldPathSelectorAddresses: 2733 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.([]*Device_Status_Address)} 2734 case DeviceStatus_FieldPathSelectorConditions: 2735 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.([]*Device_Status_Condition)} 2736 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2737 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_NetworkConfigState)} 2738 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2739 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_ProxyConfigStatus)} 2740 case DeviceStatus_FieldPathSelectorDeviceInfo: 2741 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo)} 2742 case DeviceStatus_FieldPathSelectorAttestationStatus: 2743 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.([]*iam_iam_common.PCR)} 2744 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2745 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_NormalizedAddress)} 2746 case DeviceStatus_FieldPathSelectorConnectionStatus: 2747 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(Device_Status_ConnectionStatus)} 2748 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2749 return &DeviceStatus_FieldTerminalPathValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 2750 default: 2751 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2752 } 2753 } 2754 2755 func (fp *DeviceStatus_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 2756 return fp.WithIValue(value) 2757 } 2758 2759 func (fp *DeviceStatus_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatus_FieldPathArrayOfValues { 2760 fpaov := &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp} 2761 switch fp.selector { 2762 case DeviceStatus_FieldPathSelectorAddresses: 2763 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([][]*Device_Status_Address)} 2764 case DeviceStatus_FieldPathSelectorConditions: 2765 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([][]*Device_Status_Condition)} 2766 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2767 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([]*Device_Status_NetworkConfigState)} 2768 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2769 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([]*Device_Status_ProxyConfigStatus)} 2770 case DeviceStatus_FieldPathSelectorDeviceInfo: 2771 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo)} 2772 case DeviceStatus_FieldPathSelectorAttestationStatus: 2773 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([][]*iam_iam_common.PCR)} 2774 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2775 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([]*Device_Status_NormalizedAddress)} 2776 case DeviceStatus_FieldPathSelectorConnectionStatus: 2777 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([]Device_Status_ConnectionStatus)} 2778 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 2779 return &DeviceStatus_FieldTerminalPathArrayOfValues{DeviceStatus_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 2780 default: 2781 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2782 } 2783 return fpaov 2784 } 2785 2786 func (fp *DeviceStatus_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 2787 return fp.WithIArrayOfValues(values) 2788 } 2789 2790 func (fp *DeviceStatus_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatus_FieldPathArrayItemValue { 2791 switch fp.selector { 2792 case DeviceStatus_FieldPathSelectorAddresses: 2793 return &DeviceStatus_FieldTerminalPathArrayItemValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_Address)} 2794 case DeviceStatus_FieldPathSelectorConditions: 2795 return &DeviceStatus_FieldTerminalPathArrayItemValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_Condition)} 2796 case DeviceStatus_FieldPathSelectorAttestationStatus: 2797 return &DeviceStatus_FieldTerminalPathArrayItemValue{DeviceStatus_FieldTerminalPath: *fp, value: value.(*iam_iam_common.PCR)} 2798 default: 2799 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fp.selector)) 2800 } 2801 } 2802 2803 func (fp *DeviceStatus_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 2804 return fp.WithIArrayItemValue(value) 2805 } 2806 2807 type DeviceStatus_FieldSubPath struct { 2808 selector DeviceStatus_FieldPathSelector 2809 subPath gotenobject.FieldPath 2810 } 2811 2812 var _ DeviceStatus_FieldPath = (*DeviceStatus_FieldSubPath)(nil) 2813 2814 func (fps *DeviceStatus_FieldSubPath) Selector() DeviceStatus_FieldPathSelector { 2815 return fps.selector 2816 } 2817 func (fps *DeviceStatus_FieldSubPath) AsAddressesSubPath() (DeviceStatusAddress_FieldPath, bool) { 2818 res, ok := fps.subPath.(DeviceStatusAddress_FieldPath) 2819 return res, ok 2820 } 2821 func (fps *DeviceStatus_FieldSubPath) AsConditionsSubPath() (DeviceStatusCondition_FieldPath, bool) { 2822 res, ok := fps.subPath.(DeviceStatusCondition_FieldPath) 2823 return res, ok 2824 } 2825 func (fps *DeviceStatus_FieldSubPath) AsNetworkConfigStateSubPath() (DeviceStatusNetworkConfigState_FieldPath, bool) { 2826 res, ok := fps.subPath.(DeviceStatusNetworkConfigState_FieldPath) 2827 return res, ok 2828 } 2829 func (fps *DeviceStatus_FieldSubPath) AsProxyConfigStatusSubPath() (DeviceStatusProxyConfigStatus_FieldPath, bool) { 2830 res, ok := fps.subPath.(DeviceStatusProxyConfigStatus_FieldPath) 2831 return res, ok 2832 } 2833 func (fps *DeviceStatus_FieldSubPath) AsDeviceInfoSubPath() (DeviceStatusDeviceInfo_FieldPath, bool) { 2834 res, ok := fps.subPath.(DeviceStatusDeviceInfo_FieldPath) 2835 return res, ok 2836 } 2837 func (fps *DeviceStatus_FieldSubPath) AsAttestationStatusSubPath() (iam_iam_common.PCR_FieldPath, bool) { 2838 res, ok := fps.subPath.(iam_iam_common.PCR_FieldPath) 2839 return res, ok 2840 } 2841 func (fps *DeviceStatus_FieldSubPath) AsNormalizedAddressSubPath() (DeviceStatusNormalizedAddress_FieldPath, bool) { 2842 res, ok := fps.subPath.(DeviceStatusNormalizedAddress_FieldPath) 2843 return res, ok 2844 } 2845 2846 // String returns path representation in proto convention 2847 func (fps *DeviceStatus_FieldSubPath) String() string { 2848 return fps.selector.String() + "." + fps.subPath.String() 2849 } 2850 2851 // JSONString returns path representation is JSON convention 2852 func (fps *DeviceStatus_FieldSubPath) JSONString() string { 2853 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 2854 } 2855 2856 // Get returns all values pointed by selected field from source Device_Status 2857 func (fps *DeviceStatus_FieldSubPath) Get(source *Device_Status) (values []interface{}) { 2858 switch fps.selector { 2859 case DeviceStatus_FieldPathSelectorAddresses: 2860 for _, item := range source.GetAddresses() { 2861 values = append(values, fps.subPath.GetRaw(item)...) 2862 } 2863 case DeviceStatus_FieldPathSelectorConditions: 2864 for _, item := range source.GetConditions() { 2865 values = append(values, fps.subPath.GetRaw(item)...) 2866 } 2867 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2868 values = append(values, fps.subPath.GetRaw(source.GetNetworkConfigState())...) 2869 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2870 values = append(values, fps.subPath.GetRaw(source.GetProxyConfigStatus())...) 2871 case DeviceStatus_FieldPathSelectorDeviceInfo: 2872 values = append(values, fps.subPath.GetRaw(source.GetDeviceInfo())...) 2873 case DeviceStatus_FieldPathSelectorAttestationStatus: 2874 for _, item := range source.GetAttestationStatus() { 2875 values = append(values, fps.subPath.GetRaw(item)...) 2876 } 2877 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2878 values = append(values, fps.subPath.GetRaw(source.GetNormalizedAddress())...) 2879 default: 2880 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fps.selector)) 2881 } 2882 return 2883 } 2884 2885 func (fps *DeviceStatus_FieldSubPath) GetRaw(source proto.Message) []interface{} { 2886 return fps.Get(source.(*Device_Status)) 2887 } 2888 2889 // GetSingle returns value of selected field from source Device_Status 2890 func (fps *DeviceStatus_FieldSubPath) GetSingle(source *Device_Status) (interface{}, bool) { 2891 switch fps.selector { 2892 case DeviceStatus_FieldPathSelectorAddresses: 2893 if len(source.GetAddresses()) == 0 { 2894 return nil, false 2895 } 2896 return fps.subPath.GetSingleRaw(source.GetAddresses()[0]) 2897 case DeviceStatus_FieldPathSelectorConditions: 2898 if len(source.GetConditions()) == 0 { 2899 return nil, false 2900 } 2901 return fps.subPath.GetSingleRaw(source.GetConditions()[0]) 2902 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2903 if source.GetNetworkConfigState() == nil { 2904 return nil, false 2905 } 2906 return fps.subPath.GetSingleRaw(source.GetNetworkConfigState()) 2907 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2908 if source.GetProxyConfigStatus() == nil { 2909 return nil, false 2910 } 2911 return fps.subPath.GetSingleRaw(source.GetProxyConfigStatus()) 2912 case DeviceStatus_FieldPathSelectorDeviceInfo: 2913 if source.GetDeviceInfo() == nil { 2914 return nil, false 2915 } 2916 return fps.subPath.GetSingleRaw(source.GetDeviceInfo()) 2917 case DeviceStatus_FieldPathSelectorAttestationStatus: 2918 if len(source.GetAttestationStatus()) == 0 { 2919 return nil, false 2920 } 2921 return fps.subPath.GetSingleRaw(source.GetAttestationStatus()[0]) 2922 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2923 if source.GetNormalizedAddress() == nil { 2924 return nil, false 2925 } 2926 return fps.subPath.GetSingleRaw(source.GetNormalizedAddress()) 2927 default: 2928 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fps.selector)) 2929 } 2930 } 2931 2932 func (fps *DeviceStatus_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 2933 return fps.GetSingle(source.(*Device_Status)) 2934 } 2935 2936 // GetDefault returns a default value of the field type 2937 func (fps *DeviceStatus_FieldSubPath) GetDefault() interface{} { 2938 return fps.subPath.GetDefault() 2939 } 2940 2941 func (fps *DeviceStatus_FieldSubPath) ClearValue(item *Device_Status) { 2942 if item != nil { 2943 switch fps.selector { 2944 case DeviceStatus_FieldPathSelectorAddresses: 2945 for _, subItem := range item.Addresses { 2946 fps.subPath.ClearValueRaw(subItem) 2947 } 2948 case DeviceStatus_FieldPathSelectorConditions: 2949 for _, subItem := range item.Conditions { 2950 fps.subPath.ClearValueRaw(subItem) 2951 } 2952 case DeviceStatus_FieldPathSelectorNetworkConfigState: 2953 fps.subPath.ClearValueRaw(item.NetworkConfigState) 2954 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 2955 fps.subPath.ClearValueRaw(item.ProxyConfigStatus) 2956 case DeviceStatus_FieldPathSelectorDeviceInfo: 2957 fps.subPath.ClearValueRaw(item.DeviceInfo) 2958 case DeviceStatus_FieldPathSelectorAttestationStatus: 2959 for _, subItem := range item.AttestationStatus { 2960 fps.subPath.ClearValueRaw(subItem) 2961 } 2962 case DeviceStatus_FieldPathSelectorNormalizedAddress: 2963 fps.subPath.ClearValueRaw(item.NormalizedAddress) 2964 default: 2965 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fps.selector)) 2966 } 2967 } 2968 } 2969 2970 func (fps *DeviceStatus_FieldSubPath) ClearValueRaw(item proto.Message) { 2971 fps.ClearValue(item.(*Device_Status)) 2972 } 2973 2974 // IsLeaf - whether field path is holds simple value 2975 func (fps *DeviceStatus_FieldSubPath) IsLeaf() bool { 2976 return fps.subPath.IsLeaf() 2977 } 2978 2979 func (fps *DeviceStatus_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 2980 iPaths := []gotenobject.FieldPath{&DeviceStatus_FieldTerminalPath{selector: fps.selector}} 2981 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 2982 return iPaths 2983 } 2984 2985 func (fps *DeviceStatus_FieldSubPath) WithIValue(value interface{}) DeviceStatus_FieldPathValue { 2986 return &DeviceStatus_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 2987 } 2988 2989 func (fps *DeviceStatus_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 2990 return fps.WithIValue(value) 2991 } 2992 2993 func (fps *DeviceStatus_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatus_FieldPathArrayOfValues { 2994 return &DeviceStatus_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 2995 } 2996 2997 func (fps *DeviceStatus_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 2998 return fps.WithIArrayOfValues(values) 2999 } 3000 3001 func (fps *DeviceStatus_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatus_FieldPathArrayItemValue { 3002 return &DeviceStatus_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 3003 } 3004 3005 func (fps *DeviceStatus_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3006 return fps.WithIArrayItemValue(value) 3007 } 3008 3009 // DeviceStatus_FieldPathValue allows storing values for Status fields according to their type 3010 type DeviceStatus_FieldPathValue interface { 3011 DeviceStatus_FieldPath 3012 gotenobject.FieldPathValue 3013 SetTo(target **Device_Status) 3014 CompareWith(*Device_Status) (cmp int, comparable bool) 3015 } 3016 3017 func ParseDeviceStatus_FieldPathValue(pathStr, valueStr string) (DeviceStatus_FieldPathValue, error) { 3018 fp, err := ParseDeviceStatus_FieldPath(pathStr) 3019 if err != nil { 3020 return nil, err 3021 } 3022 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 3023 if err != nil { 3024 return nil, status.Errorf(codes.InvalidArgument, "error parsing Status field path value from %s: %v", valueStr, err) 3025 } 3026 return fpv.(DeviceStatus_FieldPathValue), nil 3027 } 3028 3029 func MustParseDeviceStatus_FieldPathValue(pathStr, valueStr string) DeviceStatus_FieldPathValue { 3030 fpv, err := ParseDeviceStatus_FieldPathValue(pathStr, valueStr) 3031 if err != nil { 3032 panic(err) 3033 } 3034 return fpv 3035 } 3036 3037 type DeviceStatus_FieldTerminalPathValue struct { 3038 DeviceStatus_FieldTerminalPath 3039 value interface{} 3040 } 3041 3042 var _ DeviceStatus_FieldPathValue = (*DeviceStatus_FieldTerminalPathValue)(nil) 3043 3044 // GetRawValue returns raw value stored under selected path for 'Status' as interface{} 3045 func (fpv *DeviceStatus_FieldTerminalPathValue) GetRawValue() interface{} { 3046 return fpv.value 3047 } 3048 func (fpv *DeviceStatus_FieldTerminalPathValue) AsAddressesValue() ([]*Device_Status_Address, bool) { 3049 res, ok := fpv.value.([]*Device_Status_Address) 3050 return res, ok 3051 } 3052 func (fpv *DeviceStatus_FieldTerminalPathValue) AsConditionsValue() ([]*Device_Status_Condition, bool) { 3053 res, ok := fpv.value.([]*Device_Status_Condition) 3054 return res, ok 3055 } 3056 func (fpv *DeviceStatus_FieldTerminalPathValue) AsNetworkConfigStateValue() (*Device_Status_NetworkConfigState, bool) { 3057 res, ok := fpv.value.(*Device_Status_NetworkConfigState) 3058 return res, ok 3059 } 3060 func (fpv *DeviceStatus_FieldTerminalPathValue) AsProxyConfigStatusValue() (*Device_Status_ProxyConfigStatus, bool) { 3061 res, ok := fpv.value.(*Device_Status_ProxyConfigStatus) 3062 return res, ok 3063 } 3064 func (fpv *DeviceStatus_FieldTerminalPathValue) AsDeviceInfoValue() (*Device_Status_DeviceInfo, bool) { 3065 res, ok := fpv.value.(*Device_Status_DeviceInfo) 3066 return res, ok 3067 } 3068 func (fpv *DeviceStatus_FieldTerminalPathValue) AsAttestationStatusValue() ([]*iam_iam_common.PCR, bool) { 3069 res, ok := fpv.value.([]*iam_iam_common.PCR) 3070 return res, ok 3071 } 3072 func (fpv *DeviceStatus_FieldTerminalPathValue) AsNormalizedAddressValue() (*Device_Status_NormalizedAddress, bool) { 3073 res, ok := fpv.value.(*Device_Status_NormalizedAddress) 3074 return res, ok 3075 } 3076 func (fpv *DeviceStatus_FieldTerminalPathValue) AsConnectionStatusValue() (Device_Status_ConnectionStatus, bool) { 3077 res, ok := fpv.value.(Device_Status_ConnectionStatus) 3078 return res, ok 3079 } 3080 func (fpv *DeviceStatus_FieldTerminalPathValue) AsConnectionStatusChangeTimeValue() (*timestamppb.Timestamp, bool) { 3081 res, ok := fpv.value.(*timestamppb.Timestamp) 3082 return res, ok 3083 } 3084 3085 // SetTo stores value for selected field for object Status 3086 func (fpv *DeviceStatus_FieldTerminalPathValue) SetTo(target **Device_Status) { 3087 if *target == nil { 3088 *target = new(Device_Status) 3089 } 3090 switch fpv.selector { 3091 case DeviceStatus_FieldPathSelectorAddresses: 3092 (*target).Addresses = fpv.value.([]*Device_Status_Address) 3093 case DeviceStatus_FieldPathSelectorConditions: 3094 (*target).Conditions = fpv.value.([]*Device_Status_Condition) 3095 case DeviceStatus_FieldPathSelectorNetworkConfigState: 3096 (*target).NetworkConfigState = fpv.value.(*Device_Status_NetworkConfigState) 3097 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 3098 (*target).ProxyConfigStatus = fpv.value.(*Device_Status_ProxyConfigStatus) 3099 case DeviceStatus_FieldPathSelectorDeviceInfo: 3100 (*target).DeviceInfo = fpv.value.(*Device_Status_DeviceInfo) 3101 case DeviceStatus_FieldPathSelectorAttestationStatus: 3102 (*target).AttestationStatus = fpv.value.([]*iam_iam_common.PCR) 3103 case DeviceStatus_FieldPathSelectorNormalizedAddress: 3104 (*target).NormalizedAddress = fpv.value.(*Device_Status_NormalizedAddress) 3105 case DeviceStatus_FieldPathSelectorConnectionStatus: 3106 (*target).ConnectionStatus = fpv.value.(Device_Status_ConnectionStatus) 3107 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 3108 (*target).ConnectionStatusChangeTime = fpv.value.(*timestamppb.Timestamp) 3109 default: 3110 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fpv.selector)) 3111 } 3112 } 3113 3114 func (fpv *DeviceStatus_FieldTerminalPathValue) SetToRaw(target proto.Message) { 3115 typedObject := target.(*Device_Status) 3116 fpv.SetTo(&typedObject) 3117 } 3118 3119 // CompareWith compares value in the 'DeviceStatus_FieldTerminalPathValue' with the value under path in 'Device_Status'. 3120 func (fpv *DeviceStatus_FieldTerminalPathValue) CompareWith(source *Device_Status) (int, bool) { 3121 switch fpv.selector { 3122 case DeviceStatus_FieldPathSelectorAddresses: 3123 return 0, false 3124 case DeviceStatus_FieldPathSelectorConditions: 3125 return 0, false 3126 case DeviceStatus_FieldPathSelectorNetworkConfigState: 3127 return 0, false 3128 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 3129 return 0, false 3130 case DeviceStatus_FieldPathSelectorDeviceInfo: 3131 return 0, false 3132 case DeviceStatus_FieldPathSelectorAttestationStatus: 3133 return 0, false 3134 case DeviceStatus_FieldPathSelectorNormalizedAddress: 3135 return 0, false 3136 case DeviceStatus_FieldPathSelectorConnectionStatus: 3137 leftValue := fpv.value.(Device_Status_ConnectionStatus) 3138 rightValue := source.GetConnectionStatus() 3139 if (leftValue) == (rightValue) { 3140 return 0, true 3141 } else if (leftValue) < (rightValue) { 3142 return -1, true 3143 } else { 3144 return 1, true 3145 } 3146 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 3147 leftValue := fpv.value.(*timestamppb.Timestamp) 3148 rightValue := source.GetConnectionStatusChangeTime() 3149 if leftValue == nil { 3150 if rightValue != nil { 3151 return -1, true 3152 } 3153 return 0, true 3154 } 3155 if rightValue == nil { 3156 return 1, true 3157 } 3158 if leftValue.AsTime().Equal(rightValue.AsTime()) { 3159 return 0, true 3160 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 3161 return -1, true 3162 } else { 3163 return 1, true 3164 } 3165 default: 3166 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fpv.selector)) 3167 } 3168 } 3169 3170 func (fpv *DeviceStatus_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3171 return fpv.CompareWith(source.(*Device_Status)) 3172 } 3173 3174 type DeviceStatus_FieldSubPathValue struct { 3175 DeviceStatus_FieldPath 3176 subPathValue gotenobject.FieldPathValue 3177 } 3178 3179 var _ DeviceStatus_FieldPathValue = (*DeviceStatus_FieldSubPathValue)(nil) 3180 3181 func (fpvs *DeviceStatus_FieldSubPathValue) AsAddressesPathValue() (DeviceStatusAddress_FieldPathValue, bool) { 3182 res, ok := fpvs.subPathValue.(DeviceStatusAddress_FieldPathValue) 3183 return res, ok 3184 } 3185 func (fpvs *DeviceStatus_FieldSubPathValue) AsConditionsPathValue() (DeviceStatusCondition_FieldPathValue, bool) { 3186 res, ok := fpvs.subPathValue.(DeviceStatusCondition_FieldPathValue) 3187 return res, ok 3188 } 3189 func (fpvs *DeviceStatus_FieldSubPathValue) AsNetworkConfigStatePathValue() (DeviceStatusNetworkConfigState_FieldPathValue, bool) { 3190 res, ok := fpvs.subPathValue.(DeviceStatusNetworkConfigState_FieldPathValue) 3191 return res, ok 3192 } 3193 func (fpvs *DeviceStatus_FieldSubPathValue) AsProxyConfigStatusPathValue() (DeviceStatusProxyConfigStatus_FieldPathValue, bool) { 3194 res, ok := fpvs.subPathValue.(DeviceStatusProxyConfigStatus_FieldPathValue) 3195 return res, ok 3196 } 3197 func (fpvs *DeviceStatus_FieldSubPathValue) AsDeviceInfoPathValue() (DeviceStatusDeviceInfo_FieldPathValue, bool) { 3198 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfo_FieldPathValue) 3199 return res, ok 3200 } 3201 func (fpvs *DeviceStatus_FieldSubPathValue) AsAttestationStatusPathValue() (iam_iam_common.PCR_FieldPathValue, bool) { 3202 res, ok := fpvs.subPathValue.(iam_iam_common.PCR_FieldPathValue) 3203 return res, ok 3204 } 3205 func (fpvs *DeviceStatus_FieldSubPathValue) AsNormalizedAddressPathValue() (DeviceStatusNormalizedAddress_FieldPathValue, bool) { 3206 res, ok := fpvs.subPathValue.(DeviceStatusNormalizedAddress_FieldPathValue) 3207 return res, ok 3208 } 3209 3210 func (fpvs *DeviceStatus_FieldSubPathValue) SetTo(target **Device_Status) { 3211 if *target == nil { 3212 *target = new(Device_Status) 3213 } 3214 switch fpvs.Selector() { 3215 case DeviceStatus_FieldPathSelectorAddresses: 3216 panic("FieldPath setter is unsupported for array subpaths") 3217 case DeviceStatus_FieldPathSelectorConditions: 3218 panic("FieldPath setter is unsupported for array subpaths") 3219 case DeviceStatus_FieldPathSelectorNetworkConfigState: 3220 fpvs.subPathValue.(DeviceStatusNetworkConfigState_FieldPathValue).SetTo(&(*target).NetworkConfigState) 3221 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 3222 fpvs.subPathValue.(DeviceStatusProxyConfigStatus_FieldPathValue).SetTo(&(*target).ProxyConfigStatus) 3223 case DeviceStatus_FieldPathSelectorDeviceInfo: 3224 fpvs.subPathValue.(DeviceStatusDeviceInfo_FieldPathValue).SetTo(&(*target).DeviceInfo) 3225 case DeviceStatus_FieldPathSelectorAttestationStatus: 3226 panic("FieldPath setter is unsupported for array subpaths") 3227 case DeviceStatus_FieldPathSelectorNormalizedAddress: 3228 fpvs.subPathValue.(DeviceStatusNormalizedAddress_FieldPathValue).SetTo(&(*target).NormalizedAddress) 3229 default: 3230 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fpvs.Selector())) 3231 } 3232 } 3233 3234 func (fpvs *DeviceStatus_FieldSubPathValue) SetToRaw(target proto.Message) { 3235 typedObject := target.(*Device_Status) 3236 fpvs.SetTo(&typedObject) 3237 } 3238 3239 func (fpvs *DeviceStatus_FieldSubPathValue) GetRawValue() interface{} { 3240 return fpvs.subPathValue.GetRawValue() 3241 } 3242 3243 func (fpvs *DeviceStatus_FieldSubPathValue) CompareWith(source *Device_Status) (int, bool) { 3244 switch fpvs.Selector() { 3245 case DeviceStatus_FieldPathSelectorAddresses: 3246 return 0, false // repeated field 3247 case DeviceStatus_FieldPathSelectorConditions: 3248 return 0, false // repeated field 3249 case DeviceStatus_FieldPathSelectorNetworkConfigState: 3250 return fpvs.subPathValue.(DeviceStatusNetworkConfigState_FieldPathValue).CompareWith(source.GetNetworkConfigState()) 3251 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 3252 return fpvs.subPathValue.(DeviceStatusProxyConfigStatus_FieldPathValue).CompareWith(source.GetProxyConfigStatus()) 3253 case DeviceStatus_FieldPathSelectorDeviceInfo: 3254 return fpvs.subPathValue.(DeviceStatusDeviceInfo_FieldPathValue).CompareWith(source.GetDeviceInfo()) 3255 case DeviceStatus_FieldPathSelectorAttestationStatus: 3256 return 0, false // repeated field 3257 case DeviceStatus_FieldPathSelectorNormalizedAddress: 3258 return fpvs.subPathValue.(DeviceStatusNormalizedAddress_FieldPathValue).CompareWith(source.GetNormalizedAddress()) 3259 default: 3260 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fpvs.Selector())) 3261 } 3262 } 3263 3264 func (fpvs *DeviceStatus_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3265 return fpvs.CompareWith(source.(*Device_Status)) 3266 } 3267 3268 // DeviceStatus_FieldPathArrayItemValue allows storing single item in Path-specific values for Status according to their type 3269 // Present only for array (repeated) types. 3270 type DeviceStatus_FieldPathArrayItemValue interface { 3271 gotenobject.FieldPathArrayItemValue 3272 DeviceStatus_FieldPath 3273 ContainsValue(*Device_Status) bool 3274 } 3275 3276 // ParseDeviceStatus_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 3277 func ParseDeviceStatus_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatus_FieldPathArrayItemValue, error) { 3278 fp, err := ParseDeviceStatus_FieldPath(pathStr) 3279 if err != nil { 3280 return nil, err 3281 } 3282 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 3283 if err != nil { 3284 return nil, status.Errorf(codes.InvalidArgument, "error parsing Status field path array item value from %s: %v", valueStr, err) 3285 } 3286 return fpaiv.(DeviceStatus_FieldPathArrayItemValue), nil 3287 } 3288 3289 func MustParseDeviceStatus_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatus_FieldPathArrayItemValue { 3290 fpaiv, err := ParseDeviceStatus_FieldPathArrayItemValue(pathStr, valueStr) 3291 if err != nil { 3292 panic(err) 3293 } 3294 return fpaiv 3295 } 3296 3297 type DeviceStatus_FieldTerminalPathArrayItemValue struct { 3298 DeviceStatus_FieldTerminalPath 3299 value interface{} 3300 } 3301 3302 var _ DeviceStatus_FieldPathArrayItemValue = (*DeviceStatus_FieldTerminalPathArrayItemValue)(nil) 3303 3304 // GetRawValue returns stored element value for array in object Device_Status as interface{} 3305 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 3306 return fpaiv.value 3307 } 3308 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) AsAddressesItemValue() (*Device_Status_Address, bool) { 3309 res, ok := fpaiv.value.(*Device_Status_Address) 3310 return res, ok 3311 } 3312 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) AsConditionsItemValue() (*Device_Status_Condition, bool) { 3313 res, ok := fpaiv.value.(*Device_Status_Condition) 3314 return res, ok 3315 } 3316 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) AsAttestationStatusItemValue() (*iam_iam_common.PCR, bool) { 3317 res, ok := fpaiv.value.(*iam_iam_common.PCR) 3318 return res, ok 3319 } 3320 3321 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status) (interface{}, bool) { 3322 return nil, false 3323 } 3324 3325 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 3326 return fpaiv.GetSingle(source.(*Device_Status)) 3327 } 3328 3329 // Contains returns a boolean indicating if value that is being held is present in given 'Status' 3330 func (fpaiv *DeviceStatus_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status) bool { 3331 slice := fpaiv.DeviceStatus_FieldTerminalPath.Get(source) 3332 for _, v := range slice { 3333 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 3334 if proto.Equal(asProtoMsg, v.(proto.Message)) { 3335 return true 3336 } 3337 } else if reflect.DeepEqual(v, fpaiv.value) { 3338 return true 3339 } 3340 } 3341 return false 3342 } 3343 3344 type DeviceStatus_FieldSubPathArrayItemValue struct { 3345 DeviceStatus_FieldPath 3346 subPathItemValue gotenobject.FieldPathArrayItemValue 3347 } 3348 3349 // GetRawValue returns stored array item value 3350 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 3351 return fpaivs.subPathItemValue.GetRawItemValue() 3352 } 3353 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsAddressesPathItemValue() (DeviceStatusAddress_FieldPathArrayItemValue, bool) { 3354 res, ok := fpaivs.subPathItemValue.(DeviceStatusAddress_FieldPathArrayItemValue) 3355 return res, ok 3356 } 3357 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsConditionsPathItemValue() (DeviceStatusCondition_FieldPathArrayItemValue, bool) { 3358 res, ok := fpaivs.subPathItemValue.(DeviceStatusCondition_FieldPathArrayItemValue) 3359 return res, ok 3360 } 3361 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsNetworkConfigStatePathItemValue() (DeviceStatusNetworkConfigState_FieldPathArrayItemValue, bool) { 3362 res, ok := fpaivs.subPathItemValue.(DeviceStatusNetworkConfigState_FieldPathArrayItemValue) 3363 return res, ok 3364 } 3365 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsProxyConfigStatusPathItemValue() (DeviceStatusProxyConfigStatus_FieldPathArrayItemValue, bool) { 3366 res, ok := fpaivs.subPathItemValue.(DeviceStatusProxyConfigStatus_FieldPathArrayItemValue) 3367 return res, ok 3368 } 3369 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsDeviceInfoPathItemValue() (DeviceStatusDeviceInfo_FieldPathArrayItemValue, bool) { 3370 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfo_FieldPathArrayItemValue) 3371 return res, ok 3372 } 3373 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsAttestationStatusPathItemValue() (iam_iam_common.PCR_FieldPathArrayItemValue, bool) { 3374 res, ok := fpaivs.subPathItemValue.(iam_iam_common.PCR_FieldPathArrayItemValue) 3375 return res, ok 3376 } 3377 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) AsNormalizedAddressPathItemValue() (DeviceStatusNormalizedAddress_FieldPathArrayItemValue, bool) { 3378 res, ok := fpaivs.subPathItemValue.(DeviceStatusNormalizedAddress_FieldPathArrayItemValue) 3379 return res, ok 3380 } 3381 3382 // Contains returns a boolean indicating if value that is being held is present in given 'Status' 3383 func (fpaivs *DeviceStatus_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status) bool { 3384 switch fpaivs.Selector() { 3385 case DeviceStatus_FieldPathSelectorAddresses: 3386 return false // repeated/map field 3387 case DeviceStatus_FieldPathSelectorConditions: 3388 return false // repeated/map field 3389 case DeviceStatus_FieldPathSelectorNetworkConfigState: 3390 return fpaivs.subPathItemValue.(DeviceStatusNetworkConfigState_FieldPathArrayItemValue).ContainsValue(source.GetNetworkConfigState()) 3391 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 3392 return fpaivs.subPathItemValue.(DeviceStatusProxyConfigStatus_FieldPathArrayItemValue).ContainsValue(source.GetProxyConfigStatus()) 3393 case DeviceStatus_FieldPathSelectorDeviceInfo: 3394 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfo_FieldPathArrayItemValue).ContainsValue(source.GetDeviceInfo()) 3395 case DeviceStatus_FieldPathSelectorAttestationStatus: 3396 return false // repeated/map field 3397 case DeviceStatus_FieldPathSelectorNormalizedAddress: 3398 return fpaivs.subPathItemValue.(DeviceStatusNormalizedAddress_FieldPathArrayItemValue).ContainsValue(source.GetNormalizedAddress()) 3399 default: 3400 panic(fmt.Sprintf("Invalid selector for Device_Status: %d", fpaivs.Selector())) 3401 } 3402 } 3403 3404 // DeviceStatus_FieldPathArrayOfValues allows storing slice of values for Status fields according to their type 3405 type DeviceStatus_FieldPathArrayOfValues interface { 3406 gotenobject.FieldPathArrayOfValues 3407 DeviceStatus_FieldPath 3408 } 3409 3410 func ParseDeviceStatus_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatus_FieldPathArrayOfValues, error) { 3411 fp, err := ParseDeviceStatus_FieldPath(pathStr) 3412 if err != nil { 3413 return nil, err 3414 } 3415 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 3416 if err != nil { 3417 return nil, status.Errorf(codes.InvalidArgument, "error parsing Status field path array of values from %s: %v", valuesStr, err) 3418 } 3419 return fpaov.(DeviceStatus_FieldPathArrayOfValues), nil 3420 } 3421 3422 func MustParseDeviceStatus_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatus_FieldPathArrayOfValues { 3423 fpaov, err := ParseDeviceStatus_FieldPathArrayOfValues(pathStr, valuesStr) 3424 if err != nil { 3425 panic(err) 3426 } 3427 return fpaov 3428 } 3429 3430 type DeviceStatus_FieldTerminalPathArrayOfValues struct { 3431 DeviceStatus_FieldTerminalPath 3432 values interface{} 3433 } 3434 3435 var _ DeviceStatus_FieldPathArrayOfValues = (*DeviceStatus_FieldTerminalPathArrayOfValues)(nil) 3436 3437 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 3438 switch fpaov.selector { 3439 case DeviceStatus_FieldPathSelectorAddresses: 3440 for _, v := range fpaov.values.([][]*Device_Status_Address) { 3441 values = append(values, v) 3442 } 3443 case DeviceStatus_FieldPathSelectorConditions: 3444 for _, v := range fpaov.values.([][]*Device_Status_Condition) { 3445 values = append(values, v) 3446 } 3447 case DeviceStatus_FieldPathSelectorNetworkConfigState: 3448 for _, v := range fpaov.values.([]*Device_Status_NetworkConfigState) { 3449 values = append(values, v) 3450 } 3451 case DeviceStatus_FieldPathSelectorProxyConfigStatus: 3452 for _, v := range fpaov.values.([]*Device_Status_ProxyConfigStatus) { 3453 values = append(values, v) 3454 } 3455 case DeviceStatus_FieldPathSelectorDeviceInfo: 3456 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo) { 3457 values = append(values, v) 3458 } 3459 case DeviceStatus_FieldPathSelectorAttestationStatus: 3460 for _, v := range fpaov.values.([][]*iam_iam_common.PCR) { 3461 values = append(values, v) 3462 } 3463 case DeviceStatus_FieldPathSelectorNormalizedAddress: 3464 for _, v := range fpaov.values.([]*Device_Status_NormalizedAddress) { 3465 values = append(values, v) 3466 } 3467 case DeviceStatus_FieldPathSelectorConnectionStatus: 3468 for _, v := range fpaov.values.([]Device_Status_ConnectionStatus) { 3469 values = append(values, v) 3470 } 3471 case DeviceStatus_FieldPathSelectorConnectionStatusChangeTime: 3472 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 3473 values = append(values, v) 3474 } 3475 } 3476 return 3477 } 3478 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsAddressesArrayOfValues() ([][]*Device_Status_Address, bool) { 3479 res, ok := fpaov.values.([][]*Device_Status_Address) 3480 return res, ok 3481 } 3482 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsConditionsArrayOfValues() ([][]*Device_Status_Condition, bool) { 3483 res, ok := fpaov.values.([][]*Device_Status_Condition) 3484 return res, ok 3485 } 3486 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsNetworkConfigStateArrayOfValues() ([]*Device_Status_NetworkConfigState, bool) { 3487 res, ok := fpaov.values.([]*Device_Status_NetworkConfigState) 3488 return res, ok 3489 } 3490 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsProxyConfigStatusArrayOfValues() ([]*Device_Status_ProxyConfigStatus, bool) { 3491 res, ok := fpaov.values.([]*Device_Status_ProxyConfigStatus) 3492 return res, ok 3493 } 3494 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsDeviceInfoArrayOfValues() ([]*Device_Status_DeviceInfo, bool) { 3495 res, ok := fpaov.values.([]*Device_Status_DeviceInfo) 3496 return res, ok 3497 } 3498 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsAttestationStatusArrayOfValues() ([][]*iam_iam_common.PCR, bool) { 3499 res, ok := fpaov.values.([][]*iam_iam_common.PCR) 3500 return res, ok 3501 } 3502 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsNormalizedAddressArrayOfValues() ([]*Device_Status_NormalizedAddress, bool) { 3503 res, ok := fpaov.values.([]*Device_Status_NormalizedAddress) 3504 return res, ok 3505 } 3506 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsConnectionStatusArrayOfValues() ([]Device_Status_ConnectionStatus, bool) { 3507 res, ok := fpaov.values.([]Device_Status_ConnectionStatus) 3508 return res, ok 3509 } 3510 func (fpaov *DeviceStatus_FieldTerminalPathArrayOfValues) AsConnectionStatusChangeTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 3511 res, ok := fpaov.values.([]*timestamppb.Timestamp) 3512 return res, ok 3513 } 3514 3515 type DeviceStatus_FieldSubPathArrayOfValues struct { 3516 DeviceStatus_FieldPath 3517 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 3518 } 3519 3520 var _ DeviceStatus_FieldPathArrayOfValues = (*DeviceStatus_FieldSubPathArrayOfValues)(nil) 3521 3522 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 3523 return fpsaov.subPathArrayOfValues.GetRawValues() 3524 } 3525 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsAddressesPathArrayOfValues() (DeviceStatusAddress_FieldPathArrayOfValues, bool) { 3526 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusAddress_FieldPathArrayOfValues) 3527 return res, ok 3528 } 3529 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsConditionsPathArrayOfValues() (DeviceStatusCondition_FieldPathArrayOfValues, bool) { 3530 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusCondition_FieldPathArrayOfValues) 3531 return res, ok 3532 } 3533 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsNetworkConfigStatePathArrayOfValues() (DeviceStatusNetworkConfigState_FieldPathArrayOfValues, bool) { 3534 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusNetworkConfigState_FieldPathArrayOfValues) 3535 return res, ok 3536 } 3537 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsProxyConfigStatusPathArrayOfValues() (DeviceStatusProxyConfigStatus_FieldPathArrayOfValues, bool) { 3538 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusProxyConfigStatus_FieldPathArrayOfValues) 3539 return res, ok 3540 } 3541 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsDeviceInfoPathArrayOfValues() (DeviceStatusDeviceInfo_FieldPathArrayOfValues, bool) { 3542 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfo_FieldPathArrayOfValues) 3543 return res, ok 3544 } 3545 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsAttestationStatusPathArrayOfValues() (iam_iam_common.PCR_FieldPathArrayOfValues, bool) { 3546 res, ok := fpsaov.subPathArrayOfValues.(iam_iam_common.PCR_FieldPathArrayOfValues) 3547 return res, ok 3548 } 3549 func (fpsaov *DeviceStatus_FieldSubPathArrayOfValues) AsNormalizedAddressPathArrayOfValues() (DeviceStatusNormalizedAddress_FieldPathArrayOfValues, bool) { 3550 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusNormalizedAddress_FieldPathArrayOfValues) 3551 return res, ok 3552 } 3553 3554 // FieldPath provides implementation to handle 3555 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 3556 type DevicePublicListingSpec_FieldPath interface { 3557 gotenobject.FieldPath 3558 Selector() DevicePublicListingSpec_FieldPathSelector 3559 Get(source *Device_PublicListingSpec) []interface{} 3560 GetSingle(source *Device_PublicListingSpec) (interface{}, bool) 3561 ClearValue(item *Device_PublicListingSpec) 3562 3563 // Those methods build corresponding DevicePublicListingSpec_FieldPathValue 3564 // (or array of values) and holds passed value. Panics if injected type is incorrect. 3565 WithIValue(value interface{}) DevicePublicListingSpec_FieldPathValue 3566 WithIArrayOfValues(values interface{}) DevicePublicListingSpec_FieldPathArrayOfValues 3567 WithIArrayItemValue(value interface{}) DevicePublicListingSpec_FieldPathArrayItemValue 3568 } 3569 3570 type DevicePublicListingSpec_FieldPathSelector int32 3571 3572 const ( 3573 DevicePublicListingSpec_FieldPathSelectorEnabled DevicePublicListingSpec_FieldPathSelector = 0 3574 DevicePublicListingSpec_FieldPathSelectorFieldMask DevicePublicListingSpec_FieldPathSelector = 1 3575 ) 3576 3577 func (s DevicePublicListingSpec_FieldPathSelector) String() string { 3578 switch s { 3579 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3580 return "enabled" 3581 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3582 return "field_mask" 3583 default: 3584 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", s)) 3585 } 3586 } 3587 3588 func BuildDevicePublicListingSpec_FieldPath(fp gotenobject.RawFieldPath) (DevicePublicListingSpec_FieldPath, error) { 3589 if len(fp) == 0 { 3590 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_PublicListingSpec") 3591 } 3592 if len(fp) == 1 { 3593 switch fp[0] { 3594 case "enabled": 3595 return &DevicePublicListingSpec_FieldTerminalPath{selector: DevicePublicListingSpec_FieldPathSelectorEnabled}, nil 3596 case "field_mask", "fieldMask", "field-mask": 3597 return &DevicePublicListingSpec_FieldTerminalPath{selector: DevicePublicListingSpec_FieldPathSelectorFieldMask}, nil 3598 } 3599 } 3600 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_PublicListingSpec", fp) 3601 } 3602 3603 func ParseDevicePublicListingSpec_FieldPath(rawField string) (DevicePublicListingSpec_FieldPath, error) { 3604 fp, err := gotenobject.ParseRawFieldPath(rawField) 3605 if err != nil { 3606 return nil, err 3607 } 3608 return BuildDevicePublicListingSpec_FieldPath(fp) 3609 } 3610 3611 func MustParseDevicePublicListingSpec_FieldPath(rawField string) DevicePublicListingSpec_FieldPath { 3612 fp, err := ParseDevicePublicListingSpec_FieldPath(rawField) 3613 if err != nil { 3614 panic(err) 3615 } 3616 return fp 3617 } 3618 3619 type DevicePublicListingSpec_FieldTerminalPath struct { 3620 selector DevicePublicListingSpec_FieldPathSelector 3621 } 3622 3623 var _ DevicePublicListingSpec_FieldPath = (*DevicePublicListingSpec_FieldTerminalPath)(nil) 3624 3625 func (fp *DevicePublicListingSpec_FieldTerminalPath) Selector() DevicePublicListingSpec_FieldPathSelector { 3626 return fp.selector 3627 } 3628 3629 // String returns path representation in proto convention 3630 func (fp *DevicePublicListingSpec_FieldTerminalPath) String() string { 3631 return fp.selector.String() 3632 } 3633 3634 // JSONString returns path representation is JSON convention 3635 func (fp *DevicePublicListingSpec_FieldTerminalPath) JSONString() string { 3636 return strcase.ToLowerCamel(fp.String()) 3637 } 3638 3639 // Get returns all values pointed by specific field from source Device_PublicListingSpec 3640 func (fp *DevicePublicListingSpec_FieldTerminalPath) Get(source *Device_PublicListingSpec) (values []interface{}) { 3641 if source != nil { 3642 switch fp.selector { 3643 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3644 values = append(values, source.Enabled) 3645 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3646 if source.FieldMask != nil { 3647 values = append(values, source.FieldMask) 3648 } 3649 default: 3650 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3651 } 3652 } 3653 return 3654 } 3655 3656 func (fp *DevicePublicListingSpec_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 3657 return fp.Get(source.(*Device_PublicListingSpec)) 3658 } 3659 3660 // GetSingle returns value pointed by specific field of from source Device_PublicListingSpec 3661 func (fp *DevicePublicListingSpec_FieldTerminalPath) GetSingle(source *Device_PublicListingSpec) (interface{}, bool) { 3662 switch fp.selector { 3663 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3664 return source.GetEnabled(), source != nil 3665 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3666 res := source.GetFieldMask() 3667 return res, res != nil 3668 default: 3669 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3670 } 3671 } 3672 3673 func (fp *DevicePublicListingSpec_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3674 return fp.GetSingle(source.(*Device_PublicListingSpec)) 3675 } 3676 3677 // GetDefault returns a default value of the field type 3678 func (fp *DevicePublicListingSpec_FieldTerminalPath) GetDefault() interface{} { 3679 switch fp.selector { 3680 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3681 return false 3682 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3683 return (*Device_FieldMask)(nil) 3684 default: 3685 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3686 } 3687 } 3688 3689 func (fp *DevicePublicListingSpec_FieldTerminalPath) ClearValue(item *Device_PublicListingSpec) { 3690 if item != nil { 3691 switch fp.selector { 3692 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3693 item.Enabled = false 3694 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3695 item.FieldMask = nil 3696 default: 3697 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3698 } 3699 } 3700 } 3701 3702 func (fp *DevicePublicListingSpec_FieldTerminalPath) ClearValueRaw(item proto.Message) { 3703 fp.ClearValue(item.(*Device_PublicListingSpec)) 3704 } 3705 3706 // IsLeaf - whether field path is holds simple value 3707 func (fp *DevicePublicListingSpec_FieldTerminalPath) IsLeaf() bool { 3708 return fp.selector == DevicePublicListingSpec_FieldPathSelectorEnabled || 3709 fp.selector == DevicePublicListingSpec_FieldPathSelectorFieldMask 3710 } 3711 3712 func (fp *DevicePublicListingSpec_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3713 return []gotenobject.FieldPath{fp} 3714 } 3715 3716 func (fp *DevicePublicListingSpec_FieldTerminalPath) WithIValue(value interface{}) DevicePublicListingSpec_FieldPathValue { 3717 switch fp.selector { 3718 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3719 return &DevicePublicListingSpec_FieldTerminalPathValue{DevicePublicListingSpec_FieldTerminalPath: *fp, value: value.(bool)} 3720 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3721 return &DevicePublicListingSpec_FieldTerminalPathValue{DevicePublicListingSpec_FieldTerminalPath: *fp, value: value.(*Device_FieldMask)} 3722 default: 3723 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3724 } 3725 } 3726 3727 func (fp *DevicePublicListingSpec_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3728 return fp.WithIValue(value) 3729 } 3730 3731 func (fp *DevicePublicListingSpec_FieldTerminalPath) WithIArrayOfValues(values interface{}) DevicePublicListingSpec_FieldPathArrayOfValues { 3732 fpaov := &DevicePublicListingSpec_FieldTerminalPathArrayOfValues{DevicePublicListingSpec_FieldTerminalPath: *fp} 3733 switch fp.selector { 3734 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3735 return &DevicePublicListingSpec_FieldTerminalPathArrayOfValues{DevicePublicListingSpec_FieldTerminalPath: *fp, values: values.([]bool)} 3736 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3737 return &DevicePublicListingSpec_FieldTerminalPathArrayOfValues{DevicePublicListingSpec_FieldTerminalPath: *fp, values: values.([]*Device_FieldMask)} 3738 default: 3739 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3740 } 3741 return fpaov 3742 } 3743 3744 func (fp *DevicePublicListingSpec_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3745 return fp.WithIArrayOfValues(values) 3746 } 3747 3748 func (fp *DevicePublicListingSpec_FieldTerminalPath) WithIArrayItemValue(value interface{}) DevicePublicListingSpec_FieldPathArrayItemValue { 3749 switch fp.selector { 3750 default: 3751 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fp.selector)) 3752 } 3753 } 3754 3755 func (fp *DevicePublicListingSpec_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3756 return fp.WithIArrayItemValue(value) 3757 } 3758 3759 // DevicePublicListingSpec_FieldPathValue allows storing values for PublicListingSpec fields according to their type 3760 type DevicePublicListingSpec_FieldPathValue interface { 3761 DevicePublicListingSpec_FieldPath 3762 gotenobject.FieldPathValue 3763 SetTo(target **Device_PublicListingSpec) 3764 CompareWith(*Device_PublicListingSpec) (cmp int, comparable bool) 3765 } 3766 3767 func ParseDevicePublicListingSpec_FieldPathValue(pathStr, valueStr string) (DevicePublicListingSpec_FieldPathValue, error) { 3768 fp, err := ParseDevicePublicListingSpec_FieldPath(pathStr) 3769 if err != nil { 3770 return nil, err 3771 } 3772 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 3773 if err != nil { 3774 return nil, status.Errorf(codes.InvalidArgument, "error parsing PublicListingSpec field path value from %s: %v", valueStr, err) 3775 } 3776 return fpv.(DevicePublicListingSpec_FieldPathValue), nil 3777 } 3778 3779 func MustParseDevicePublicListingSpec_FieldPathValue(pathStr, valueStr string) DevicePublicListingSpec_FieldPathValue { 3780 fpv, err := ParseDevicePublicListingSpec_FieldPathValue(pathStr, valueStr) 3781 if err != nil { 3782 panic(err) 3783 } 3784 return fpv 3785 } 3786 3787 type DevicePublicListingSpec_FieldTerminalPathValue struct { 3788 DevicePublicListingSpec_FieldTerminalPath 3789 value interface{} 3790 } 3791 3792 var _ DevicePublicListingSpec_FieldPathValue = (*DevicePublicListingSpec_FieldTerminalPathValue)(nil) 3793 3794 // GetRawValue returns raw value stored under selected path for 'PublicListingSpec' as interface{} 3795 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) GetRawValue() interface{} { 3796 return fpv.value 3797 } 3798 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) AsEnabledValue() (bool, bool) { 3799 res, ok := fpv.value.(bool) 3800 return res, ok 3801 } 3802 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) AsFieldMaskValue() (*Device_FieldMask, bool) { 3803 res, ok := fpv.value.(*Device_FieldMask) 3804 return res, ok 3805 } 3806 3807 // SetTo stores value for selected field for object PublicListingSpec 3808 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) SetTo(target **Device_PublicListingSpec) { 3809 if *target == nil { 3810 *target = new(Device_PublicListingSpec) 3811 } 3812 switch fpv.selector { 3813 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3814 (*target).Enabled = fpv.value.(bool) 3815 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3816 (*target).FieldMask = fpv.value.(*Device_FieldMask) 3817 default: 3818 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fpv.selector)) 3819 } 3820 } 3821 3822 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) SetToRaw(target proto.Message) { 3823 typedObject := target.(*Device_PublicListingSpec) 3824 fpv.SetTo(&typedObject) 3825 } 3826 3827 // CompareWith compares value in the 'DevicePublicListingSpec_FieldTerminalPathValue' with the value under path in 'Device_PublicListingSpec'. 3828 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) CompareWith(source *Device_PublicListingSpec) (int, bool) { 3829 switch fpv.selector { 3830 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3831 leftValue := fpv.value.(bool) 3832 rightValue := source.GetEnabled() 3833 if (leftValue) == (rightValue) { 3834 return 0, true 3835 } else if !(leftValue) && (rightValue) { 3836 return -1, true 3837 } else { 3838 return 1, true 3839 } 3840 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3841 return 0, false 3842 default: 3843 panic(fmt.Sprintf("Invalid selector for Device_PublicListingSpec: %d", fpv.selector)) 3844 } 3845 } 3846 3847 func (fpv *DevicePublicListingSpec_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3848 return fpv.CompareWith(source.(*Device_PublicListingSpec)) 3849 } 3850 3851 // DevicePublicListingSpec_FieldPathArrayItemValue allows storing single item in Path-specific values for PublicListingSpec according to their type 3852 // Present only for array (repeated) types. 3853 type DevicePublicListingSpec_FieldPathArrayItemValue interface { 3854 gotenobject.FieldPathArrayItemValue 3855 DevicePublicListingSpec_FieldPath 3856 ContainsValue(*Device_PublicListingSpec) bool 3857 } 3858 3859 // ParseDevicePublicListingSpec_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 3860 func ParseDevicePublicListingSpec_FieldPathArrayItemValue(pathStr, valueStr string) (DevicePublicListingSpec_FieldPathArrayItemValue, error) { 3861 fp, err := ParseDevicePublicListingSpec_FieldPath(pathStr) 3862 if err != nil { 3863 return nil, err 3864 } 3865 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 3866 if err != nil { 3867 return nil, status.Errorf(codes.InvalidArgument, "error parsing PublicListingSpec field path array item value from %s: %v", valueStr, err) 3868 } 3869 return fpaiv.(DevicePublicListingSpec_FieldPathArrayItemValue), nil 3870 } 3871 3872 func MustParseDevicePublicListingSpec_FieldPathArrayItemValue(pathStr, valueStr string) DevicePublicListingSpec_FieldPathArrayItemValue { 3873 fpaiv, err := ParseDevicePublicListingSpec_FieldPathArrayItemValue(pathStr, valueStr) 3874 if err != nil { 3875 panic(err) 3876 } 3877 return fpaiv 3878 } 3879 3880 type DevicePublicListingSpec_FieldTerminalPathArrayItemValue struct { 3881 DevicePublicListingSpec_FieldTerminalPath 3882 value interface{} 3883 } 3884 3885 var _ DevicePublicListingSpec_FieldPathArrayItemValue = (*DevicePublicListingSpec_FieldTerminalPathArrayItemValue)(nil) 3886 3887 // GetRawValue returns stored element value for array in object Device_PublicListingSpec as interface{} 3888 func (fpaiv *DevicePublicListingSpec_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 3889 return fpaiv.value 3890 } 3891 3892 func (fpaiv *DevicePublicListingSpec_FieldTerminalPathArrayItemValue) GetSingle(source *Device_PublicListingSpec) (interface{}, bool) { 3893 return nil, false 3894 } 3895 3896 func (fpaiv *DevicePublicListingSpec_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 3897 return fpaiv.GetSingle(source.(*Device_PublicListingSpec)) 3898 } 3899 3900 // Contains returns a boolean indicating if value that is being held is present in given 'PublicListingSpec' 3901 func (fpaiv *DevicePublicListingSpec_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_PublicListingSpec) bool { 3902 slice := fpaiv.DevicePublicListingSpec_FieldTerminalPath.Get(source) 3903 for _, v := range slice { 3904 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 3905 if proto.Equal(asProtoMsg, v.(proto.Message)) { 3906 return true 3907 } 3908 } else if reflect.DeepEqual(v, fpaiv.value) { 3909 return true 3910 } 3911 } 3912 return false 3913 } 3914 3915 // DevicePublicListingSpec_FieldPathArrayOfValues allows storing slice of values for PublicListingSpec fields according to their type 3916 type DevicePublicListingSpec_FieldPathArrayOfValues interface { 3917 gotenobject.FieldPathArrayOfValues 3918 DevicePublicListingSpec_FieldPath 3919 } 3920 3921 func ParseDevicePublicListingSpec_FieldPathArrayOfValues(pathStr, valuesStr string) (DevicePublicListingSpec_FieldPathArrayOfValues, error) { 3922 fp, err := ParseDevicePublicListingSpec_FieldPath(pathStr) 3923 if err != nil { 3924 return nil, err 3925 } 3926 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 3927 if err != nil { 3928 return nil, status.Errorf(codes.InvalidArgument, "error parsing PublicListingSpec field path array of values from %s: %v", valuesStr, err) 3929 } 3930 return fpaov.(DevicePublicListingSpec_FieldPathArrayOfValues), nil 3931 } 3932 3933 func MustParseDevicePublicListingSpec_FieldPathArrayOfValues(pathStr, valuesStr string) DevicePublicListingSpec_FieldPathArrayOfValues { 3934 fpaov, err := ParseDevicePublicListingSpec_FieldPathArrayOfValues(pathStr, valuesStr) 3935 if err != nil { 3936 panic(err) 3937 } 3938 return fpaov 3939 } 3940 3941 type DevicePublicListingSpec_FieldTerminalPathArrayOfValues struct { 3942 DevicePublicListingSpec_FieldTerminalPath 3943 values interface{} 3944 } 3945 3946 var _ DevicePublicListingSpec_FieldPathArrayOfValues = (*DevicePublicListingSpec_FieldTerminalPathArrayOfValues)(nil) 3947 3948 func (fpaov *DevicePublicListingSpec_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 3949 switch fpaov.selector { 3950 case DevicePublicListingSpec_FieldPathSelectorEnabled: 3951 for _, v := range fpaov.values.([]bool) { 3952 values = append(values, v) 3953 } 3954 case DevicePublicListingSpec_FieldPathSelectorFieldMask: 3955 for _, v := range fpaov.values.([]*Device_FieldMask) { 3956 values = append(values, v) 3957 } 3958 } 3959 return 3960 } 3961 func (fpaov *DevicePublicListingSpec_FieldTerminalPathArrayOfValues) AsEnabledArrayOfValues() ([]bool, bool) { 3962 res, ok := fpaov.values.([]bool) 3963 return res, ok 3964 } 3965 func (fpaov *DevicePublicListingSpec_FieldTerminalPathArrayOfValues) AsFieldMaskArrayOfValues() ([]*Device_FieldMask, bool) { 3966 res, ok := fpaov.values.([]*Device_FieldMask) 3967 return res, ok 3968 } 3969 3970 // FieldPath provides implementation to handle 3971 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 3972 type DeviceSpecSSHConfig_FieldPath interface { 3973 gotenobject.FieldPath 3974 Selector() DeviceSpecSSHConfig_FieldPathSelector 3975 Get(source *Device_Spec_SSHConfig) []interface{} 3976 GetSingle(source *Device_Spec_SSHConfig) (interface{}, bool) 3977 ClearValue(item *Device_Spec_SSHConfig) 3978 3979 // Those methods build corresponding DeviceSpecSSHConfig_FieldPathValue 3980 // (or array of values) and holds passed value. Panics if injected type is incorrect. 3981 WithIValue(value interface{}) DeviceSpecSSHConfig_FieldPathValue 3982 WithIArrayOfValues(values interface{}) DeviceSpecSSHConfig_FieldPathArrayOfValues 3983 WithIArrayItemValue(value interface{}) DeviceSpecSSHConfig_FieldPathArrayItemValue 3984 } 3985 3986 type DeviceSpecSSHConfig_FieldPathSelector int32 3987 3988 const ( 3989 DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer DeviceSpecSSHConfig_FieldPathSelector = 0 3990 DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword DeviceSpecSSHConfig_FieldPathSelector = 1 3991 DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized DeviceSpecSSHConfig_FieldPathSelector = 2 3992 DeviceSpecSSHConfig_FieldPathSelectorIpAllowList DeviceSpecSSHConfig_FieldPathSelector = 3 3993 DeviceSpecSSHConfig_FieldPathSelectorIpDenyList DeviceSpecSSHConfig_FieldPathSelector = 4 3994 DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod DeviceSpecSSHConfig_FieldPathSelector = 5 3995 DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey DeviceSpecSSHConfig_FieldPathSelector = 6 3996 ) 3997 3998 func (s DeviceSpecSSHConfig_FieldPathSelector) String() string { 3999 switch s { 4000 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4001 return "disable_ssh_server" 4002 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4003 return "disable_ssh_password" 4004 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4005 return "ssh_authorized" 4006 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4007 return "ip_allow_list" 4008 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4009 return "ip_deny_list" 4010 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4011 return "reject_period" 4012 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4013 return "disable_ssh_authkey" 4014 default: 4015 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", s)) 4016 } 4017 } 4018 4019 func BuildDeviceSpecSSHConfig_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecSSHConfig_FieldPath, error) { 4020 if len(fp) == 0 { 4021 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_SSHConfig") 4022 } 4023 if len(fp) == 1 { 4024 switch fp[0] { 4025 case "disable_ssh_server", "disableSshServer", "disable-ssh-server": 4026 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer}, nil 4027 case "disable_ssh_password", "disableSshPassword", "disable-ssh-password": 4028 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword}, nil 4029 case "ssh_authorized", "sshAuthorized", "ssh-authorized": 4030 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized}, nil 4031 case "ip_allow_list", "ipAllowList", "ip-allow-list": 4032 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorIpAllowList}, nil 4033 case "ip_deny_list", "ipDenyList", "ip-deny-list": 4034 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorIpDenyList}, nil 4035 case "reject_period", "rejectPeriod", "reject-period": 4036 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod}, nil 4037 case "disable_ssh_authkey", "disableSshAuthkey", "disable-ssh-authkey": 4038 return &DeviceSpecSSHConfig_FieldTerminalPath{selector: DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey}, nil 4039 } 4040 } else { 4041 switch fp[0] { 4042 case "ssh_authorized", "sshAuthorized", "ssh-authorized": 4043 if subpath, err := BuildDeviceSpecSSHConfigAuthKey_FieldPath(fp[1:]); err != nil { 4044 return nil, err 4045 } else { 4046 return &DeviceSpecSSHConfig_FieldSubPath{selector: DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized, subPath: subpath}, nil 4047 } 4048 } 4049 } 4050 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_SSHConfig", fp) 4051 } 4052 4053 func ParseDeviceSpecSSHConfig_FieldPath(rawField string) (DeviceSpecSSHConfig_FieldPath, error) { 4054 fp, err := gotenobject.ParseRawFieldPath(rawField) 4055 if err != nil { 4056 return nil, err 4057 } 4058 return BuildDeviceSpecSSHConfig_FieldPath(fp) 4059 } 4060 4061 func MustParseDeviceSpecSSHConfig_FieldPath(rawField string) DeviceSpecSSHConfig_FieldPath { 4062 fp, err := ParseDeviceSpecSSHConfig_FieldPath(rawField) 4063 if err != nil { 4064 panic(err) 4065 } 4066 return fp 4067 } 4068 4069 type DeviceSpecSSHConfig_FieldTerminalPath struct { 4070 selector DeviceSpecSSHConfig_FieldPathSelector 4071 } 4072 4073 var _ DeviceSpecSSHConfig_FieldPath = (*DeviceSpecSSHConfig_FieldTerminalPath)(nil) 4074 4075 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) Selector() DeviceSpecSSHConfig_FieldPathSelector { 4076 return fp.selector 4077 } 4078 4079 // String returns path representation in proto convention 4080 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) String() string { 4081 return fp.selector.String() 4082 } 4083 4084 // JSONString returns path representation is JSON convention 4085 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) JSONString() string { 4086 return strcase.ToLowerCamel(fp.String()) 4087 } 4088 4089 // Get returns all values pointed by specific field from source Device_Spec_SSHConfig 4090 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) Get(source *Device_Spec_SSHConfig) (values []interface{}) { 4091 if source != nil { 4092 switch fp.selector { 4093 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4094 values = append(values, source.DisableSshServer) 4095 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4096 values = append(values, source.DisableSshPassword) 4097 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4098 for _, value := range source.GetSshAuthorized() { 4099 values = append(values, value) 4100 } 4101 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4102 for _, value := range source.GetIpAllowList() { 4103 values = append(values, value) 4104 } 4105 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4106 for _, value := range source.GetIpDenyList() { 4107 values = append(values, value) 4108 } 4109 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4110 if source.RejectPeriod != nil { 4111 values = append(values, source.RejectPeriod) 4112 } 4113 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4114 values = append(values, source.DisableSshAuthkey) 4115 default: 4116 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4117 } 4118 } 4119 return 4120 } 4121 4122 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 4123 return fp.Get(source.(*Device_Spec_SSHConfig)) 4124 } 4125 4126 // GetSingle returns value pointed by specific field of from source Device_Spec_SSHConfig 4127 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) GetSingle(source *Device_Spec_SSHConfig) (interface{}, bool) { 4128 switch fp.selector { 4129 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4130 return source.GetDisableSshServer(), source != nil 4131 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4132 return source.GetDisableSshPassword(), source != nil 4133 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4134 res := source.GetSshAuthorized() 4135 return res, res != nil 4136 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4137 res := source.GetIpAllowList() 4138 return res, res != nil 4139 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4140 res := source.GetIpDenyList() 4141 return res, res != nil 4142 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4143 res := source.GetRejectPeriod() 4144 return res, res != nil 4145 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4146 return source.GetDisableSshAuthkey(), source != nil 4147 default: 4148 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4149 } 4150 } 4151 4152 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4153 return fp.GetSingle(source.(*Device_Spec_SSHConfig)) 4154 } 4155 4156 // GetDefault returns a default value of the field type 4157 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) GetDefault() interface{} { 4158 switch fp.selector { 4159 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4160 return false 4161 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4162 return false 4163 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4164 return ([]*Device_Spec_SSHConfig_AuthKey)(nil) 4165 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4166 return ([]string)(nil) 4167 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4168 return ([]string)(nil) 4169 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4170 return (*durationpb.Duration)(nil) 4171 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4172 return false 4173 default: 4174 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4175 } 4176 } 4177 4178 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) ClearValue(item *Device_Spec_SSHConfig) { 4179 if item != nil { 4180 switch fp.selector { 4181 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4182 item.DisableSshServer = false 4183 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4184 item.DisableSshPassword = false 4185 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4186 item.SshAuthorized = nil 4187 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4188 item.IpAllowList = nil 4189 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4190 item.IpDenyList = nil 4191 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4192 item.RejectPeriod = nil 4193 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4194 item.DisableSshAuthkey = false 4195 default: 4196 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4197 } 4198 } 4199 } 4200 4201 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) ClearValueRaw(item proto.Message) { 4202 fp.ClearValue(item.(*Device_Spec_SSHConfig)) 4203 } 4204 4205 // IsLeaf - whether field path is holds simple value 4206 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) IsLeaf() bool { 4207 return fp.selector == DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer || 4208 fp.selector == DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword || 4209 fp.selector == DeviceSpecSSHConfig_FieldPathSelectorIpAllowList || 4210 fp.selector == DeviceSpecSSHConfig_FieldPathSelectorIpDenyList || 4211 fp.selector == DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod || 4212 fp.selector == DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey 4213 } 4214 4215 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4216 return []gotenobject.FieldPath{fp} 4217 } 4218 4219 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecSSHConfig_FieldPathValue { 4220 switch fp.selector { 4221 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4222 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(bool)} 4223 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4224 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(bool)} 4225 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4226 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.([]*Device_Spec_SSHConfig_AuthKey)} 4227 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4228 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.([]string)} 4229 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4230 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.([]string)} 4231 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4232 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(*durationpb.Duration)} 4233 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4234 return &DeviceSpecSSHConfig_FieldTerminalPathValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(bool)} 4235 default: 4236 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4237 } 4238 } 4239 4240 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4241 return fp.WithIValue(value) 4242 } 4243 4244 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecSSHConfig_FieldPathArrayOfValues { 4245 fpaov := &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp} 4246 switch fp.selector { 4247 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4248 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([]bool)} 4249 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4250 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([]bool)} 4251 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4252 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([][]*Device_Spec_SSHConfig_AuthKey)} 4253 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4254 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([][]string)} 4255 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4256 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([][]string)} 4257 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4258 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([]*durationpb.Duration)} 4259 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4260 return &DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfig_FieldTerminalPath: *fp, values: values.([]bool)} 4261 default: 4262 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4263 } 4264 return fpaov 4265 } 4266 4267 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4268 return fp.WithIArrayOfValues(values) 4269 } 4270 4271 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecSSHConfig_FieldPathArrayItemValue { 4272 switch fp.selector { 4273 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4274 return &DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(*Device_Spec_SSHConfig_AuthKey)} 4275 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4276 return &DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(string)} 4277 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4278 return &DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue{DeviceSpecSSHConfig_FieldTerminalPath: *fp, value: value.(string)} 4279 default: 4280 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fp.selector)) 4281 } 4282 } 4283 4284 func (fp *DeviceSpecSSHConfig_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4285 return fp.WithIArrayItemValue(value) 4286 } 4287 4288 type DeviceSpecSSHConfig_FieldSubPath struct { 4289 selector DeviceSpecSSHConfig_FieldPathSelector 4290 subPath gotenobject.FieldPath 4291 } 4292 4293 var _ DeviceSpecSSHConfig_FieldPath = (*DeviceSpecSSHConfig_FieldSubPath)(nil) 4294 4295 func (fps *DeviceSpecSSHConfig_FieldSubPath) Selector() DeviceSpecSSHConfig_FieldPathSelector { 4296 return fps.selector 4297 } 4298 func (fps *DeviceSpecSSHConfig_FieldSubPath) AsSshAuthorizedSubPath() (DeviceSpecSSHConfigAuthKey_FieldPath, bool) { 4299 res, ok := fps.subPath.(DeviceSpecSSHConfigAuthKey_FieldPath) 4300 return res, ok 4301 } 4302 4303 // String returns path representation in proto convention 4304 func (fps *DeviceSpecSSHConfig_FieldSubPath) String() string { 4305 return fps.selector.String() + "." + fps.subPath.String() 4306 } 4307 4308 // JSONString returns path representation is JSON convention 4309 func (fps *DeviceSpecSSHConfig_FieldSubPath) JSONString() string { 4310 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 4311 } 4312 4313 // Get returns all values pointed by selected field from source Device_Spec_SSHConfig 4314 func (fps *DeviceSpecSSHConfig_FieldSubPath) Get(source *Device_Spec_SSHConfig) (values []interface{}) { 4315 switch fps.selector { 4316 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4317 for _, item := range source.GetSshAuthorized() { 4318 values = append(values, fps.subPath.GetRaw(item)...) 4319 } 4320 default: 4321 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fps.selector)) 4322 } 4323 return 4324 } 4325 4326 func (fps *DeviceSpecSSHConfig_FieldSubPath) GetRaw(source proto.Message) []interface{} { 4327 return fps.Get(source.(*Device_Spec_SSHConfig)) 4328 } 4329 4330 // GetSingle returns value of selected field from source Device_Spec_SSHConfig 4331 func (fps *DeviceSpecSSHConfig_FieldSubPath) GetSingle(source *Device_Spec_SSHConfig) (interface{}, bool) { 4332 switch fps.selector { 4333 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4334 if len(source.GetSshAuthorized()) == 0 { 4335 return nil, false 4336 } 4337 return fps.subPath.GetSingleRaw(source.GetSshAuthorized()[0]) 4338 default: 4339 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fps.selector)) 4340 } 4341 } 4342 4343 func (fps *DeviceSpecSSHConfig_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4344 return fps.GetSingle(source.(*Device_Spec_SSHConfig)) 4345 } 4346 4347 // GetDefault returns a default value of the field type 4348 func (fps *DeviceSpecSSHConfig_FieldSubPath) GetDefault() interface{} { 4349 return fps.subPath.GetDefault() 4350 } 4351 4352 func (fps *DeviceSpecSSHConfig_FieldSubPath) ClearValue(item *Device_Spec_SSHConfig) { 4353 if item != nil { 4354 switch fps.selector { 4355 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4356 for _, subItem := range item.SshAuthorized { 4357 fps.subPath.ClearValueRaw(subItem) 4358 } 4359 default: 4360 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fps.selector)) 4361 } 4362 } 4363 } 4364 4365 func (fps *DeviceSpecSSHConfig_FieldSubPath) ClearValueRaw(item proto.Message) { 4366 fps.ClearValue(item.(*Device_Spec_SSHConfig)) 4367 } 4368 4369 // IsLeaf - whether field path is holds simple value 4370 func (fps *DeviceSpecSSHConfig_FieldSubPath) IsLeaf() bool { 4371 return fps.subPath.IsLeaf() 4372 } 4373 4374 func (fps *DeviceSpecSSHConfig_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4375 iPaths := []gotenobject.FieldPath{&DeviceSpecSSHConfig_FieldTerminalPath{selector: fps.selector}} 4376 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 4377 return iPaths 4378 } 4379 4380 func (fps *DeviceSpecSSHConfig_FieldSubPath) WithIValue(value interface{}) DeviceSpecSSHConfig_FieldPathValue { 4381 return &DeviceSpecSSHConfig_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 4382 } 4383 4384 func (fps *DeviceSpecSSHConfig_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4385 return fps.WithIValue(value) 4386 } 4387 4388 func (fps *DeviceSpecSSHConfig_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceSpecSSHConfig_FieldPathArrayOfValues { 4389 return &DeviceSpecSSHConfig_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 4390 } 4391 4392 func (fps *DeviceSpecSSHConfig_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4393 return fps.WithIArrayOfValues(values) 4394 } 4395 4396 func (fps *DeviceSpecSSHConfig_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceSpecSSHConfig_FieldPathArrayItemValue { 4397 return &DeviceSpecSSHConfig_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 4398 } 4399 4400 func (fps *DeviceSpecSSHConfig_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4401 return fps.WithIArrayItemValue(value) 4402 } 4403 4404 // DeviceSpecSSHConfig_FieldPathValue allows storing values for SSHConfig fields according to their type 4405 type DeviceSpecSSHConfig_FieldPathValue interface { 4406 DeviceSpecSSHConfig_FieldPath 4407 gotenobject.FieldPathValue 4408 SetTo(target **Device_Spec_SSHConfig) 4409 CompareWith(*Device_Spec_SSHConfig) (cmp int, comparable bool) 4410 } 4411 4412 func ParseDeviceSpecSSHConfig_FieldPathValue(pathStr, valueStr string) (DeviceSpecSSHConfig_FieldPathValue, error) { 4413 fp, err := ParseDeviceSpecSSHConfig_FieldPath(pathStr) 4414 if err != nil { 4415 return nil, err 4416 } 4417 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 4418 if err != nil { 4419 return nil, status.Errorf(codes.InvalidArgument, "error parsing SSHConfig field path value from %s: %v", valueStr, err) 4420 } 4421 return fpv.(DeviceSpecSSHConfig_FieldPathValue), nil 4422 } 4423 4424 func MustParseDeviceSpecSSHConfig_FieldPathValue(pathStr, valueStr string) DeviceSpecSSHConfig_FieldPathValue { 4425 fpv, err := ParseDeviceSpecSSHConfig_FieldPathValue(pathStr, valueStr) 4426 if err != nil { 4427 panic(err) 4428 } 4429 return fpv 4430 } 4431 4432 type DeviceSpecSSHConfig_FieldTerminalPathValue struct { 4433 DeviceSpecSSHConfig_FieldTerminalPath 4434 value interface{} 4435 } 4436 4437 var _ DeviceSpecSSHConfig_FieldPathValue = (*DeviceSpecSSHConfig_FieldTerminalPathValue)(nil) 4438 4439 // GetRawValue returns raw value stored under selected path for 'SSHConfig' as interface{} 4440 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) GetRawValue() interface{} { 4441 return fpv.value 4442 } 4443 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsDisableSshServerValue() (bool, bool) { 4444 res, ok := fpv.value.(bool) 4445 return res, ok 4446 } 4447 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsDisableSshPasswordValue() (bool, bool) { 4448 res, ok := fpv.value.(bool) 4449 return res, ok 4450 } 4451 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsSshAuthorizedValue() ([]*Device_Spec_SSHConfig_AuthKey, bool) { 4452 res, ok := fpv.value.([]*Device_Spec_SSHConfig_AuthKey) 4453 return res, ok 4454 } 4455 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsIpAllowListValue() ([]string, bool) { 4456 res, ok := fpv.value.([]string) 4457 return res, ok 4458 } 4459 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsIpDenyListValue() ([]string, bool) { 4460 res, ok := fpv.value.([]string) 4461 return res, ok 4462 } 4463 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsRejectPeriodValue() (*durationpb.Duration, bool) { 4464 res, ok := fpv.value.(*durationpb.Duration) 4465 return res, ok 4466 } 4467 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) AsDisableSshAuthkeyValue() (bool, bool) { 4468 res, ok := fpv.value.(bool) 4469 return res, ok 4470 } 4471 4472 // SetTo stores value for selected field for object SSHConfig 4473 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) SetTo(target **Device_Spec_SSHConfig) { 4474 if *target == nil { 4475 *target = new(Device_Spec_SSHConfig) 4476 } 4477 switch fpv.selector { 4478 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4479 (*target).DisableSshServer = fpv.value.(bool) 4480 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4481 (*target).DisableSshPassword = fpv.value.(bool) 4482 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4483 (*target).SshAuthorized = fpv.value.([]*Device_Spec_SSHConfig_AuthKey) 4484 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4485 (*target).IpAllowList = fpv.value.([]string) 4486 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4487 (*target).IpDenyList = fpv.value.([]string) 4488 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4489 (*target).RejectPeriod = fpv.value.(*durationpb.Duration) 4490 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4491 (*target).DisableSshAuthkey = fpv.value.(bool) 4492 default: 4493 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fpv.selector)) 4494 } 4495 } 4496 4497 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) SetToRaw(target proto.Message) { 4498 typedObject := target.(*Device_Spec_SSHConfig) 4499 fpv.SetTo(&typedObject) 4500 } 4501 4502 // CompareWith compares value in the 'DeviceSpecSSHConfig_FieldTerminalPathValue' with the value under path in 'Device_Spec_SSHConfig'. 4503 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) CompareWith(source *Device_Spec_SSHConfig) (int, bool) { 4504 switch fpv.selector { 4505 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4506 leftValue := fpv.value.(bool) 4507 rightValue := source.GetDisableSshServer() 4508 if (leftValue) == (rightValue) { 4509 return 0, true 4510 } else if !(leftValue) && (rightValue) { 4511 return -1, true 4512 } else { 4513 return 1, true 4514 } 4515 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4516 leftValue := fpv.value.(bool) 4517 rightValue := source.GetDisableSshPassword() 4518 if (leftValue) == (rightValue) { 4519 return 0, true 4520 } else if !(leftValue) && (rightValue) { 4521 return -1, true 4522 } else { 4523 return 1, true 4524 } 4525 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4526 return 0, false 4527 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4528 return 0, false 4529 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4530 return 0, false 4531 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4532 leftValue := fpv.value.(*durationpb.Duration) 4533 rightValue := source.GetRejectPeriod() 4534 if leftValue == nil { 4535 if rightValue != nil { 4536 return -1, true 4537 } 4538 return 0, true 4539 } 4540 if rightValue == nil { 4541 return 1, true 4542 } 4543 if leftValue.AsDuration() == rightValue.AsDuration() { 4544 return 0, true 4545 } else if leftValue.AsDuration() < rightValue.AsDuration() { 4546 return -1, true 4547 } else { 4548 return 1, true 4549 } 4550 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4551 leftValue := fpv.value.(bool) 4552 rightValue := source.GetDisableSshAuthkey() 4553 if (leftValue) == (rightValue) { 4554 return 0, true 4555 } else if !(leftValue) && (rightValue) { 4556 return -1, true 4557 } else { 4558 return 1, true 4559 } 4560 default: 4561 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fpv.selector)) 4562 } 4563 } 4564 4565 func (fpv *DeviceSpecSSHConfig_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4566 return fpv.CompareWith(source.(*Device_Spec_SSHConfig)) 4567 } 4568 4569 type DeviceSpecSSHConfig_FieldSubPathValue struct { 4570 DeviceSpecSSHConfig_FieldPath 4571 subPathValue gotenobject.FieldPathValue 4572 } 4573 4574 var _ DeviceSpecSSHConfig_FieldPathValue = (*DeviceSpecSSHConfig_FieldSubPathValue)(nil) 4575 4576 func (fpvs *DeviceSpecSSHConfig_FieldSubPathValue) AsSshAuthorizedPathValue() (DeviceSpecSSHConfigAuthKey_FieldPathValue, bool) { 4577 res, ok := fpvs.subPathValue.(DeviceSpecSSHConfigAuthKey_FieldPathValue) 4578 return res, ok 4579 } 4580 4581 func (fpvs *DeviceSpecSSHConfig_FieldSubPathValue) SetTo(target **Device_Spec_SSHConfig) { 4582 if *target == nil { 4583 *target = new(Device_Spec_SSHConfig) 4584 } 4585 switch fpvs.Selector() { 4586 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4587 panic("FieldPath setter is unsupported for array subpaths") 4588 default: 4589 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fpvs.Selector())) 4590 } 4591 } 4592 4593 func (fpvs *DeviceSpecSSHConfig_FieldSubPathValue) SetToRaw(target proto.Message) { 4594 typedObject := target.(*Device_Spec_SSHConfig) 4595 fpvs.SetTo(&typedObject) 4596 } 4597 4598 func (fpvs *DeviceSpecSSHConfig_FieldSubPathValue) GetRawValue() interface{} { 4599 return fpvs.subPathValue.GetRawValue() 4600 } 4601 4602 func (fpvs *DeviceSpecSSHConfig_FieldSubPathValue) CompareWith(source *Device_Spec_SSHConfig) (int, bool) { 4603 switch fpvs.Selector() { 4604 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4605 return 0, false // repeated field 4606 default: 4607 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fpvs.Selector())) 4608 } 4609 } 4610 4611 func (fpvs *DeviceSpecSSHConfig_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4612 return fpvs.CompareWith(source.(*Device_Spec_SSHConfig)) 4613 } 4614 4615 // DeviceSpecSSHConfig_FieldPathArrayItemValue allows storing single item in Path-specific values for SSHConfig according to their type 4616 // Present only for array (repeated) types. 4617 type DeviceSpecSSHConfig_FieldPathArrayItemValue interface { 4618 gotenobject.FieldPathArrayItemValue 4619 DeviceSpecSSHConfig_FieldPath 4620 ContainsValue(*Device_Spec_SSHConfig) bool 4621 } 4622 4623 // ParseDeviceSpecSSHConfig_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 4624 func ParseDeviceSpecSSHConfig_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecSSHConfig_FieldPathArrayItemValue, error) { 4625 fp, err := ParseDeviceSpecSSHConfig_FieldPath(pathStr) 4626 if err != nil { 4627 return nil, err 4628 } 4629 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 4630 if err != nil { 4631 return nil, status.Errorf(codes.InvalidArgument, "error parsing SSHConfig field path array item value from %s: %v", valueStr, err) 4632 } 4633 return fpaiv.(DeviceSpecSSHConfig_FieldPathArrayItemValue), nil 4634 } 4635 4636 func MustParseDeviceSpecSSHConfig_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecSSHConfig_FieldPathArrayItemValue { 4637 fpaiv, err := ParseDeviceSpecSSHConfig_FieldPathArrayItemValue(pathStr, valueStr) 4638 if err != nil { 4639 panic(err) 4640 } 4641 return fpaiv 4642 } 4643 4644 type DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue struct { 4645 DeviceSpecSSHConfig_FieldTerminalPath 4646 value interface{} 4647 } 4648 4649 var _ DeviceSpecSSHConfig_FieldPathArrayItemValue = (*DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue)(nil) 4650 4651 // GetRawValue returns stored element value for array in object Device_Spec_SSHConfig as interface{} 4652 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 4653 return fpaiv.value 4654 } 4655 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) AsSshAuthorizedItemValue() (*Device_Spec_SSHConfig_AuthKey, bool) { 4656 res, ok := fpaiv.value.(*Device_Spec_SSHConfig_AuthKey) 4657 return res, ok 4658 } 4659 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) AsIpAllowListItemValue() (string, bool) { 4660 res, ok := fpaiv.value.(string) 4661 return res, ok 4662 } 4663 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) AsIpDenyListItemValue() (string, bool) { 4664 res, ok := fpaiv.value.(string) 4665 return res, ok 4666 } 4667 4668 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_SSHConfig) (interface{}, bool) { 4669 return nil, false 4670 } 4671 4672 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 4673 return fpaiv.GetSingle(source.(*Device_Spec_SSHConfig)) 4674 } 4675 4676 // Contains returns a boolean indicating if value that is being held is present in given 'SSHConfig' 4677 func (fpaiv *DeviceSpecSSHConfig_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_SSHConfig) bool { 4678 slice := fpaiv.DeviceSpecSSHConfig_FieldTerminalPath.Get(source) 4679 for _, v := range slice { 4680 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 4681 if proto.Equal(asProtoMsg, v.(proto.Message)) { 4682 return true 4683 } 4684 } else if reflect.DeepEqual(v, fpaiv.value) { 4685 return true 4686 } 4687 } 4688 return false 4689 } 4690 4691 type DeviceSpecSSHConfig_FieldSubPathArrayItemValue struct { 4692 DeviceSpecSSHConfig_FieldPath 4693 subPathItemValue gotenobject.FieldPathArrayItemValue 4694 } 4695 4696 // GetRawValue returns stored array item value 4697 func (fpaivs *DeviceSpecSSHConfig_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 4698 return fpaivs.subPathItemValue.GetRawItemValue() 4699 } 4700 func (fpaivs *DeviceSpecSSHConfig_FieldSubPathArrayItemValue) AsSshAuthorizedPathItemValue() (DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue, bool) { 4701 res, ok := fpaivs.subPathItemValue.(DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue) 4702 return res, ok 4703 } 4704 4705 // Contains returns a boolean indicating if value that is being held is present in given 'SSHConfig' 4706 func (fpaivs *DeviceSpecSSHConfig_FieldSubPathArrayItemValue) ContainsValue(source *Device_Spec_SSHConfig) bool { 4707 switch fpaivs.Selector() { 4708 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4709 return false // repeated/map field 4710 default: 4711 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig: %d", fpaivs.Selector())) 4712 } 4713 } 4714 4715 // DeviceSpecSSHConfig_FieldPathArrayOfValues allows storing slice of values for SSHConfig fields according to their type 4716 type DeviceSpecSSHConfig_FieldPathArrayOfValues interface { 4717 gotenobject.FieldPathArrayOfValues 4718 DeviceSpecSSHConfig_FieldPath 4719 } 4720 4721 func ParseDeviceSpecSSHConfig_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecSSHConfig_FieldPathArrayOfValues, error) { 4722 fp, err := ParseDeviceSpecSSHConfig_FieldPath(pathStr) 4723 if err != nil { 4724 return nil, err 4725 } 4726 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 4727 if err != nil { 4728 return nil, status.Errorf(codes.InvalidArgument, "error parsing SSHConfig field path array of values from %s: %v", valuesStr, err) 4729 } 4730 return fpaov.(DeviceSpecSSHConfig_FieldPathArrayOfValues), nil 4731 } 4732 4733 func MustParseDeviceSpecSSHConfig_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecSSHConfig_FieldPathArrayOfValues { 4734 fpaov, err := ParseDeviceSpecSSHConfig_FieldPathArrayOfValues(pathStr, valuesStr) 4735 if err != nil { 4736 panic(err) 4737 } 4738 return fpaov 4739 } 4740 4741 type DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues struct { 4742 DeviceSpecSSHConfig_FieldTerminalPath 4743 values interface{} 4744 } 4745 4746 var _ DeviceSpecSSHConfig_FieldPathArrayOfValues = (*DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues)(nil) 4747 4748 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 4749 switch fpaov.selector { 4750 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshServer: 4751 for _, v := range fpaov.values.([]bool) { 4752 values = append(values, v) 4753 } 4754 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshPassword: 4755 for _, v := range fpaov.values.([]bool) { 4756 values = append(values, v) 4757 } 4758 case DeviceSpecSSHConfig_FieldPathSelectorSshAuthorized: 4759 for _, v := range fpaov.values.([][]*Device_Spec_SSHConfig_AuthKey) { 4760 values = append(values, v) 4761 } 4762 case DeviceSpecSSHConfig_FieldPathSelectorIpAllowList: 4763 for _, v := range fpaov.values.([][]string) { 4764 values = append(values, v) 4765 } 4766 case DeviceSpecSSHConfig_FieldPathSelectorIpDenyList: 4767 for _, v := range fpaov.values.([][]string) { 4768 values = append(values, v) 4769 } 4770 case DeviceSpecSSHConfig_FieldPathSelectorRejectPeriod: 4771 for _, v := range fpaov.values.([]*durationpb.Duration) { 4772 values = append(values, v) 4773 } 4774 case DeviceSpecSSHConfig_FieldPathSelectorDisableSshAuthkey: 4775 for _, v := range fpaov.values.([]bool) { 4776 values = append(values, v) 4777 } 4778 } 4779 return 4780 } 4781 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsDisableSshServerArrayOfValues() ([]bool, bool) { 4782 res, ok := fpaov.values.([]bool) 4783 return res, ok 4784 } 4785 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsDisableSshPasswordArrayOfValues() ([]bool, bool) { 4786 res, ok := fpaov.values.([]bool) 4787 return res, ok 4788 } 4789 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsSshAuthorizedArrayOfValues() ([][]*Device_Spec_SSHConfig_AuthKey, bool) { 4790 res, ok := fpaov.values.([][]*Device_Spec_SSHConfig_AuthKey) 4791 return res, ok 4792 } 4793 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsIpAllowListArrayOfValues() ([][]string, bool) { 4794 res, ok := fpaov.values.([][]string) 4795 return res, ok 4796 } 4797 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsIpDenyListArrayOfValues() ([][]string, bool) { 4798 res, ok := fpaov.values.([][]string) 4799 return res, ok 4800 } 4801 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsRejectPeriodArrayOfValues() ([]*durationpb.Duration, bool) { 4802 res, ok := fpaov.values.([]*durationpb.Duration) 4803 return res, ok 4804 } 4805 func (fpaov *DeviceSpecSSHConfig_FieldTerminalPathArrayOfValues) AsDisableSshAuthkeyArrayOfValues() ([]bool, bool) { 4806 res, ok := fpaov.values.([]bool) 4807 return res, ok 4808 } 4809 4810 type DeviceSpecSSHConfig_FieldSubPathArrayOfValues struct { 4811 DeviceSpecSSHConfig_FieldPath 4812 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 4813 } 4814 4815 var _ DeviceSpecSSHConfig_FieldPathArrayOfValues = (*DeviceSpecSSHConfig_FieldSubPathArrayOfValues)(nil) 4816 4817 func (fpsaov *DeviceSpecSSHConfig_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 4818 return fpsaov.subPathArrayOfValues.GetRawValues() 4819 } 4820 func (fpsaov *DeviceSpecSSHConfig_FieldSubPathArrayOfValues) AsSshAuthorizedPathArrayOfValues() (DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues, bool) { 4821 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues) 4822 return res, ok 4823 } 4824 4825 // FieldPath provides implementation to handle 4826 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 4827 type DeviceSpecAttestationConfig_FieldPath interface { 4828 gotenobject.FieldPath 4829 Selector() DeviceSpecAttestationConfig_FieldPathSelector 4830 Get(source *Device_Spec_AttestationConfig) []interface{} 4831 GetSingle(source *Device_Spec_AttestationConfig) (interface{}, bool) 4832 ClearValue(item *Device_Spec_AttestationConfig) 4833 4834 // Those methods build corresponding DeviceSpecAttestationConfig_FieldPathValue 4835 // (or array of values) and holds passed value. Panics if injected type is incorrect. 4836 WithIValue(value interface{}) DeviceSpecAttestationConfig_FieldPathValue 4837 WithIArrayOfValues(values interface{}) DeviceSpecAttestationConfig_FieldPathArrayOfValues 4838 WithIArrayItemValue(value interface{}) DeviceSpecAttestationConfig_FieldPathArrayItemValue 4839 } 4840 4841 type DeviceSpecAttestationConfig_FieldPathSelector int32 4842 4843 const ( 4844 DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected DeviceSpecAttestationConfig_FieldPathSelector = 0 4845 DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain DeviceSpecAttestationConfig_FieldPathSelector = 1 4846 ) 4847 4848 func (s DeviceSpecAttestationConfig_FieldPathSelector) String() string { 4849 switch s { 4850 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 4851 return "attestation_expected" 4852 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 4853 return "attestation_domain" 4854 default: 4855 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", s)) 4856 } 4857 } 4858 4859 func BuildDeviceSpecAttestationConfig_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecAttestationConfig_FieldPath, error) { 4860 if len(fp) == 0 { 4861 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_AttestationConfig") 4862 } 4863 if len(fp) == 1 { 4864 switch fp[0] { 4865 case "attestation_expected", "attestationExpected", "attestation-expected": 4866 return &DeviceSpecAttestationConfig_FieldTerminalPath{selector: DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected}, nil 4867 case "attestation_domain", "attestationDomain", "attestation-domain": 4868 return &DeviceSpecAttestationConfig_FieldTerminalPath{selector: DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain}, nil 4869 } 4870 } 4871 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_AttestationConfig", fp) 4872 } 4873 4874 func ParseDeviceSpecAttestationConfig_FieldPath(rawField string) (DeviceSpecAttestationConfig_FieldPath, error) { 4875 fp, err := gotenobject.ParseRawFieldPath(rawField) 4876 if err != nil { 4877 return nil, err 4878 } 4879 return BuildDeviceSpecAttestationConfig_FieldPath(fp) 4880 } 4881 4882 func MustParseDeviceSpecAttestationConfig_FieldPath(rawField string) DeviceSpecAttestationConfig_FieldPath { 4883 fp, err := ParseDeviceSpecAttestationConfig_FieldPath(rawField) 4884 if err != nil { 4885 panic(err) 4886 } 4887 return fp 4888 } 4889 4890 type DeviceSpecAttestationConfig_FieldTerminalPath struct { 4891 selector DeviceSpecAttestationConfig_FieldPathSelector 4892 } 4893 4894 var _ DeviceSpecAttestationConfig_FieldPath = (*DeviceSpecAttestationConfig_FieldTerminalPath)(nil) 4895 4896 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) Selector() DeviceSpecAttestationConfig_FieldPathSelector { 4897 return fp.selector 4898 } 4899 4900 // String returns path representation in proto convention 4901 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) String() string { 4902 return fp.selector.String() 4903 } 4904 4905 // JSONString returns path representation is JSON convention 4906 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) JSONString() string { 4907 return strcase.ToLowerCamel(fp.String()) 4908 } 4909 4910 // Get returns all values pointed by specific field from source Device_Spec_AttestationConfig 4911 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) Get(source *Device_Spec_AttestationConfig) (values []interface{}) { 4912 if source != nil { 4913 switch fp.selector { 4914 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 4915 values = append(values, source.AttestationExpected) 4916 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 4917 if source.AttestationDomain != nil { 4918 values = append(values, source.AttestationDomain) 4919 } 4920 default: 4921 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 4922 } 4923 } 4924 return 4925 } 4926 4927 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 4928 return fp.Get(source.(*Device_Spec_AttestationConfig)) 4929 } 4930 4931 // GetSingle returns value pointed by specific field of from source Device_Spec_AttestationConfig 4932 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) GetSingle(source *Device_Spec_AttestationConfig) (interface{}, bool) { 4933 switch fp.selector { 4934 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 4935 return source.GetAttestationExpected(), source != nil 4936 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 4937 res := source.GetAttestationDomain() 4938 return res, res != nil 4939 default: 4940 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 4941 } 4942 } 4943 4944 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4945 return fp.GetSingle(source.(*Device_Spec_AttestationConfig)) 4946 } 4947 4948 // GetDefault returns a default value of the field type 4949 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) GetDefault() interface{} { 4950 switch fp.selector { 4951 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 4952 return false 4953 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 4954 return (*iam_attestation_domain.Reference)(nil) 4955 default: 4956 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 4957 } 4958 } 4959 4960 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) ClearValue(item *Device_Spec_AttestationConfig) { 4961 if item != nil { 4962 switch fp.selector { 4963 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 4964 item.AttestationExpected = false 4965 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 4966 item.AttestationDomain = nil 4967 default: 4968 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 4969 } 4970 } 4971 } 4972 4973 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) ClearValueRaw(item proto.Message) { 4974 fp.ClearValue(item.(*Device_Spec_AttestationConfig)) 4975 } 4976 4977 // IsLeaf - whether field path is holds simple value 4978 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) IsLeaf() bool { 4979 return fp.selector == DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected || 4980 fp.selector == DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain 4981 } 4982 4983 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4984 return []gotenobject.FieldPath{fp} 4985 } 4986 4987 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecAttestationConfig_FieldPathValue { 4988 switch fp.selector { 4989 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 4990 return &DeviceSpecAttestationConfig_FieldTerminalPathValue{DeviceSpecAttestationConfig_FieldTerminalPath: *fp, value: value.(bool)} 4991 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 4992 return &DeviceSpecAttestationConfig_FieldTerminalPathValue{DeviceSpecAttestationConfig_FieldTerminalPath: *fp, value: value.(*iam_attestation_domain.Reference)} 4993 default: 4994 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 4995 } 4996 } 4997 4998 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4999 return fp.WithIValue(value) 5000 } 5001 5002 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecAttestationConfig_FieldPathArrayOfValues { 5003 fpaov := &DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues{DeviceSpecAttestationConfig_FieldTerminalPath: *fp} 5004 switch fp.selector { 5005 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 5006 return &DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues{DeviceSpecAttestationConfig_FieldTerminalPath: *fp, values: values.([]bool)} 5007 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 5008 return &DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues{DeviceSpecAttestationConfig_FieldTerminalPath: *fp, values: values.([]*iam_attestation_domain.Reference)} 5009 default: 5010 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 5011 } 5012 return fpaov 5013 } 5014 5015 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5016 return fp.WithIArrayOfValues(values) 5017 } 5018 5019 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecAttestationConfig_FieldPathArrayItemValue { 5020 switch fp.selector { 5021 default: 5022 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fp.selector)) 5023 } 5024 } 5025 5026 func (fp *DeviceSpecAttestationConfig_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5027 return fp.WithIArrayItemValue(value) 5028 } 5029 5030 // DeviceSpecAttestationConfig_FieldPathValue allows storing values for AttestationConfig fields according to their type 5031 type DeviceSpecAttestationConfig_FieldPathValue interface { 5032 DeviceSpecAttestationConfig_FieldPath 5033 gotenobject.FieldPathValue 5034 SetTo(target **Device_Spec_AttestationConfig) 5035 CompareWith(*Device_Spec_AttestationConfig) (cmp int, comparable bool) 5036 } 5037 5038 func ParseDeviceSpecAttestationConfig_FieldPathValue(pathStr, valueStr string) (DeviceSpecAttestationConfig_FieldPathValue, error) { 5039 fp, err := ParseDeviceSpecAttestationConfig_FieldPath(pathStr) 5040 if err != nil { 5041 return nil, err 5042 } 5043 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 5044 if err != nil { 5045 return nil, status.Errorf(codes.InvalidArgument, "error parsing AttestationConfig field path value from %s: %v", valueStr, err) 5046 } 5047 return fpv.(DeviceSpecAttestationConfig_FieldPathValue), nil 5048 } 5049 5050 func MustParseDeviceSpecAttestationConfig_FieldPathValue(pathStr, valueStr string) DeviceSpecAttestationConfig_FieldPathValue { 5051 fpv, err := ParseDeviceSpecAttestationConfig_FieldPathValue(pathStr, valueStr) 5052 if err != nil { 5053 panic(err) 5054 } 5055 return fpv 5056 } 5057 5058 type DeviceSpecAttestationConfig_FieldTerminalPathValue struct { 5059 DeviceSpecAttestationConfig_FieldTerminalPath 5060 value interface{} 5061 } 5062 5063 var _ DeviceSpecAttestationConfig_FieldPathValue = (*DeviceSpecAttestationConfig_FieldTerminalPathValue)(nil) 5064 5065 // GetRawValue returns raw value stored under selected path for 'AttestationConfig' as interface{} 5066 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) GetRawValue() interface{} { 5067 return fpv.value 5068 } 5069 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) AsAttestationExpectedValue() (bool, bool) { 5070 res, ok := fpv.value.(bool) 5071 return res, ok 5072 } 5073 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) AsAttestationDomainValue() (*iam_attestation_domain.Reference, bool) { 5074 res, ok := fpv.value.(*iam_attestation_domain.Reference) 5075 return res, ok 5076 } 5077 5078 // SetTo stores value for selected field for object AttestationConfig 5079 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) SetTo(target **Device_Spec_AttestationConfig) { 5080 if *target == nil { 5081 *target = new(Device_Spec_AttestationConfig) 5082 } 5083 switch fpv.selector { 5084 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 5085 (*target).AttestationExpected = fpv.value.(bool) 5086 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 5087 (*target).AttestationDomain = fpv.value.(*iam_attestation_domain.Reference) 5088 default: 5089 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fpv.selector)) 5090 } 5091 } 5092 5093 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) SetToRaw(target proto.Message) { 5094 typedObject := target.(*Device_Spec_AttestationConfig) 5095 fpv.SetTo(&typedObject) 5096 } 5097 5098 // CompareWith compares value in the 'DeviceSpecAttestationConfig_FieldTerminalPathValue' with the value under path in 'Device_Spec_AttestationConfig'. 5099 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) CompareWith(source *Device_Spec_AttestationConfig) (int, bool) { 5100 switch fpv.selector { 5101 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 5102 leftValue := fpv.value.(bool) 5103 rightValue := source.GetAttestationExpected() 5104 if (leftValue) == (rightValue) { 5105 return 0, true 5106 } else if !(leftValue) && (rightValue) { 5107 return -1, true 5108 } else { 5109 return 1, true 5110 } 5111 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 5112 leftValue := fpv.value.(*iam_attestation_domain.Reference) 5113 rightValue := source.GetAttestationDomain() 5114 if leftValue == nil { 5115 if rightValue != nil { 5116 return -1, true 5117 } 5118 return 0, true 5119 } 5120 if rightValue == nil { 5121 return 1, true 5122 } 5123 if leftValue.String() == rightValue.String() { 5124 return 0, true 5125 } else if leftValue.String() < rightValue.String() { 5126 return -1, true 5127 } else { 5128 return 1, true 5129 } 5130 default: 5131 panic(fmt.Sprintf("Invalid selector for Device_Spec_AttestationConfig: %d", fpv.selector)) 5132 } 5133 } 5134 5135 func (fpv *DeviceSpecAttestationConfig_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5136 return fpv.CompareWith(source.(*Device_Spec_AttestationConfig)) 5137 } 5138 5139 // DeviceSpecAttestationConfig_FieldPathArrayItemValue allows storing single item in Path-specific values for AttestationConfig according to their type 5140 // Present only for array (repeated) types. 5141 type DeviceSpecAttestationConfig_FieldPathArrayItemValue interface { 5142 gotenobject.FieldPathArrayItemValue 5143 DeviceSpecAttestationConfig_FieldPath 5144 ContainsValue(*Device_Spec_AttestationConfig) bool 5145 } 5146 5147 // ParseDeviceSpecAttestationConfig_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 5148 func ParseDeviceSpecAttestationConfig_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecAttestationConfig_FieldPathArrayItemValue, error) { 5149 fp, err := ParseDeviceSpecAttestationConfig_FieldPath(pathStr) 5150 if err != nil { 5151 return nil, err 5152 } 5153 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 5154 if err != nil { 5155 return nil, status.Errorf(codes.InvalidArgument, "error parsing AttestationConfig field path array item value from %s: %v", valueStr, err) 5156 } 5157 return fpaiv.(DeviceSpecAttestationConfig_FieldPathArrayItemValue), nil 5158 } 5159 5160 func MustParseDeviceSpecAttestationConfig_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecAttestationConfig_FieldPathArrayItemValue { 5161 fpaiv, err := ParseDeviceSpecAttestationConfig_FieldPathArrayItemValue(pathStr, valueStr) 5162 if err != nil { 5163 panic(err) 5164 } 5165 return fpaiv 5166 } 5167 5168 type DeviceSpecAttestationConfig_FieldTerminalPathArrayItemValue struct { 5169 DeviceSpecAttestationConfig_FieldTerminalPath 5170 value interface{} 5171 } 5172 5173 var _ DeviceSpecAttestationConfig_FieldPathArrayItemValue = (*DeviceSpecAttestationConfig_FieldTerminalPathArrayItemValue)(nil) 5174 5175 // GetRawValue returns stored element value for array in object Device_Spec_AttestationConfig as interface{} 5176 func (fpaiv *DeviceSpecAttestationConfig_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 5177 return fpaiv.value 5178 } 5179 5180 func (fpaiv *DeviceSpecAttestationConfig_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_AttestationConfig) (interface{}, bool) { 5181 return nil, false 5182 } 5183 5184 func (fpaiv *DeviceSpecAttestationConfig_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 5185 return fpaiv.GetSingle(source.(*Device_Spec_AttestationConfig)) 5186 } 5187 5188 // Contains returns a boolean indicating if value that is being held is present in given 'AttestationConfig' 5189 func (fpaiv *DeviceSpecAttestationConfig_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_AttestationConfig) bool { 5190 slice := fpaiv.DeviceSpecAttestationConfig_FieldTerminalPath.Get(source) 5191 for _, v := range slice { 5192 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 5193 if proto.Equal(asProtoMsg, v.(proto.Message)) { 5194 return true 5195 } 5196 } else if reflect.DeepEqual(v, fpaiv.value) { 5197 return true 5198 } 5199 } 5200 return false 5201 } 5202 5203 // DeviceSpecAttestationConfig_FieldPathArrayOfValues allows storing slice of values for AttestationConfig fields according to their type 5204 type DeviceSpecAttestationConfig_FieldPathArrayOfValues interface { 5205 gotenobject.FieldPathArrayOfValues 5206 DeviceSpecAttestationConfig_FieldPath 5207 } 5208 5209 func ParseDeviceSpecAttestationConfig_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecAttestationConfig_FieldPathArrayOfValues, error) { 5210 fp, err := ParseDeviceSpecAttestationConfig_FieldPath(pathStr) 5211 if err != nil { 5212 return nil, err 5213 } 5214 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 5215 if err != nil { 5216 return nil, status.Errorf(codes.InvalidArgument, "error parsing AttestationConfig field path array of values from %s: %v", valuesStr, err) 5217 } 5218 return fpaov.(DeviceSpecAttestationConfig_FieldPathArrayOfValues), nil 5219 } 5220 5221 func MustParseDeviceSpecAttestationConfig_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecAttestationConfig_FieldPathArrayOfValues { 5222 fpaov, err := ParseDeviceSpecAttestationConfig_FieldPathArrayOfValues(pathStr, valuesStr) 5223 if err != nil { 5224 panic(err) 5225 } 5226 return fpaov 5227 } 5228 5229 type DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues struct { 5230 DeviceSpecAttestationConfig_FieldTerminalPath 5231 values interface{} 5232 } 5233 5234 var _ DeviceSpecAttestationConfig_FieldPathArrayOfValues = (*DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues)(nil) 5235 5236 func (fpaov *DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 5237 switch fpaov.selector { 5238 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationExpected: 5239 for _, v := range fpaov.values.([]bool) { 5240 values = append(values, v) 5241 } 5242 case DeviceSpecAttestationConfig_FieldPathSelectorAttestationDomain: 5243 for _, v := range fpaov.values.([]*iam_attestation_domain.Reference) { 5244 values = append(values, v) 5245 } 5246 } 5247 return 5248 } 5249 func (fpaov *DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues) AsAttestationExpectedArrayOfValues() ([]bool, bool) { 5250 res, ok := fpaov.values.([]bool) 5251 return res, ok 5252 } 5253 func (fpaov *DeviceSpecAttestationConfig_FieldTerminalPathArrayOfValues) AsAttestationDomainArrayOfValues() ([]*iam_attestation_domain.Reference, bool) { 5254 res, ok := fpaov.values.([]*iam_attestation_domain.Reference) 5255 return res, ok 5256 } 5257 5258 // FieldPath provides implementation to handle 5259 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 5260 type DeviceSpecLoggingConfig_FieldPath interface { 5261 gotenobject.FieldPath 5262 Selector() DeviceSpecLoggingConfig_FieldPathSelector 5263 Get(source *Device_Spec_LoggingConfig) []interface{} 5264 GetSingle(source *Device_Spec_LoggingConfig) (interface{}, bool) 5265 ClearValue(item *Device_Spec_LoggingConfig) 5266 5267 // Those methods build corresponding DeviceSpecLoggingConfig_FieldPathValue 5268 // (or array of values) and holds passed value. Panics if injected type is incorrect. 5269 WithIValue(value interface{}) DeviceSpecLoggingConfig_FieldPathValue 5270 WithIArrayOfValues(values interface{}) DeviceSpecLoggingConfig_FieldPathArrayOfValues 5271 WithIArrayItemValue(value interface{}) DeviceSpecLoggingConfig_FieldPathArrayItemValue 5272 } 5273 5274 type DeviceSpecLoggingConfig_FieldPathSelector int32 5275 5276 const ( 5277 DeviceSpecLoggingConfig_FieldPathSelectorPriority DeviceSpecLoggingConfig_FieldPathSelector = 0 5278 DeviceSpecLoggingConfig_FieldPathSelectorUnits DeviceSpecLoggingConfig_FieldPathSelector = 1 5279 DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport DeviceSpecLoggingConfig_FieldPathSelector = 2 5280 DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig DeviceSpecLoggingConfig_FieldPathSelector = 3 5281 ) 5282 5283 func (s DeviceSpecLoggingConfig_FieldPathSelector) String() string { 5284 switch s { 5285 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5286 return "priority" 5287 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5288 return "units" 5289 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5290 return "enable_journal_export" 5291 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5292 return "container_logging_config" 5293 default: 5294 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", s)) 5295 } 5296 } 5297 5298 func BuildDeviceSpecLoggingConfig_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecLoggingConfig_FieldPath, error) { 5299 if len(fp) == 0 { 5300 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_LoggingConfig") 5301 } 5302 if len(fp) == 1 { 5303 switch fp[0] { 5304 case "priority": 5305 return &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorPriority}, nil 5306 case "units": 5307 return &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorUnits}, nil 5308 case "enable_journal_export", "enableJournalExport", "enable-journal-export": 5309 return &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport}, nil 5310 case "container_logging_config", "containerLoggingConfig", "container-logging-config": 5311 return &DeviceSpecLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig}, nil 5312 } 5313 } else { 5314 switch fp[0] { 5315 case "container_logging_config", "containerLoggingConfig", "container-logging-config": 5316 if subpath, err := BuildDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(fp[1:]); err != nil { 5317 return nil, err 5318 } else { 5319 return &DeviceSpecLoggingConfig_FieldSubPath{selector: DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig, subPath: subpath}, nil 5320 } 5321 } 5322 } 5323 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_LoggingConfig", fp) 5324 } 5325 5326 func ParseDeviceSpecLoggingConfig_FieldPath(rawField string) (DeviceSpecLoggingConfig_FieldPath, error) { 5327 fp, err := gotenobject.ParseRawFieldPath(rawField) 5328 if err != nil { 5329 return nil, err 5330 } 5331 return BuildDeviceSpecLoggingConfig_FieldPath(fp) 5332 } 5333 5334 func MustParseDeviceSpecLoggingConfig_FieldPath(rawField string) DeviceSpecLoggingConfig_FieldPath { 5335 fp, err := ParseDeviceSpecLoggingConfig_FieldPath(rawField) 5336 if err != nil { 5337 panic(err) 5338 } 5339 return fp 5340 } 5341 5342 type DeviceSpecLoggingConfig_FieldTerminalPath struct { 5343 selector DeviceSpecLoggingConfig_FieldPathSelector 5344 } 5345 5346 var _ DeviceSpecLoggingConfig_FieldPath = (*DeviceSpecLoggingConfig_FieldTerminalPath)(nil) 5347 5348 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) Selector() DeviceSpecLoggingConfig_FieldPathSelector { 5349 return fp.selector 5350 } 5351 5352 // String returns path representation in proto convention 5353 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) String() string { 5354 return fp.selector.String() 5355 } 5356 5357 // JSONString returns path representation is JSON convention 5358 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) JSONString() string { 5359 return strcase.ToLowerCamel(fp.String()) 5360 } 5361 5362 // Get returns all values pointed by specific field from source Device_Spec_LoggingConfig 5363 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) Get(source *Device_Spec_LoggingConfig) (values []interface{}) { 5364 if source != nil { 5365 switch fp.selector { 5366 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5367 values = append(values, source.Priority) 5368 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5369 for _, value := range source.GetUnits() { 5370 values = append(values, value) 5371 } 5372 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5373 values = append(values, source.EnableJournalExport) 5374 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5375 if source.ContainerLoggingConfig != nil { 5376 values = append(values, source.ContainerLoggingConfig) 5377 } 5378 default: 5379 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5380 } 5381 } 5382 return 5383 } 5384 5385 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 5386 return fp.Get(source.(*Device_Spec_LoggingConfig)) 5387 } 5388 5389 // GetSingle returns value pointed by specific field of from source Device_Spec_LoggingConfig 5390 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) GetSingle(source *Device_Spec_LoggingConfig) (interface{}, bool) { 5391 switch fp.selector { 5392 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5393 return source.GetPriority(), source != nil 5394 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5395 res := source.GetUnits() 5396 return res, res != nil 5397 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5398 return source.GetEnableJournalExport(), source != nil 5399 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5400 res := source.GetContainerLoggingConfig() 5401 return res, res != nil 5402 default: 5403 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5404 } 5405 } 5406 5407 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5408 return fp.GetSingle(source.(*Device_Spec_LoggingConfig)) 5409 } 5410 5411 // GetDefault returns a default value of the field type 5412 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) GetDefault() interface{} { 5413 switch fp.selector { 5414 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5415 return int32(0) 5416 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5417 return ([]string)(nil) 5418 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5419 return false 5420 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5421 return (*Device_Spec_LoggingConfig_ContainerLoggingConfig)(nil) 5422 default: 5423 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5424 } 5425 } 5426 5427 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) ClearValue(item *Device_Spec_LoggingConfig) { 5428 if item != nil { 5429 switch fp.selector { 5430 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5431 item.Priority = int32(0) 5432 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5433 item.Units = nil 5434 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5435 item.EnableJournalExport = false 5436 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5437 item.ContainerLoggingConfig = nil 5438 default: 5439 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5440 } 5441 } 5442 } 5443 5444 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) ClearValueRaw(item proto.Message) { 5445 fp.ClearValue(item.(*Device_Spec_LoggingConfig)) 5446 } 5447 5448 // IsLeaf - whether field path is holds simple value 5449 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) IsLeaf() bool { 5450 return fp.selector == DeviceSpecLoggingConfig_FieldPathSelectorPriority || 5451 fp.selector == DeviceSpecLoggingConfig_FieldPathSelectorUnits || 5452 fp.selector == DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport 5453 } 5454 5455 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5456 return []gotenobject.FieldPath{fp} 5457 } 5458 5459 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecLoggingConfig_FieldPathValue { 5460 switch fp.selector { 5461 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5462 return &DeviceSpecLoggingConfig_FieldTerminalPathValue{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, value: value.(int32)} 5463 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5464 return &DeviceSpecLoggingConfig_FieldTerminalPathValue{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, value: value.([]string)} 5465 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5466 return &DeviceSpecLoggingConfig_FieldTerminalPathValue{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, value: value.(bool)} 5467 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5468 return &DeviceSpecLoggingConfig_FieldTerminalPathValue{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, value: value.(*Device_Spec_LoggingConfig_ContainerLoggingConfig)} 5469 default: 5470 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5471 } 5472 } 5473 5474 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5475 return fp.WithIValue(value) 5476 } 5477 5478 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecLoggingConfig_FieldPathArrayOfValues { 5479 fpaov := &DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfig_FieldTerminalPath: *fp} 5480 switch fp.selector { 5481 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5482 return &DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, values: values.([]int32)} 5483 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5484 return &DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, values: values.([][]string)} 5485 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5486 return &DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, values: values.([]bool)} 5487 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5488 return &DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, values: values.([]*Device_Spec_LoggingConfig_ContainerLoggingConfig)} 5489 default: 5490 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5491 } 5492 return fpaov 5493 } 5494 5495 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5496 return fp.WithIArrayOfValues(values) 5497 } 5498 5499 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecLoggingConfig_FieldPathArrayItemValue { 5500 switch fp.selector { 5501 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5502 return &DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue{DeviceSpecLoggingConfig_FieldTerminalPath: *fp, value: value.(string)} 5503 default: 5504 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fp.selector)) 5505 } 5506 } 5507 5508 func (fp *DeviceSpecLoggingConfig_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5509 return fp.WithIArrayItemValue(value) 5510 } 5511 5512 type DeviceSpecLoggingConfig_FieldSubPath struct { 5513 selector DeviceSpecLoggingConfig_FieldPathSelector 5514 subPath gotenobject.FieldPath 5515 } 5516 5517 var _ DeviceSpecLoggingConfig_FieldPath = (*DeviceSpecLoggingConfig_FieldSubPath)(nil) 5518 5519 func (fps *DeviceSpecLoggingConfig_FieldSubPath) Selector() DeviceSpecLoggingConfig_FieldPathSelector { 5520 return fps.selector 5521 } 5522 func (fps *DeviceSpecLoggingConfig_FieldSubPath) AsContainerLoggingConfigSubPath() (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath, bool) { 5523 res, ok := fps.subPath.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath) 5524 return res, ok 5525 } 5526 5527 // String returns path representation in proto convention 5528 func (fps *DeviceSpecLoggingConfig_FieldSubPath) String() string { 5529 return fps.selector.String() + "." + fps.subPath.String() 5530 } 5531 5532 // JSONString returns path representation is JSON convention 5533 func (fps *DeviceSpecLoggingConfig_FieldSubPath) JSONString() string { 5534 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 5535 } 5536 5537 // Get returns all values pointed by selected field from source Device_Spec_LoggingConfig 5538 func (fps *DeviceSpecLoggingConfig_FieldSubPath) Get(source *Device_Spec_LoggingConfig) (values []interface{}) { 5539 switch fps.selector { 5540 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5541 values = append(values, fps.subPath.GetRaw(source.GetContainerLoggingConfig())...) 5542 default: 5543 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fps.selector)) 5544 } 5545 return 5546 } 5547 5548 func (fps *DeviceSpecLoggingConfig_FieldSubPath) GetRaw(source proto.Message) []interface{} { 5549 return fps.Get(source.(*Device_Spec_LoggingConfig)) 5550 } 5551 5552 // GetSingle returns value of selected field from source Device_Spec_LoggingConfig 5553 func (fps *DeviceSpecLoggingConfig_FieldSubPath) GetSingle(source *Device_Spec_LoggingConfig) (interface{}, bool) { 5554 switch fps.selector { 5555 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5556 if source.GetContainerLoggingConfig() == nil { 5557 return nil, false 5558 } 5559 return fps.subPath.GetSingleRaw(source.GetContainerLoggingConfig()) 5560 default: 5561 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fps.selector)) 5562 } 5563 } 5564 5565 func (fps *DeviceSpecLoggingConfig_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5566 return fps.GetSingle(source.(*Device_Spec_LoggingConfig)) 5567 } 5568 5569 // GetDefault returns a default value of the field type 5570 func (fps *DeviceSpecLoggingConfig_FieldSubPath) GetDefault() interface{} { 5571 return fps.subPath.GetDefault() 5572 } 5573 5574 func (fps *DeviceSpecLoggingConfig_FieldSubPath) ClearValue(item *Device_Spec_LoggingConfig) { 5575 if item != nil { 5576 switch fps.selector { 5577 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5578 fps.subPath.ClearValueRaw(item.ContainerLoggingConfig) 5579 default: 5580 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fps.selector)) 5581 } 5582 } 5583 } 5584 5585 func (fps *DeviceSpecLoggingConfig_FieldSubPath) ClearValueRaw(item proto.Message) { 5586 fps.ClearValue(item.(*Device_Spec_LoggingConfig)) 5587 } 5588 5589 // IsLeaf - whether field path is holds simple value 5590 func (fps *DeviceSpecLoggingConfig_FieldSubPath) IsLeaf() bool { 5591 return fps.subPath.IsLeaf() 5592 } 5593 5594 func (fps *DeviceSpecLoggingConfig_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5595 iPaths := []gotenobject.FieldPath{&DeviceSpecLoggingConfig_FieldTerminalPath{selector: fps.selector}} 5596 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 5597 return iPaths 5598 } 5599 5600 func (fps *DeviceSpecLoggingConfig_FieldSubPath) WithIValue(value interface{}) DeviceSpecLoggingConfig_FieldPathValue { 5601 return &DeviceSpecLoggingConfig_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 5602 } 5603 5604 func (fps *DeviceSpecLoggingConfig_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5605 return fps.WithIValue(value) 5606 } 5607 5608 func (fps *DeviceSpecLoggingConfig_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceSpecLoggingConfig_FieldPathArrayOfValues { 5609 return &DeviceSpecLoggingConfig_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 5610 } 5611 5612 func (fps *DeviceSpecLoggingConfig_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5613 return fps.WithIArrayOfValues(values) 5614 } 5615 5616 func (fps *DeviceSpecLoggingConfig_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceSpecLoggingConfig_FieldPathArrayItemValue { 5617 return &DeviceSpecLoggingConfig_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 5618 } 5619 5620 func (fps *DeviceSpecLoggingConfig_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5621 return fps.WithIArrayItemValue(value) 5622 } 5623 5624 // DeviceSpecLoggingConfig_FieldPathValue allows storing values for LoggingConfig fields according to their type 5625 type DeviceSpecLoggingConfig_FieldPathValue interface { 5626 DeviceSpecLoggingConfig_FieldPath 5627 gotenobject.FieldPathValue 5628 SetTo(target **Device_Spec_LoggingConfig) 5629 CompareWith(*Device_Spec_LoggingConfig) (cmp int, comparable bool) 5630 } 5631 5632 func ParseDeviceSpecLoggingConfig_FieldPathValue(pathStr, valueStr string) (DeviceSpecLoggingConfig_FieldPathValue, error) { 5633 fp, err := ParseDeviceSpecLoggingConfig_FieldPath(pathStr) 5634 if err != nil { 5635 return nil, err 5636 } 5637 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 5638 if err != nil { 5639 return nil, status.Errorf(codes.InvalidArgument, "error parsing LoggingConfig field path value from %s: %v", valueStr, err) 5640 } 5641 return fpv.(DeviceSpecLoggingConfig_FieldPathValue), nil 5642 } 5643 5644 func MustParseDeviceSpecLoggingConfig_FieldPathValue(pathStr, valueStr string) DeviceSpecLoggingConfig_FieldPathValue { 5645 fpv, err := ParseDeviceSpecLoggingConfig_FieldPathValue(pathStr, valueStr) 5646 if err != nil { 5647 panic(err) 5648 } 5649 return fpv 5650 } 5651 5652 type DeviceSpecLoggingConfig_FieldTerminalPathValue struct { 5653 DeviceSpecLoggingConfig_FieldTerminalPath 5654 value interface{} 5655 } 5656 5657 var _ DeviceSpecLoggingConfig_FieldPathValue = (*DeviceSpecLoggingConfig_FieldTerminalPathValue)(nil) 5658 5659 // GetRawValue returns raw value stored under selected path for 'LoggingConfig' as interface{} 5660 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) GetRawValue() interface{} { 5661 return fpv.value 5662 } 5663 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) AsPriorityValue() (int32, bool) { 5664 res, ok := fpv.value.(int32) 5665 return res, ok 5666 } 5667 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) AsUnitsValue() ([]string, bool) { 5668 res, ok := fpv.value.([]string) 5669 return res, ok 5670 } 5671 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) AsEnableJournalExportValue() (bool, bool) { 5672 res, ok := fpv.value.(bool) 5673 return res, ok 5674 } 5675 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) AsContainerLoggingConfigValue() (*Device_Spec_LoggingConfig_ContainerLoggingConfig, bool) { 5676 res, ok := fpv.value.(*Device_Spec_LoggingConfig_ContainerLoggingConfig) 5677 return res, ok 5678 } 5679 5680 // SetTo stores value for selected field for object LoggingConfig 5681 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) SetTo(target **Device_Spec_LoggingConfig) { 5682 if *target == nil { 5683 *target = new(Device_Spec_LoggingConfig) 5684 } 5685 switch fpv.selector { 5686 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5687 (*target).Priority = fpv.value.(int32) 5688 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5689 (*target).Units = fpv.value.([]string) 5690 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5691 (*target).EnableJournalExport = fpv.value.(bool) 5692 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5693 (*target).ContainerLoggingConfig = fpv.value.(*Device_Spec_LoggingConfig_ContainerLoggingConfig) 5694 default: 5695 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fpv.selector)) 5696 } 5697 } 5698 5699 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) SetToRaw(target proto.Message) { 5700 typedObject := target.(*Device_Spec_LoggingConfig) 5701 fpv.SetTo(&typedObject) 5702 } 5703 5704 // CompareWith compares value in the 'DeviceSpecLoggingConfig_FieldTerminalPathValue' with the value under path in 'Device_Spec_LoggingConfig'. 5705 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) CompareWith(source *Device_Spec_LoggingConfig) (int, bool) { 5706 switch fpv.selector { 5707 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5708 leftValue := fpv.value.(int32) 5709 rightValue := source.GetPriority() 5710 if (leftValue) == (rightValue) { 5711 return 0, true 5712 } else if (leftValue) < (rightValue) { 5713 return -1, true 5714 } else { 5715 return 1, true 5716 } 5717 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5718 return 0, false 5719 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5720 leftValue := fpv.value.(bool) 5721 rightValue := source.GetEnableJournalExport() 5722 if (leftValue) == (rightValue) { 5723 return 0, true 5724 } else if !(leftValue) && (rightValue) { 5725 return -1, true 5726 } else { 5727 return 1, true 5728 } 5729 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5730 return 0, false 5731 default: 5732 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fpv.selector)) 5733 } 5734 } 5735 5736 func (fpv *DeviceSpecLoggingConfig_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5737 return fpv.CompareWith(source.(*Device_Spec_LoggingConfig)) 5738 } 5739 5740 type DeviceSpecLoggingConfig_FieldSubPathValue struct { 5741 DeviceSpecLoggingConfig_FieldPath 5742 subPathValue gotenobject.FieldPathValue 5743 } 5744 5745 var _ DeviceSpecLoggingConfig_FieldPathValue = (*DeviceSpecLoggingConfig_FieldSubPathValue)(nil) 5746 5747 func (fpvs *DeviceSpecLoggingConfig_FieldSubPathValue) AsContainerLoggingConfigPathValue() (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue, bool) { 5748 res, ok := fpvs.subPathValue.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue) 5749 return res, ok 5750 } 5751 5752 func (fpvs *DeviceSpecLoggingConfig_FieldSubPathValue) SetTo(target **Device_Spec_LoggingConfig) { 5753 if *target == nil { 5754 *target = new(Device_Spec_LoggingConfig) 5755 } 5756 switch fpvs.Selector() { 5757 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5758 fpvs.subPathValue.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue).SetTo(&(*target).ContainerLoggingConfig) 5759 default: 5760 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fpvs.Selector())) 5761 } 5762 } 5763 5764 func (fpvs *DeviceSpecLoggingConfig_FieldSubPathValue) SetToRaw(target proto.Message) { 5765 typedObject := target.(*Device_Spec_LoggingConfig) 5766 fpvs.SetTo(&typedObject) 5767 } 5768 5769 func (fpvs *DeviceSpecLoggingConfig_FieldSubPathValue) GetRawValue() interface{} { 5770 return fpvs.subPathValue.GetRawValue() 5771 } 5772 5773 func (fpvs *DeviceSpecLoggingConfig_FieldSubPathValue) CompareWith(source *Device_Spec_LoggingConfig) (int, bool) { 5774 switch fpvs.Selector() { 5775 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5776 return fpvs.subPathValue.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue).CompareWith(source.GetContainerLoggingConfig()) 5777 default: 5778 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fpvs.Selector())) 5779 } 5780 } 5781 5782 func (fpvs *DeviceSpecLoggingConfig_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5783 return fpvs.CompareWith(source.(*Device_Spec_LoggingConfig)) 5784 } 5785 5786 // DeviceSpecLoggingConfig_FieldPathArrayItemValue allows storing single item in Path-specific values for LoggingConfig according to their type 5787 // Present only for array (repeated) types. 5788 type DeviceSpecLoggingConfig_FieldPathArrayItemValue interface { 5789 gotenobject.FieldPathArrayItemValue 5790 DeviceSpecLoggingConfig_FieldPath 5791 ContainsValue(*Device_Spec_LoggingConfig) bool 5792 } 5793 5794 // ParseDeviceSpecLoggingConfig_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 5795 func ParseDeviceSpecLoggingConfig_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecLoggingConfig_FieldPathArrayItemValue, error) { 5796 fp, err := ParseDeviceSpecLoggingConfig_FieldPath(pathStr) 5797 if err != nil { 5798 return nil, err 5799 } 5800 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 5801 if err != nil { 5802 return nil, status.Errorf(codes.InvalidArgument, "error parsing LoggingConfig field path array item value from %s: %v", valueStr, err) 5803 } 5804 return fpaiv.(DeviceSpecLoggingConfig_FieldPathArrayItemValue), nil 5805 } 5806 5807 func MustParseDeviceSpecLoggingConfig_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecLoggingConfig_FieldPathArrayItemValue { 5808 fpaiv, err := ParseDeviceSpecLoggingConfig_FieldPathArrayItemValue(pathStr, valueStr) 5809 if err != nil { 5810 panic(err) 5811 } 5812 return fpaiv 5813 } 5814 5815 type DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue struct { 5816 DeviceSpecLoggingConfig_FieldTerminalPath 5817 value interface{} 5818 } 5819 5820 var _ DeviceSpecLoggingConfig_FieldPathArrayItemValue = (*DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue)(nil) 5821 5822 // GetRawValue returns stored element value for array in object Device_Spec_LoggingConfig as interface{} 5823 func (fpaiv *DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 5824 return fpaiv.value 5825 } 5826 func (fpaiv *DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue) AsUnitsItemValue() (string, bool) { 5827 res, ok := fpaiv.value.(string) 5828 return res, ok 5829 } 5830 5831 func (fpaiv *DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_LoggingConfig) (interface{}, bool) { 5832 return nil, false 5833 } 5834 5835 func (fpaiv *DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 5836 return fpaiv.GetSingle(source.(*Device_Spec_LoggingConfig)) 5837 } 5838 5839 // Contains returns a boolean indicating if value that is being held is present in given 'LoggingConfig' 5840 func (fpaiv *DeviceSpecLoggingConfig_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_LoggingConfig) bool { 5841 slice := fpaiv.DeviceSpecLoggingConfig_FieldTerminalPath.Get(source) 5842 for _, v := range slice { 5843 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 5844 if proto.Equal(asProtoMsg, v.(proto.Message)) { 5845 return true 5846 } 5847 } else if reflect.DeepEqual(v, fpaiv.value) { 5848 return true 5849 } 5850 } 5851 return false 5852 } 5853 5854 type DeviceSpecLoggingConfig_FieldSubPathArrayItemValue struct { 5855 DeviceSpecLoggingConfig_FieldPath 5856 subPathItemValue gotenobject.FieldPathArrayItemValue 5857 } 5858 5859 // GetRawValue returns stored array item value 5860 func (fpaivs *DeviceSpecLoggingConfig_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 5861 return fpaivs.subPathItemValue.GetRawItemValue() 5862 } 5863 func (fpaivs *DeviceSpecLoggingConfig_FieldSubPathArrayItemValue) AsContainerLoggingConfigPathItemValue() (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue, bool) { 5864 res, ok := fpaivs.subPathItemValue.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue) 5865 return res, ok 5866 } 5867 5868 // Contains returns a boolean indicating if value that is being held is present in given 'LoggingConfig' 5869 func (fpaivs *DeviceSpecLoggingConfig_FieldSubPathArrayItemValue) ContainsValue(source *Device_Spec_LoggingConfig) bool { 5870 switch fpaivs.Selector() { 5871 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5872 return fpaivs.subPathItemValue.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue).ContainsValue(source.GetContainerLoggingConfig()) 5873 default: 5874 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig: %d", fpaivs.Selector())) 5875 } 5876 } 5877 5878 // DeviceSpecLoggingConfig_FieldPathArrayOfValues allows storing slice of values for LoggingConfig fields according to their type 5879 type DeviceSpecLoggingConfig_FieldPathArrayOfValues interface { 5880 gotenobject.FieldPathArrayOfValues 5881 DeviceSpecLoggingConfig_FieldPath 5882 } 5883 5884 func ParseDeviceSpecLoggingConfig_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecLoggingConfig_FieldPathArrayOfValues, error) { 5885 fp, err := ParseDeviceSpecLoggingConfig_FieldPath(pathStr) 5886 if err != nil { 5887 return nil, err 5888 } 5889 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 5890 if err != nil { 5891 return nil, status.Errorf(codes.InvalidArgument, "error parsing LoggingConfig field path array of values from %s: %v", valuesStr, err) 5892 } 5893 return fpaov.(DeviceSpecLoggingConfig_FieldPathArrayOfValues), nil 5894 } 5895 5896 func MustParseDeviceSpecLoggingConfig_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecLoggingConfig_FieldPathArrayOfValues { 5897 fpaov, err := ParseDeviceSpecLoggingConfig_FieldPathArrayOfValues(pathStr, valuesStr) 5898 if err != nil { 5899 panic(err) 5900 } 5901 return fpaov 5902 } 5903 5904 type DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues struct { 5905 DeviceSpecLoggingConfig_FieldTerminalPath 5906 values interface{} 5907 } 5908 5909 var _ DeviceSpecLoggingConfig_FieldPathArrayOfValues = (*DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues)(nil) 5910 5911 func (fpaov *DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 5912 switch fpaov.selector { 5913 case DeviceSpecLoggingConfig_FieldPathSelectorPriority: 5914 for _, v := range fpaov.values.([]int32) { 5915 values = append(values, v) 5916 } 5917 case DeviceSpecLoggingConfig_FieldPathSelectorUnits: 5918 for _, v := range fpaov.values.([][]string) { 5919 values = append(values, v) 5920 } 5921 case DeviceSpecLoggingConfig_FieldPathSelectorEnableJournalExport: 5922 for _, v := range fpaov.values.([]bool) { 5923 values = append(values, v) 5924 } 5925 case DeviceSpecLoggingConfig_FieldPathSelectorContainerLoggingConfig: 5926 for _, v := range fpaov.values.([]*Device_Spec_LoggingConfig_ContainerLoggingConfig) { 5927 values = append(values, v) 5928 } 5929 } 5930 return 5931 } 5932 func (fpaov *DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues) AsPriorityArrayOfValues() ([]int32, bool) { 5933 res, ok := fpaov.values.([]int32) 5934 return res, ok 5935 } 5936 func (fpaov *DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues) AsUnitsArrayOfValues() ([][]string, bool) { 5937 res, ok := fpaov.values.([][]string) 5938 return res, ok 5939 } 5940 func (fpaov *DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues) AsEnableJournalExportArrayOfValues() ([]bool, bool) { 5941 res, ok := fpaov.values.([]bool) 5942 return res, ok 5943 } 5944 func (fpaov *DeviceSpecLoggingConfig_FieldTerminalPathArrayOfValues) AsContainerLoggingConfigArrayOfValues() ([]*Device_Spec_LoggingConfig_ContainerLoggingConfig, bool) { 5945 res, ok := fpaov.values.([]*Device_Spec_LoggingConfig_ContainerLoggingConfig) 5946 return res, ok 5947 } 5948 5949 type DeviceSpecLoggingConfig_FieldSubPathArrayOfValues struct { 5950 DeviceSpecLoggingConfig_FieldPath 5951 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 5952 } 5953 5954 var _ DeviceSpecLoggingConfig_FieldPathArrayOfValues = (*DeviceSpecLoggingConfig_FieldSubPathArrayOfValues)(nil) 5955 5956 func (fpsaov *DeviceSpecLoggingConfig_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 5957 return fpsaov.subPathArrayOfValues.GetRawValues() 5958 } 5959 func (fpsaov *DeviceSpecLoggingConfig_FieldSubPathArrayOfValues) AsContainerLoggingConfigPathArrayOfValues() (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues, bool) { 5960 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues) 5961 return res, ok 5962 } 5963 5964 // FieldPath provides implementation to handle 5965 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 5966 type DeviceSpecProxyConfig_FieldPath interface { 5967 gotenobject.FieldPath 5968 Selector() DeviceSpecProxyConfig_FieldPathSelector 5969 Get(source *Device_Spec_ProxyConfig) []interface{} 5970 GetSingle(source *Device_Spec_ProxyConfig) (interface{}, bool) 5971 ClearValue(item *Device_Spec_ProxyConfig) 5972 5973 // Those methods build corresponding DeviceSpecProxyConfig_FieldPathValue 5974 // (or array of values) and holds passed value. Panics if injected type is incorrect. 5975 WithIValue(value interface{}) DeviceSpecProxyConfig_FieldPathValue 5976 WithIArrayOfValues(values interface{}) DeviceSpecProxyConfig_FieldPathArrayOfValues 5977 WithIArrayItemValue(value interface{}) DeviceSpecProxyConfig_FieldPathArrayItemValue 5978 } 5979 5980 type DeviceSpecProxyConfig_FieldPathSelector int32 5981 5982 const ( 5983 DeviceSpecProxyConfig_FieldPathSelectorHttpProxy DeviceSpecProxyConfig_FieldPathSelector = 0 5984 DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy DeviceSpecProxyConfig_FieldPathSelector = 1 5985 DeviceSpecProxyConfig_FieldPathSelectorNoProxy DeviceSpecProxyConfig_FieldPathSelector = 2 5986 DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces DeviceSpecProxyConfig_FieldPathSelector = 3 5987 ) 5988 5989 func (s DeviceSpecProxyConfig_FieldPathSelector) String() string { 5990 switch s { 5991 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 5992 return "http_proxy" 5993 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 5994 return "https_proxy" 5995 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 5996 return "no_proxy" 5997 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 5998 return "proxy_interfaces" 5999 default: 6000 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", s)) 6001 } 6002 } 6003 6004 func BuildDeviceSpecProxyConfig_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecProxyConfig_FieldPath, error) { 6005 if len(fp) == 0 { 6006 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_ProxyConfig") 6007 } 6008 if len(fp) == 1 { 6009 switch fp[0] { 6010 case "http_proxy", "httpProxy", "http-proxy": 6011 return &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorHttpProxy}, nil 6012 case "https_proxy", "httpsProxy", "https-proxy": 6013 return &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy}, nil 6014 case "no_proxy", "noProxy", "no-proxy": 6015 return &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorNoProxy}, nil 6016 case "proxy_interfaces", "proxyInterfaces", "proxy-interfaces": 6017 return &DeviceSpecProxyConfig_FieldTerminalPath{selector: DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces}, nil 6018 } 6019 } 6020 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_ProxyConfig", fp) 6021 } 6022 6023 func ParseDeviceSpecProxyConfig_FieldPath(rawField string) (DeviceSpecProxyConfig_FieldPath, error) { 6024 fp, err := gotenobject.ParseRawFieldPath(rawField) 6025 if err != nil { 6026 return nil, err 6027 } 6028 return BuildDeviceSpecProxyConfig_FieldPath(fp) 6029 } 6030 6031 func MustParseDeviceSpecProxyConfig_FieldPath(rawField string) DeviceSpecProxyConfig_FieldPath { 6032 fp, err := ParseDeviceSpecProxyConfig_FieldPath(rawField) 6033 if err != nil { 6034 panic(err) 6035 } 6036 return fp 6037 } 6038 6039 type DeviceSpecProxyConfig_FieldTerminalPath struct { 6040 selector DeviceSpecProxyConfig_FieldPathSelector 6041 } 6042 6043 var _ DeviceSpecProxyConfig_FieldPath = (*DeviceSpecProxyConfig_FieldTerminalPath)(nil) 6044 6045 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) Selector() DeviceSpecProxyConfig_FieldPathSelector { 6046 return fp.selector 6047 } 6048 6049 // String returns path representation in proto convention 6050 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) String() string { 6051 return fp.selector.String() 6052 } 6053 6054 // JSONString returns path representation is JSON convention 6055 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) JSONString() string { 6056 return strcase.ToLowerCamel(fp.String()) 6057 } 6058 6059 // Get returns all values pointed by specific field from source Device_Spec_ProxyConfig 6060 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) Get(source *Device_Spec_ProxyConfig) (values []interface{}) { 6061 if source != nil { 6062 switch fp.selector { 6063 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6064 values = append(values, source.HttpProxy) 6065 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6066 values = append(values, source.HttpsProxy) 6067 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6068 values = append(values, source.NoProxy) 6069 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6070 for _, value := range source.GetProxyInterfaces() { 6071 values = append(values, value) 6072 } 6073 default: 6074 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6075 } 6076 } 6077 return 6078 } 6079 6080 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 6081 return fp.Get(source.(*Device_Spec_ProxyConfig)) 6082 } 6083 6084 // GetSingle returns value pointed by specific field of from source Device_Spec_ProxyConfig 6085 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) GetSingle(source *Device_Spec_ProxyConfig) (interface{}, bool) { 6086 switch fp.selector { 6087 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6088 return source.GetHttpProxy(), source != nil 6089 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6090 return source.GetHttpsProxy(), source != nil 6091 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6092 return source.GetNoProxy(), source != nil 6093 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6094 res := source.GetProxyInterfaces() 6095 return res, res != nil 6096 default: 6097 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6098 } 6099 } 6100 6101 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6102 return fp.GetSingle(source.(*Device_Spec_ProxyConfig)) 6103 } 6104 6105 // GetDefault returns a default value of the field type 6106 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) GetDefault() interface{} { 6107 switch fp.selector { 6108 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6109 return "" 6110 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6111 return "" 6112 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6113 return "" 6114 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6115 return ([]string)(nil) 6116 default: 6117 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6118 } 6119 } 6120 6121 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) ClearValue(item *Device_Spec_ProxyConfig) { 6122 if item != nil { 6123 switch fp.selector { 6124 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6125 item.HttpProxy = "" 6126 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6127 item.HttpsProxy = "" 6128 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6129 item.NoProxy = "" 6130 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6131 item.ProxyInterfaces = nil 6132 default: 6133 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6134 } 6135 } 6136 } 6137 6138 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) ClearValueRaw(item proto.Message) { 6139 fp.ClearValue(item.(*Device_Spec_ProxyConfig)) 6140 } 6141 6142 // IsLeaf - whether field path is holds simple value 6143 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) IsLeaf() bool { 6144 return fp.selector == DeviceSpecProxyConfig_FieldPathSelectorHttpProxy || 6145 fp.selector == DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy || 6146 fp.selector == DeviceSpecProxyConfig_FieldPathSelectorNoProxy || 6147 fp.selector == DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces 6148 } 6149 6150 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6151 return []gotenobject.FieldPath{fp} 6152 } 6153 6154 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecProxyConfig_FieldPathValue { 6155 switch fp.selector { 6156 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6157 return &DeviceSpecProxyConfig_FieldTerminalPathValue{DeviceSpecProxyConfig_FieldTerminalPath: *fp, value: value.(string)} 6158 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6159 return &DeviceSpecProxyConfig_FieldTerminalPathValue{DeviceSpecProxyConfig_FieldTerminalPath: *fp, value: value.(string)} 6160 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6161 return &DeviceSpecProxyConfig_FieldTerminalPathValue{DeviceSpecProxyConfig_FieldTerminalPath: *fp, value: value.(string)} 6162 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6163 return &DeviceSpecProxyConfig_FieldTerminalPathValue{DeviceSpecProxyConfig_FieldTerminalPath: *fp, value: value.([]string)} 6164 default: 6165 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6166 } 6167 } 6168 6169 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6170 return fp.WithIValue(value) 6171 } 6172 6173 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecProxyConfig_FieldPathArrayOfValues { 6174 fpaov := &DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues{DeviceSpecProxyConfig_FieldTerminalPath: *fp} 6175 switch fp.selector { 6176 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6177 return &DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues{DeviceSpecProxyConfig_FieldTerminalPath: *fp, values: values.([]string)} 6178 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6179 return &DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues{DeviceSpecProxyConfig_FieldTerminalPath: *fp, values: values.([]string)} 6180 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6181 return &DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues{DeviceSpecProxyConfig_FieldTerminalPath: *fp, values: values.([]string)} 6182 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6183 return &DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues{DeviceSpecProxyConfig_FieldTerminalPath: *fp, values: values.([][]string)} 6184 default: 6185 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6186 } 6187 return fpaov 6188 } 6189 6190 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6191 return fp.WithIArrayOfValues(values) 6192 } 6193 6194 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecProxyConfig_FieldPathArrayItemValue { 6195 switch fp.selector { 6196 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6197 return &DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue{DeviceSpecProxyConfig_FieldTerminalPath: *fp, value: value.(string)} 6198 default: 6199 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fp.selector)) 6200 } 6201 } 6202 6203 func (fp *DeviceSpecProxyConfig_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6204 return fp.WithIArrayItemValue(value) 6205 } 6206 6207 // DeviceSpecProxyConfig_FieldPathValue allows storing values for ProxyConfig fields according to their type 6208 type DeviceSpecProxyConfig_FieldPathValue interface { 6209 DeviceSpecProxyConfig_FieldPath 6210 gotenobject.FieldPathValue 6211 SetTo(target **Device_Spec_ProxyConfig) 6212 CompareWith(*Device_Spec_ProxyConfig) (cmp int, comparable bool) 6213 } 6214 6215 func ParseDeviceSpecProxyConfig_FieldPathValue(pathStr, valueStr string) (DeviceSpecProxyConfig_FieldPathValue, error) { 6216 fp, err := ParseDeviceSpecProxyConfig_FieldPath(pathStr) 6217 if err != nil { 6218 return nil, err 6219 } 6220 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 6221 if err != nil { 6222 return nil, status.Errorf(codes.InvalidArgument, "error parsing ProxyConfig field path value from %s: %v", valueStr, err) 6223 } 6224 return fpv.(DeviceSpecProxyConfig_FieldPathValue), nil 6225 } 6226 6227 func MustParseDeviceSpecProxyConfig_FieldPathValue(pathStr, valueStr string) DeviceSpecProxyConfig_FieldPathValue { 6228 fpv, err := ParseDeviceSpecProxyConfig_FieldPathValue(pathStr, valueStr) 6229 if err != nil { 6230 panic(err) 6231 } 6232 return fpv 6233 } 6234 6235 type DeviceSpecProxyConfig_FieldTerminalPathValue struct { 6236 DeviceSpecProxyConfig_FieldTerminalPath 6237 value interface{} 6238 } 6239 6240 var _ DeviceSpecProxyConfig_FieldPathValue = (*DeviceSpecProxyConfig_FieldTerminalPathValue)(nil) 6241 6242 // GetRawValue returns raw value stored under selected path for 'ProxyConfig' as interface{} 6243 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) GetRawValue() interface{} { 6244 return fpv.value 6245 } 6246 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) AsHttpProxyValue() (string, bool) { 6247 res, ok := fpv.value.(string) 6248 return res, ok 6249 } 6250 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) AsHttpsProxyValue() (string, bool) { 6251 res, ok := fpv.value.(string) 6252 return res, ok 6253 } 6254 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) AsNoProxyValue() (string, bool) { 6255 res, ok := fpv.value.(string) 6256 return res, ok 6257 } 6258 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) AsProxyInterfacesValue() ([]string, bool) { 6259 res, ok := fpv.value.([]string) 6260 return res, ok 6261 } 6262 6263 // SetTo stores value for selected field for object ProxyConfig 6264 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) SetTo(target **Device_Spec_ProxyConfig) { 6265 if *target == nil { 6266 *target = new(Device_Spec_ProxyConfig) 6267 } 6268 switch fpv.selector { 6269 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6270 (*target).HttpProxy = fpv.value.(string) 6271 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6272 (*target).HttpsProxy = fpv.value.(string) 6273 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6274 (*target).NoProxy = fpv.value.(string) 6275 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6276 (*target).ProxyInterfaces = fpv.value.([]string) 6277 default: 6278 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fpv.selector)) 6279 } 6280 } 6281 6282 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) SetToRaw(target proto.Message) { 6283 typedObject := target.(*Device_Spec_ProxyConfig) 6284 fpv.SetTo(&typedObject) 6285 } 6286 6287 // CompareWith compares value in the 'DeviceSpecProxyConfig_FieldTerminalPathValue' with the value under path in 'Device_Spec_ProxyConfig'. 6288 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) CompareWith(source *Device_Spec_ProxyConfig) (int, bool) { 6289 switch fpv.selector { 6290 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6291 leftValue := fpv.value.(string) 6292 rightValue := source.GetHttpProxy() 6293 if (leftValue) == (rightValue) { 6294 return 0, true 6295 } else if (leftValue) < (rightValue) { 6296 return -1, true 6297 } else { 6298 return 1, true 6299 } 6300 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6301 leftValue := fpv.value.(string) 6302 rightValue := source.GetHttpsProxy() 6303 if (leftValue) == (rightValue) { 6304 return 0, true 6305 } else if (leftValue) < (rightValue) { 6306 return -1, true 6307 } else { 6308 return 1, true 6309 } 6310 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6311 leftValue := fpv.value.(string) 6312 rightValue := source.GetNoProxy() 6313 if (leftValue) == (rightValue) { 6314 return 0, true 6315 } else if (leftValue) < (rightValue) { 6316 return -1, true 6317 } else { 6318 return 1, true 6319 } 6320 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6321 return 0, false 6322 default: 6323 panic(fmt.Sprintf("Invalid selector for Device_Spec_ProxyConfig: %d", fpv.selector)) 6324 } 6325 } 6326 6327 func (fpv *DeviceSpecProxyConfig_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6328 return fpv.CompareWith(source.(*Device_Spec_ProxyConfig)) 6329 } 6330 6331 // DeviceSpecProxyConfig_FieldPathArrayItemValue allows storing single item in Path-specific values for ProxyConfig according to their type 6332 // Present only for array (repeated) types. 6333 type DeviceSpecProxyConfig_FieldPathArrayItemValue interface { 6334 gotenobject.FieldPathArrayItemValue 6335 DeviceSpecProxyConfig_FieldPath 6336 ContainsValue(*Device_Spec_ProxyConfig) bool 6337 } 6338 6339 // ParseDeviceSpecProxyConfig_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 6340 func ParseDeviceSpecProxyConfig_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecProxyConfig_FieldPathArrayItemValue, error) { 6341 fp, err := ParseDeviceSpecProxyConfig_FieldPath(pathStr) 6342 if err != nil { 6343 return nil, err 6344 } 6345 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 6346 if err != nil { 6347 return nil, status.Errorf(codes.InvalidArgument, "error parsing ProxyConfig field path array item value from %s: %v", valueStr, err) 6348 } 6349 return fpaiv.(DeviceSpecProxyConfig_FieldPathArrayItemValue), nil 6350 } 6351 6352 func MustParseDeviceSpecProxyConfig_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecProxyConfig_FieldPathArrayItemValue { 6353 fpaiv, err := ParseDeviceSpecProxyConfig_FieldPathArrayItemValue(pathStr, valueStr) 6354 if err != nil { 6355 panic(err) 6356 } 6357 return fpaiv 6358 } 6359 6360 type DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue struct { 6361 DeviceSpecProxyConfig_FieldTerminalPath 6362 value interface{} 6363 } 6364 6365 var _ DeviceSpecProxyConfig_FieldPathArrayItemValue = (*DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue)(nil) 6366 6367 // GetRawValue returns stored element value for array in object Device_Spec_ProxyConfig as interface{} 6368 func (fpaiv *DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 6369 return fpaiv.value 6370 } 6371 func (fpaiv *DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue) AsProxyInterfacesItemValue() (string, bool) { 6372 res, ok := fpaiv.value.(string) 6373 return res, ok 6374 } 6375 6376 func (fpaiv *DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_ProxyConfig) (interface{}, bool) { 6377 return nil, false 6378 } 6379 6380 func (fpaiv *DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 6381 return fpaiv.GetSingle(source.(*Device_Spec_ProxyConfig)) 6382 } 6383 6384 // Contains returns a boolean indicating if value that is being held is present in given 'ProxyConfig' 6385 func (fpaiv *DeviceSpecProxyConfig_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_ProxyConfig) bool { 6386 slice := fpaiv.DeviceSpecProxyConfig_FieldTerminalPath.Get(source) 6387 for _, v := range slice { 6388 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 6389 if proto.Equal(asProtoMsg, v.(proto.Message)) { 6390 return true 6391 } 6392 } else if reflect.DeepEqual(v, fpaiv.value) { 6393 return true 6394 } 6395 } 6396 return false 6397 } 6398 6399 // DeviceSpecProxyConfig_FieldPathArrayOfValues allows storing slice of values for ProxyConfig fields according to their type 6400 type DeviceSpecProxyConfig_FieldPathArrayOfValues interface { 6401 gotenobject.FieldPathArrayOfValues 6402 DeviceSpecProxyConfig_FieldPath 6403 } 6404 6405 func ParseDeviceSpecProxyConfig_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecProxyConfig_FieldPathArrayOfValues, error) { 6406 fp, err := ParseDeviceSpecProxyConfig_FieldPath(pathStr) 6407 if err != nil { 6408 return nil, err 6409 } 6410 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 6411 if err != nil { 6412 return nil, status.Errorf(codes.InvalidArgument, "error parsing ProxyConfig field path array of values from %s: %v", valuesStr, err) 6413 } 6414 return fpaov.(DeviceSpecProxyConfig_FieldPathArrayOfValues), nil 6415 } 6416 6417 func MustParseDeviceSpecProxyConfig_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecProxyConfig_FieldPathArrayOfValues { 6418 fpaov, err := ParseDeviceSpecProxyConfig_FieldPathArrayOfValues(pathStr, valuesStr) 6419 if err != nil { 6420 panic(err) 6421 } 6422 return fpaov 6423 } 6424 6425 type DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues struct { 6426 DeviceSpecProxyConfig_FieldTerminalPath 6427 values interface{} 6428 } 6429 6430 var _ DeviceSpecProxyConfig_FieldPathArrayOfValues = (*DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues)(nil) 6431 6432 func (fpaov *DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 6433 switch fpaov.selector { 6434 case DeviceSpecProxyConfig_FieldPathSelectorHttpProxy: 6435 for _, v := range fpaov.values.([]string) { 6436 values = append(values, v) 6437 } 6438 case DeviceSpecProxyConfig_FieldPathSelectorHttpsProxy: 6439 for _, v := range fpaov.values.([]string) { 6440 values = append(values, v) 6441 } 6442 case DeviceSpecProxyConfig_FieldPathSelectorNoProxy: 6443 for _, v := range fpaov.values.([]string) { 6444 values = append(values, v) 6445 } 6446 case DeviceSpecProxyConfig_FieldPathSelectorProxyInterfaces: 6447 for _, v := range fpaov.values.([][]string) { 6448 values = append(values, v) 6449 } 6450 } 6451 return 6452 } 6453 func (fpaov *DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues) AsHttpProxyArrayOfValues() ([]string, bool) { 6454 res, ok := fpaov.values.([]string) 6455 return res, ok 6456 } 6457 func (fpaov *DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues) AsHttpsProxyArrayOfValues() ([]string, bool) { 6458 res, ok := fpaov.values.([]string) 6459 return res, ok 6460 } 6461 func (fpaov *DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues) AsNoProxyArrayOfValues() ([]string, bool) { 6462 res, ok := fpaov.values.([]string) 6463 return res, ok 6464 } 6465 func (fpaov *DeviceSpecProxyConfig_FieldTerminalPathArrayOfValues) AsProxyInterfacesArrayOfValues() ([][]string, bool) { 6466 res, ok := fpaov.values.([][]string) 6467 return res, ok 6468 } 6469 6470 // FieldPath provides implementation to handle 6471 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 6472 type DeviceSpecLocation_FieldPath interface { 6473 gotenobject.FieldPath 6474 Selector() DeviceSpecLocation_FieldPathSelector 6475 Get(source *Device_Spec_Location) []interface{} 6476 GetSingle(source *Device_Spec_Location) (interface{}, bool) 6477 ClearValue(item *Device_Spec_Location) 6478 6479 // Those methods build corresponding DeviceSpecLocation_FieldPathValue 6480 // (or array of values) and holds passed value. Panics if injected type is incorrect. 6481 WithIValue(value interface{}) DeviceSpecLocation_FieldPathValue 6482 WithIArrayOfValues(values interface{}) DeviceSpecLocation_FieldPathArrayOfValues 6483 WithIArrayItemValue(value interface{}) DeviceSpecLocation_FieldPathArrayItemValue 6484 } 6485 6486 type DeviceSpecLocation_FieldPathSelector int32 6487 6488 const ( 6489 DeviceSpecLocation_FieldPathSelectorAddress DeviceSpecLocation_FieldPathSelector = 0 6490 DeviceSpecLocation_FieldPathSelectorPlacement DeviceSpecLocation_FieldPathSelector = 1 6491 ) 6492 6493 func (s DeviceSpecLocation_FieldPathSelector) String() string { 6494 switch s { 6495 case DeviceSpecLocation_FieldPathSelectorAddress: 6496 return "address" 6497 case DeviceSpecLocation_FieldPathSelectorPlacement: 6498 return "placement" 6499 default: 6500 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", s)) 6501 } 6502 } 6503 6504 func BuildDeviceSpecLocation_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecLocation_FieldPath, error) { 6505 if len(fp) == 0 { 6506 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_Location") 6507 } 6508 if len(fp) == 1 { 6509 switch fp[0] { 6510 case "address": 6511 return &DeviceSpecLocation_FieldTerminalPath{selector: DeviceSpecLocation_FieldPathSelectorAddress}, nil 6512 case "placement": 6513 return &DeviceSpecLocation_FieldTerminalPath{selector: DeviceSpecLocation_FieldPathSelectorPlacement}, nil 6514 } 6515 } 6516 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_Location", fp) 6517 } 6518 6519 func ParseDeviceSpecLocation_FieldPath(rawField string) (DeviceSpecLocation_FieldPath, error) { 6520 fp, err := gotenobject.ParseRawFieldPath(rawField) 6521 if err != nil { 6522 return nil, err 6523 } 6524 return BuildDeviceSpecLocation_FieldPath(fp) 6525 } 6526 6527 func MustParseDeviceSpecLocation_FieldPath(rawField string) DeviceSpecLocation_FieldPath { 6528 fp, err := ParseDeviceSpecLocation_FieldPath(rawField) 6529 if err != nil { 6530 panic(err) 6531 } 6532 return fp 6533 } 6534 6535 type DeviceSpecLocation_FieldTerminalPath struct { 6536 selector DeviceSpecLocation_FieldPathSelector 6537 } 6538 6539 var _ DeviceSpecLocation_FieldPath = (*DeviceSpecLocation_FieldTerminalPath)(nil) 6540 6541 func (fp *DeviceSpecLocation_FieldTerminalPath) Selector() DeviceSpecLocation_FieldPathSelector { 6542 return fp.selector 6543 } 6544 6545 // String returns path representation in proto convention 6546 func (fp *DeviceSpecLocation_FieldTerminalPath) String() string { 6547 return fp.selector.String() 6548 } 6549 6550 // JSONString returns path representation is JSON convention 6551 func (fp *DeviceSpecLocation_FieldTerminalPath) JSONString() string { 6552 return strcase.ToLowerCamel(fp.String()) 6553 } 6554 6555 // Get returns all values pointed by specific field from source Device_Spec_Location 6556 func (fp *DeviceSpecLocation_FieldTerminalPath) Get(source *Device_Spec_Location) (values []interface{}) { 6557 if source != nil { 6558 switch fp.selector { 6559 case DeviceSpecLocation_FieldPathSelectorAddress: 6560 values = append(values, source.Address) 6561 case DeviceSpecLocation_FieldPathSelectorPlacement: 6562 values = append(values, source.Placement) 6563 default: 6564 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6565 } 6566 } 6567 return 6568 } 6569 6570 func (fp *DeviceSpecLocation_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 6571 return fp.Get(source.(*Device_Spec_Location)) 6572 } 6573 6574 // GetSingle returns value pointed by specific field of from source Device_Spec_Location 6575 func (fp *DeviceSpecLocation_FieldTerminalPath) GetSingle(source *Device_Spec_Location) (interface{}, bool) { 6576 switch fp.selector { 6577 case DeviceSpecLocation_FieldPathSelectorAddress: 6578 return source.GetAddress(), source != nil 6579 case DeviceSpecLocation_FieldPathSelectorPlacement: 6580 return source.GetPlacement(), source != nil 6581 default: 6582 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6583 } 6584 } 6585 6586 func (fp *DeviceSpecLocation_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6587 return fp.GetSingle(source.(*Device_Spec_Location)) 6588 } 6589 6590 // GetDefault returns a default value of the field type 6591 func (fp *DeviceSpecLocation_FieldTerminalPath) GetDefault() interface{} { 6592 switch fp.selector { 6593 case DeviceSpecLocation_FieldPathSelectorAddress: 6594 return "" 6595 case DeviceSpecLocation_FieldPathSelectorPlacement: 6596 return "" 6597 default: 6598 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6599 } 6600 } 6601 6602 func (fp *DeviceSpecLocation_FieldTerminalPath) ClearValue(item *Device_Spec_Location) { 6603 if item != nil { 6604 switch fp.selector { 6605 case DeviceSpecLocation_FieldPathSelectorAddress: 6606 item.Address = "" 6607 case DeviceSpecLocation_FieldPathSelectorPlacement: 6608 item.Placement = "" 6609 default: 6610 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6611 } 6612 } 6613 } 6614 6615 func (fp *DeviceSpecLocation_FieldTerminalPath) ClearValueRaw(item proto.Message) { 6616 fp.ClearValue(item.(*Device_Spec_Location)) 6617 } 6618 6619 // IsLeaf - whether field path is holds simple value 6620 func (fp *DeviceSpecLocation_FieldTerminalPath) IsLeaf() bool { 6621 return fp.selector == DeviceSpecLocation_FieldPathSelectorAddress || 6622 fp.selector == DeviceSpecLocation_FieldPathSelectorPlacement 6623 } 6624 6625 func (fp *DeviceSpecLocation_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6626 return []gotenobject.FieldPath{fp} 6627 } 6628 6629 func (fp *DeviceSpecLocation_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecLocation_FieldPathValue { 6630 switch fp.selector { 6631 case DeviceSpecLocation_FieldPathSelectorAddress: 6632 return &DeviceSpecLocation_FieldTerminalPathValue{DeviceSpecLocation_FieldTerminalPath: *fp, value: value.(string)} 6633 case DeviceSpecLocation_FieldPathSelectorPlacement: 6634 return &DeviceSpecLocation_FieldTerminalPathValue{DeviceSpecLocation_FieldTerminalPath: *fp, value: value.(string)} 6635 default: 6636 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6637 } 6638 } 6639 6640 func (fp *DeviceSpecLocation_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6641 return fp.WithIValue(value) 6642 } 6643 6644 func (fp *DeviceSpecLocation_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecLocation_FieldPathArrayOfValues { 6645 fpaov := &DeviceSpecLocation_FieldTerminalPathArrayOfValues{DeviceSpecLocation_FieldTerminalPath: *fp} 6646 switch fp.selector { 6647 case DeviceSpecLocation_FieldPathSelectorAddress: 6648 return &DeviceSpecLocation_FieldTerminalPathArrayOfValues{DeviceSpecLocation_FieldTerminalPath: *fp, values: values.([]string)} 6649 case DeviceSpecLocation_FieldPathSelectorPlacement: 6650 return &DeviceSpecLocation_FieldTerminalPathArrayOfValues{DeviceSpecLocation_FieldTerminalPath: *fp, values: values.([]string)} 6651 default: 6652 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6653 } 6654 return fpaov 6655 } 6656 6657 func (fp *DeviceSpecLocation_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6658 return fp.WithIArrayOfValues(values) 6659 } 6660 6661 func (fp *DeviceSpecLocation_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecLocation_FieldPathArrayItemValue { 6662 switch fp.selector { 6663 default: 6664 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fp.selector)) 6665 } 6666 } 6667 6668 func (fp *DeviceSpecLocation_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6669 return fp.WithIArrayItemValue(value) 6670 } 6671 6672 // DeviceSpecLocation_FieldPathValue allows storing values for Location fields according to their type 6673 type DeviceSpecLocation_FieldPathValue interface { 6674 DeviceSpecLocation_FieldPath 6675 gotenobject.FieldPathValue 6676 SetTo(target **Device_Spec_Location) 6677 CompareWith(*Device_Spec_Location) (cmp int, comparable bool) 6678 } 6679 6680 func ParseDeviceSpecLocation_FieldPathValue(pathStr, valueStr string) (DeviceSpecLocation_FieldPathValue, error) { 6681 fp, err := ParseDeviceSpecLocation_FieldPath(pathStr) 6682 if err != nil { 6683 return nil, err 6684 } 6685 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 6686 if err != nil { 6687 return nil, status.Errorf(codes.InvalidArgument, "error parsing Location field path value from %s: %v", valueStr, err) 6688 } 6689 return fpv.(DeviceSpecLocation_FieldPathValue), nil 6690 } 6691 6692 func MustParseDeviceSpecLocation_FieldPathValue(pathStr, valueStr string) DeviceSpecLocation_FieldPathValue { 6693 fpv, err := ParseDeviceSpecLocation_FieldPathValue(pathStr, valueStr) 6694 if err != nil { 6695 panic(err) 6696 } 6697 return fpv 6698 } 6699 6700 type DeviceSpecLocation_FieldTerminalPathValue struct { 6701 DeviceSpecLocation_FieldTerminalPath 6702 value interface{} 6703 } 6704 6705 var _ DeviceSpecLocation_FieldPathValue = (*DeviceSpecLocation_FieldTerminalPathValue)(nil) 6706 6707 // GetRawValue returns raw value stored under selected path for 'Location' as interface{} 6708 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) GetRawValue() interface{} { 6709 return fpv.value 6710 } 6711 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) AsAddressValue() (string, bool) { 6712 res, ok := fpv.value.(string) 6713 return res, ok 6714 } 6715 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) AsPlacementValue() (string, bool) { 6716 res, ok := fpv.value.(string) 6717 return res, ok 6718 } 6719 6720 // SetTo stores value for selected field for object Location 6721 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) SetTo(target **Device_Spec_Location) { 6722 if *target == nil { 6723 *target = new(Device_Spec_Location) 6724 } 6725 switch fpv.selector { 6726 case DeviceSpecLocation_FieldPathSelectorAddress: 6727 (*target).Address = fpv.value.(string) 6728 case DeviceSpecLocation_FieldPathSelectorPlacement: 6729 (*target).Placement = fpv.value.(string) 6730 default: 6731 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fpv.selector)) 6732 } 6733 } 6734 6735 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) SetToRaw(target proto.Message) { 6736 typedObject := target.(*Device_Spec_Location) 6737 fpv.SetTo(&typedObject) 6738 } 6739 6740 // CompareWith compares value in the 'DeviceSpecLocation_FieldTerminalPathValue' with the value under path in 'Device_Spec_Location'. 6741 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) CompareWith(source *Device_Spec_Location) (int, bool) { 6742 switch fpv.selector { 6743 case DeviceSpecLocation_FieldPathSelectorAddress: 6744 leftValue := fpv.value.(string) 6745 rightValue := source.GetAddress() 6746 if (leftValue) == (rightValue) { 6747 return 0, true 6748 } else if (leftValue) < (rightValue) { 6749 return -1, true 6750 } else { 6751 return 1, true 6752 } 6753 case DeviceSpecLocation_FieldPathSelectorPlacement: 6754 leftValue := fpv.value.(string) 6755 rightValue := source.GetPlacement() 6756 if (leftValue) == (rightValue) { 6757 return 0, true 6758 } else if (leftValue) < (rightValue) { 6759 return -1, true 6760 } else { 6761 return 1, true 6762 } 6763 default: 6764 panic(fmt.Sprintf("Invalid selector for Device_Spec_Location: %d", fpv.selector)) 6765 } 6766 } 6767 6768 func (fpv *DeviceSpecLocation_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6769 return fpv.CompareWith(source.(*Device_Spec_Location)) 6770 } 6771 6772 // DeviceSpecLocation_FieldPathArrayItemValue allows storing single item in Path-specific values for Location according to their type 6773 // Present only for array (repeated) types. 6774 type DeviceSpecLocation_FieldPathArrayItemValue interface { 6775 gotenobject.FieldPathArrayItemValue 6776 DeviceSpecLocation_FieldPath 6777 ContainsValue(*Device_Spec_Location) bool 6778 } 6779 6780 // ParseDeviceSpecLocation_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 6781 func ParseDeviceSpecLocation_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecLocation_FieldPathArrayItemValue, error) { 6782 fp, err := ParseDeviceSpecLocation_FieldPath(pathStr) 6783 if err != nil { 6784 return nil, err 6785 } 6786 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 6787 if err != nil { 6788 return nil, status.Errorf(codes.InvalidArgument, "error parsing Location field path array item value from %s: %v", valueStr, err) 6789 } 6790 return fpaiv.(DeviceSpecLocation_FieldPathArrayItemValue), nil 6791 } 6792 6793 func MustParseDeviceSpecLocation_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecLocation_FieldPathArrayItemValue { 6794 fpaiv, err := ParseDeviceSpecLocation_FieldPathArrayItemValue(pathStr, valueStr) 6795 if err != nil { 6796 panic(err) 6797 } 6798 return fpaiv 6799 } 6800 6801 type DeviceSpecLocation_FieldTerminalPathArrayItemValue struct { 6802 DeviceSpecLocation_FieldTerminalPath 6803 value interface{} 6804 } 6805 6806 var _ DeviceSpecLocation_FieldPathArrayItemValue = (*DeviceSpecLocation_FieldTerminalPathArrayItemValue)(nil) 6807 6808 // GetRawValue returns stored element value for array in object Device_Spec_Location as interface{} 6809 func (fpaiv *DeviceSpecLocation_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 6810 return fpaiv.value 6811 } 6812 6813 func (fpaiv *DeviceSpecLocation_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_Location) (interface{}, bool) { 6814 return nil, false 6815 } 6816 6817 func (fpaiv *DeviceSpecLocation_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 6818 return fpaiv.GetSingle(source.(*Device_Spec_Location)) 6819 } 6820 6821 // Contains returns a boolean indicating if value that is being held is present in given 'Location' 6822 func (fpaiv *DeviceSpecLocation_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_Location) bool { 6823 slice := fpaiv.DeviceSpecLocation_FieldTerminalPath.Get(source) 6824 for _, v := range slice { 6825 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 6826 if proto.Equal(asProtoMsg, v.(proto.Message)) { 6827 return true 6828 } 6829 } else if reflect.DeepEqual(v, fpaiv.value) { 6830 return true 6831 } 6832 } 6833 return false 6834 } 6835 6836 // DeviceSpecLocation_FieldPathArrayOfValues allows storing slice of values for Location fields according to their type 6837 type DeviceSpecLocation_FieldPathArrayOfValues interface { 6838 gotenobject.FieldPathArrayOfValues 6839 DeviceSpecLocation_FieldPath 6840 } 6841 6842 func ParseDeviceSpecLocation_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecLocation_FieldPathArrayOfValues, error) { 6843 fp, err := ParseDeviceSpecLocation_FieldPath(pathStr) 6844 if err != nil { 6845 return nil, err 6846 } 6847 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 6848 if err != nil { 6849 return nil, status.Errorf(codes.InvalidArgument, "error parsing Location field path array of values from %s: %v", valuesStr, err) 6850 } 6851 return fpaov.(DeviceSpecLocation_FieldPathArrayOfValues), nil 6852 } 6853 6854 func MustParseDeviceSpecLocation_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecLocation_FieldPathArrayOfValues { 6855 fpaov, err := ParseDeviceSpecLocation_FieldPathArrayOfValues(pathStr, valuesStr) 6856 if err != nil { 6857 panic(err) 6858 } 6859 return fpaov 6860 } 6861 6862 type DeviceSpecLocation_FieldTerminalPathArrayOfValues struct { 6863 DeviceSpecLocation_FieldTerminalPath 6864 values interface{} 6865 } 6866 6867 var _ DeviceSpecLocation_FieldPathArrayOfValues = (*DeviceSpecLocation_FieldTerminalPathArrayOfValues)(nil) 6868 6869 func (fpaov *DeviceSpecLocation_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 6870 switch fpaov.selector { 6871 case DeviceSpecLocation_FieldPathSelectorAddress: 6872 for _, v := range fpaov.values.([]string) { 6873 values = append(values, v) 6874 } 6875 case DeviceSpecLocation_FieldPathSelectorPlacement: 6876 for _, v := range fpaov.values.([]string) { 6877 values = append(values, v) 6878 } 6879 } 6880 return 6881 } 6882 func (fpaov *DeviceSpecLocation_FieldTerminalPathArrayOfValues) AsAddressArrayOfValues() ([]string, bool) { 6883 res, ok := fpaov.values.([]string) 6884 return res, ok 6885 } 6886 func (fpaov *DeviceSpecLocation_FieldTerminalPathArrayOfValues) AsPlacementArrayOfValues() ([]string, bool) { 6887 res, ok := fpaov.values.([]string) 6888 return res, ok 6889 } 6890 6891 // FieldPath provides implementation to handle 6892 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 6893 type DeviceSpecUSBGuard_FieldPath interface { 6894 gotenobject.FieldPath 6895 Selector() DeviceSpecUSBGuard_FieldPathSelector 6896 Get(source *Device_Spec_USBGuard) []interface{} 6897 GetSingle(source *Device_Spec_USBGuard) (interface{}, bool) 6898 ClearValue(item *Device_Spec_USBGuard) 6899 6900 // Those methods build corresponding DeviceSpecUSBGuard_FieldPathValue 6901 // (or array of values) and holds passed value. Panics if injected type is incorrect. 6902 WithIValue(value interface{}) DeviceSpecUSBGuard_FieldPathValue 6903 WithIArrayOfValues(values interface{}) DeviceSpecUSBGuard_FieldPathArrayOfValues 6904 WithIArrayItemValue(value interface{}) DeviceSpecUSBGuard_FieldPathArrayItemValue 6905 } 6906 6907 type DeviceSpecUSBGuard_FieldPathSelector int32 6908 6909 const ( 6910 DeviceSpecUSBGuard_FieldPathSelectorEnable DeviceSpecUSBGuard_FieldPathSelector = 0 6911 DeviceSpecUSBGuard_FieldPathSelectorWhiteList DeviceSpecUSBGuard_FieldPathSelector = 1 6912 ) 6913 6914 func (s DeviceSpecUSBGuard_FieldPathSelector) String() string { 6915 switch s { 6916 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 6917 return "enable" 6918 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 6919 return "white_list" 6920 default: 6921 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", s)) 6922 } 6923 } 6924 6925 func BuildDeviceSpecUSBGuard_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecUSBGuard_FieldPath, error) { 6926 if len(fp) == 0 { 6927 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_USBGuard") 6928 } 6929 if len(fp) == 1 { 6930 switch fp[0] { 6931 case "enable": 6932 return &DeviceSpecUSBGuard_FieldTerminalPath{selector: DeviceSpecUSBGuard_FieldPathSelectorEnable}, nil 6933 case "white_list", "whiteList", "white-list": 6934 return &DeviceSpecUSBGuard_FieldTerminalPath{selector: DeviceSpecUSBGuard_FieldPathSelectorWhiteList}, nil 6935 } 6936 } else { 6937 switch fp[0] { 6938 case "white_list", "whiteList", "white-list": 6939 if subpath, err := BuildDeviceSpecUSBGuardWhiteList_FieldPath(fp[1:]); err != nil { 6940 return nil, err 6941 } else { 6942 return &DeviceSpecUSBGuard_FieldSubPath{selector: DeviceSpecUSBGuard_FieldPathSelectorWhiteList, subPath: subpath}, nil 6943 } 6944 } 6945 } 6946 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_USBGuard", fp) 6947 } 6948 6949 func ParseDeviceSpecUSBGuard_FieldPath(rawField string) (DeviceSpecUSBGuard_FieldPath, error) { 6950 fp, err := gotenobject.ParseRawFieldPath(rawField) 6951 if err != nil { 6952 return nil, err 6953 } 6954 return BuildDeviceSpecUSBGuard_FieldPath(fp) 6955 } 6956 6957 func MustParseDeviceSpecUSBGuard_FieldPath(rawField string) DeviceSpecUSBGuard_FieldPath { 6958 fp, err := ParseDeviceSpecUSBGuard_FieldPath(rawField) 6959 if err != nil { 6960 panic(err) 6961 } 6962 return fp 6963 } 6964 6965 type DeviceSpecUSBGuard_FieldTerminalPath struct { 6966 selector DeviceSpecUSBGuard_FieldPathSelector 6967 } 6968 6969 var _ DeviceSpecUSBGuard_FieldPath = (*DeviceSpecUSBGuard_FieldTerminalPath)(nil) 6970 6971 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) Selector() DeviceSpecUSBGuard_FieldPathSelector { 6972 return fp.selector 6973 } 6974 6975 // String returns path representation in proto convention 6976 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) String() string { 6977 return fp.selector.String() 6978 } 6979 6980 // JSONString returns path representation is JSON convention 6981 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) JSONString() string { 6982 return strcase.ToLowerCamel(fp.String()) 6983 } 6984 6985 // Get returns all values pointed by specific field from source Device_Spec_USBGuard 6986 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) Get(source *Device_Spec_USBGuard) (values []interface{}) { 6987 if source != nil { 6988 switch fp.selector { 6989 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 6990 values = append(values, source.Enable) 6991 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 6992 for _, value := range source.GetWhiteList() { 6993 values = append(values, value) 6994 } 6995 default: 6996 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 6997 } 6998 } 6999 return 7000 } 7001 7002 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 7003 return fp.Get(source.(*Device_Spec_USBGuard)) 7004 } 7005 7006 // GetSingle returns value pointed by specific field of from source Device_Spec_USBGuard 7007 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) GetSingle(source *Device_Spec_USBGuard) (interface{}, bool) { 7008 switch fp.selector { 7009 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7010 return source.GetEnable(), source != nil 7011 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7012 res := source.GetWhiteList() 7013 return res, res != nil 7014 default: 7015 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 7016 } 7017 } 7018 7019 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7020 return fp.GetSingle(source.(*Device_Spec_USBGuard)) 7021 } 7022 7023 // GetDefault returns a default value of the field type 7024 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) GetDefault() interface{} { 7025 switch fp.selector { 7026 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7027 return false 7028 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7029 return ([]*Device_Spec_USBGuard_WhiteList)(nil) 7030 default: 7031 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 7032 } 7033 } 7034 7035 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) ClearValue(item *Device_Spec_USBGuard) { 7036 if item != nil { 7037 switch fp.selector { 7038 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7039 item.Enable = false 7040 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7041 item.WhiteList = nil 7042 default: 7043 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 7044 } 7045 } 7046 } 7047 7048 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) ClearValueRaw(item proto.Message) { 7049 fp.ClearValue(item.(*Device_Spec_USBGuard)) 7050 } 7051 7052 // IsLeaf - whether field path is holds simple value 7053 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) IsLeaf() bool { 7054 return fp.selector == DeviceSpecUSBGuard_FieldPathSelectorEnable 7055 } 7056 7057 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 7058 return []gotenobject.FieldPath{fp} 7059 } 7060 7061 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecUSBGuard_FieldPathValue { 7062 switch fp.selector { 7063 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7064 return &DeviceSpecUSBGuard_FieldTerminalPathValue{DeviceSpecUSBGuard_FieldTerminalPath: *fp, value: value.(bool)} 7065 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7066 return &DeviceSpecUSBGuard_FieldTerminalPathValue{DeviceSpecUSBGuard_FieldTerminalPath: *fp, value: value.([]*Device_Spec_USBGuard_WhiteList)} 7067 default: 7068 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 7069 } 7070 } 7071 7072 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 7073 return fp.WithIValue(value) 7074 } 7075 7076 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecUSBGuard_FieldPathArrayOfValues { 7077 fpaov := &DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuard_FieldTerminalPath: *fp} 7078 switch fp.selector { 7079 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7080 return &DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuard_FieldTerminalPath: *fp, values: values.([]bool)} 7081 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7082 return &DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuard_FieldTerminalPath: *fp, values: values.([][]*Device_Spec_USBGuard_WhiteList)} 7083 default: 7084 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 7085 } 7086 return fpaov 7087 } 7088 7089 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 7090 return fp.WithIArrayOfValues(values) 7091 } 7092 7093 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecUSBGuard_FieldPathArrayItemValue { 7094 switch fp.selector { 7095 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7096 return &DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue{DeviceSpecUSBGuard_FieldTerminalPath: *fp, value: value.(*Device_Spec_USBGuard_WhiteList)} 7097 default: 7098 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fp.selector)) 7099 } 7100 } 7101 7102 func (fp *DeviceSpecUSBGuard_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 7103 return fp.WithIArrayItemValue(value) 7104 } 7105 7106 type DeviceSpecUSBGuard_FieldSubPath struct { 7107 selector DeviceSpecUSBGuard_FieldPathSelector 7108 subPath gotenobject.FieldPath 7109 } 7110 7111 var _ DeviceSpecUSBGuard_FieldPath = (*DeviceSpecUSBGuard_FieldSubPath)(nil) 7112 7113 func (fps *DeviceSpecUSBGuard_FieldSubPath) Selector() DeviceSpecUSBGuard_FieldPathSelector { 7114 return fps.selector 7115 } 7116 func (fps *DeviceSpecUSBGuard_FieldSubPath) AsWhiteListSubPath() (DeviceSpecUSBGuardWhiteList_FieldPath, bool) { 7117 res, ok := fps.subPath.(DeviceSpecUSBGuardWhiteList_FieldPath) 7118 return res, ok 7119 } 7120 7121 // String returns path representation in proto convention 7122 func (fps *DeviceSpecUSBGuard_FieldSubPath) String() string { 7123 return fps.selector.String() + "." + fps.subPath.String() 7124 } 7125 7126 // JSONString returns path representation is JSON convention 7127 func (fps *DeviceSpecUSBGuard_FieldSubPath) JSONString() string { 7128 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 7129 } 7130 7131 // Get returns all values pointed by selected field from source Device_Spec_USBGuard 7132 func (fps *DeviceSpecUSBGuard_FieldSubPath) Get(source *Device_Spec_USBGuard) (values []interface{}) { 7133 switch fps.selector { 7134 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7135 for _, item := range source.GetWhiteList() { 7136 values = append(values, fps.subPath.GetRaw(item)...) 7137 } 7138 default: 7139 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fps.selector)) 7140 } 7141 return 7142 } 7143 7144 func (fps *DeviceSpecUSBGuard_FieldSubPath) GetRaw(source proto.Message) []interface{} { 7145 return fps.Get(source.(*Device_Spec_USBGuard)) 7146 } 7147 7148 // GetSingle returns value of selected field from source Device_Spec_USBGuard 7149 func (fps *DeviceSpecUSBGuard_FieldSubPath) GetSingle(source *Device_Spec_USBGuard) (interface{}, bool) { 7150 switch fps.selector { 7151 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7152 if len(source.GetWhiteList()) == 0 { 7153 return nil, false 7154 } 7155 return fps.subPath.GetSingleRaw(source.GetWhiteList()[0]) 7156 default: 7157 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fps.selector)) 7158 } 7159 } 7160 7161 func (fps *DeviceSpecUSBGuard_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7162 return fps.GetSingle(source.(*Device_Spec_USBGuard)) 7163 } 7164 7165 // GetDefault returns a default value of the field type 7166 func (fps *DeviceSpecUSBGuard_FieldSubPath) GetDefault() interface{} { 7167 return fps.subPath.GetDefault() 7168 } 7169 7170 func (fps *DeviceSpecUSBGuard_FieldSubPath) ClearValue(item *Device_Spec_USBGuard) { 7171 if item != nil { 7172 switch fps.selector { 7173 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7174 for _, subItem := range item.WhiteList { 7175 fps.subPath.ClearValueRaw(subItem) 7176 } 7177 default: 7178 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fps.selector)) 7179 } 7180 } 7181 } 7182 7183 func (fps *DeviceSpecUSBGuard_FieldSubPath) ClearValueRaw(item proto.Message) { 7184 fps.ClearValue(item.(*Device_Spec_USBGuard)) 7185 } 7186 7187 // IsLeaf - whether field path is holds simple value 7188 func (fps *DeviceSpecUSBGuard_FieldSubPath) IsLeaf() bool { 7189 return fps.subPath.IsLeaf() 7190 } 7191 7192 func (fps *DeviceSpecUSBGuard_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 7193 iPaths := []gotenobject.FieldPath{&DeviceSpecUSBGuard_FieldTerminalPath{selector: fps.selector}} 7194 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 7195 return iPaths 7196 } 7197 7198 func (fps *DeviceSpecUSBGuard_FieldSubPath) WithIValue(value interface{}) DeviceSpecUSBGuard_FieldPathValue { 7199 return &DeviceSpecUSBGuard_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 7200 } 7201 7202 func (fps *DeviceSpecUSBGuard_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 7203 return fps.WithIValue(value) 7204 } 7205 7206 func (fps *DeviceSpecUSBGuard_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceSpecUSBGuard_FieldPathArrayOfValues { 7207 return &DeviceSpecUSBGuard_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 7208 } 7209 7210 func (fps *DeviceSpecUSBGuard_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 7211 return fps.WithIArrayOfValues(values) 7212 } 7213 7214 func (fps *DeviceSpecUSBGuard_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceSpecUSBGuard_FieldPathArrayItemValue { 7215 return &DeviceSpecUSBGuard_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 7216 } 7217 7218 func (fps *DeviceSpecUSBGuard_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 7219 return fps.WithIArrayItemValue(value) 7220 } 7221 7222 // DeviceSpecUSBGuard_FieldPathValue allows storing values for USBGuard fields according to their type 7223 type DeviceSpecUSBGuard_FieldPathValue interface { 7224 DeviceSpecUSBGuard_FieldPath 7225 gotenobject.FieldPathValue 7226 SetTo(target **Device_Spec_USBGuard) 7227 CompareWith(*Device_Spec_USBGuard) (cmp int, comparable bool) 7228 } 7229 7230 func ParseDeviceSpecUSBGuard_FieldPathValue(pathStr, valueStr string) (DeviceSpecUSBGuard_FieldPathValue, error) { 7231 fp, err := ParseDeviceSpecUSBGuard_FieldPath(pathStr) 7232 if err != nil { 7233 return nil, err 7234 } 7235 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 7236 if err != nil { 7237 return nil, status.Errorf(codes.InvalidArgument, "error parsing USBGuard field path value from %s: %v", valueStr, err) 7238 } 7239 return fpv.(DeviceSpecUSBGuard_FieldPathValue), nil 7240 } 7241 7242 func MustParseDeviceSpecUSBGuard_FieldPathValue(pathStr, valueStr string) DeviceSpecUSBGuard_FieldPathValue { 7243 fpv, err := ParseDeviceSpecUSBGuard_FieldPathValue(pathStr, valueStr) 7244 if err != nil { 7245 panic(err) 7246 } 7247 return fpv 7248 } 7249 7250 type DeviceSpecUSBGuard_FieldTerminalPathValue struct { 7251 DeviceSpecUSBGuard_FieldTerminalPath 7252 value interface{} 7253 } 7254 7255 var _ DeviceSpecUSBGuard_FieldPathValue = (*DeviceSpecUSBGuard_FieldTerminalPathValue)(nil) 7256 7257 // GetRawValue returns raw value stored under selected path for 'USBGuard' as interface{} 7258 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) GetRawValue() interface{} { 7259 return fpv.value 7260 } 7261 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) AsEnableValue() (bool, bool) { 7262 res, ok := fpv.value.(bool) 7263 return res, ok 7264 } 7265 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) AsWhiteListValue() ([]*Device_Spec_USBGuard_WhiteList, bool) { 7266 res, ok := fpv.value.([]*Device_Spec_USBGuard_WhiteList) 7267 return res, ok 7268 } 7269 7270 // SetTo stores value for selected field for object USBGuard 7271 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) SetTo(target **Device_Spec_USBGuard) { 7272 if *target == nil { 7273 *target = new(Device_Spec_USBGuard) 7274 } 7275 switch fpv.selector { 7276 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7277 (*target).Enable = fpv.value.(bool) 7278 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7279 (*target).WhiteList = fpv.value.([]*Device_Spec_USBGuard_WhiteList) 7280 default: 7281 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fpv.selector)) 7282 } 7283 } 7284 7285 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) SetToRaw(target proto.Message) { 7286 typedObject := target.(*Device_Spec_USBGuard) 7287 fpv.SetTo(&typedObject) 7288 } 7289 7290 // CompareWith compares value in the 'DeviceSpecUSBGuard_FieldTerminalPathValue' with the value under path in 'Device_Spec_USBGuard'. 7291 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) CompareWith(source *Device_Spec_USBGuard) (int, bool) { 7292 switch fpv.selector { 7293 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7294 leftValue := fpv.value.(bool) 7295 rightValue := source.GetEnable() 7296 if (leftValue) == (rightValue) { 7297 return 0, true 7298 } else if !(leftValue) && (rightValue) { 7299 return -1, true 7300 } else { 7301 return 1, true 7302 } 7303 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7304 return 0, false 7305 default: 7306 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fpv.selector)) 7307 } 7308 } 7309 7310 func (fpv *DeviceSpecUSBGuard_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 7311 return fpv.CompareWith(source.(*Device_Spec_USBGuard)) 7312 } 7313 7314 type DeviceSpecUSBGuard_FieldSubPathValue struct { 7315 DeviceSpecUSBGuard_FieldPath 7316 subPathValue gotenobject.FieldPathValue 7317 } 7318 7319 var _ DeviceSpecUSBGuard_FieldPathValue = (*DeviceSpecUSBGuard_FieldSubPathValue)(nil) 7320 7321 func (fpvs *DeviceSpecUSBGuard_FieldSubPathValue) AsWhiteListPathValue() (DeviceSpecUSBGuardWhiteList_FieldPathValue, bool) { 7322 res, ok := fpvs.subPathValue.(DeviceSpecUSBGuardWhiteList_FieldPathValue) 7323 return res, ok 7324 } 7325 7326 func (fpvs *DeviceSpecUSBGuard_FieldSubPathValue) SetTo(target **Device_Spec_USBGuard) { 7327 if *target == nil { 7328 *target = new(Device_Spec_USBGuard) 7329 } 7330 switch fpvs.Selector() { 7331 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7332 panic("FieldPath setter is unsupported for array subpaths") 7333 default: 7334 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fpvs.Selector())) 7335 } 7336 } 7337 7338 func (fpvs *DeviceSpecUSBGuard_FieldSubPathValue) SetToRaw(target proto.Message) { 7339 typedObject := target.(*Device_Spec_USBGuard) 7340 fpvs.SetTo(&typedObject) 7341 } 7342 7343 func (fpvs *DeviceSpecUSBGuard_FieldSubPathValue) GetRawValue() interface{} { 7344 return fpvs.subPathValue.GetRawValue() 7345 } 7346 7347 func (fpvs *DeviceSpecUSBGuard_FieldSubPathValue) CompareWith(source *Device_Spec_USBGuard) (int, bool) { 7348 switch fpvs.Selector() { 7349 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7350 return 0, false // repeated field 7351 default: 7352 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fpvs.Selector())) 7353 } 7354 } 7355 7356 func (fpvs *DeviceSpecUSBGuard_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 7357 return fpvs.CompareWith(source.(*Device_Spec_USBGuard)) 7358 } 7359 7360 // DeviceSpecUSBGuard_FieldPathArrayItemValue allows storing single item in Path-specific values for USBGuard according to their type 7361 // Present only for array (repeated) types. 7362 type DeviceSpecUSBGuard_FieldPathArrayItemValue interface { 7363 gotenobject.FieldPathArrayItemValue 7364 DeviceSpecUSBGuard_FieldPath 7365 ContainsValue(*Device_Spec_USBGuard) bool 7366 } 7367 7368 // ParseDeviceSpecUSBGuard_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 7369 func ParseDeviceSpecUSBGuard_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecUSBGuard_FieldPathArrayItemValue, error) { 7370 fp, err := ParseDeviceSpecUSBGuard_FieldPath(pathStr) 7371 if err != nil { 7372 return nil, err 7373 } 7374 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 7375 if err != nil { 7376 return nil, status.Errorf(codes.InvalidArgument, "error parsing USBGuard field path array item value from %s: %v", valueStr, err) 7377 } 7378 return fpaiv.(DeviceSpecUSBGuard_FieldPathArrayItemValue), nil 7379 } 7380 7381 func MustParseDeviceSpecUSBGuard_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecUSBGuard_FieldPathArrayItemValue { 7382 fpaiv, err := ParseDeviceSpecUSBGuard_FieldPathArrayItemValue(pathStr, valueStr) 7383 if err != nil { 7384 panic(err) 7385 } 7386 return fpaiv 7387 } 7388 7389 type DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue struct { 7390 DeviceSpecUSBGuard_FieldTerminalPath 7391 value interface{} 7392 } 7393 7394 var _ DeviceSpecUSBGuard_FieldPathArrayItemValue = (*DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue)(nil) 7395 7396 // GetRawValue returns stored element value for array in object Device_Spec_USBGuard as interface{} 7397 func (fpaiv *DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 7398 return fpaiv.value 7399 } 7400 func (fpaiv *DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue) AsWhiteListItemValue() (*Device_Spec_USBGuard_WhiteList, bool) { 7401 res, ok := fpaiv.value.(*Device_Spec_USBGuard_WhiteList) 7402 return res, ok 7403 } 7404 7405 func (fpaiv *DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_USBGuard) (interface{}, bool) { 7406 return nil, false 7407 } 7408 7409 func (fpaiv *DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 7410 return fpaiv.GetSingle(source.(*Device_Spec_USBGuard)) 7411 } 7412 7413 // Contains returns a boolean indicating if value that is being held is present in given 'USBGuard' 7414 func (fpaiv *DeviceSpecUSBGuard_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_USBGuard) bool { 7415 slice := fpaiv.DeviceSpecUSBGuard_FieldTerminalPath.Get(source) 7416 for _, v := range slice { 7417 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 7418 if proto.Equal(asProtoMsg, v.(proto.Message)) { 7419 return true 7420 } 7421 } else if reflect.DeepEqual(v, fpaiv.value) { 7422 return true 7423 } 7424 } 7425 return false 7426 } 7427 7428 type DeviceSpecUSBGuard_FieldSubPathArrayItemValue struct { 7429 DeviceSpecUSBGuard_FieldPath 7430 subPathItemValue gotenobject.FieldPathArrayItemValue 7431 } 7432 7433 // GetRawValue returns stored array item value 7434 func (fpaivs *DeviceSpecUSBGuard_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 7435 return fpaivs.subPathItemValue.GetRawItemValue() 7436 } 7437 func (fpaivs *DeviceSpecUSBGuard_FieldSubPathArrayItemValue) AsWhiteListPathItemValue() (DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue, bool) { 7438 res, ok := fpaivs.subPathItemValue.(DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue) 7439 return res, ok 7440 } 7441 7442 // Contains returns a boolean indicating if value that is being held is present in given 'USBGuard' 7443 func (fpaivs *DeviceSpecUSBGuard_FieldSubPathArrayItemValue) ContainsValue(source *Device_Spec_USBGuard) bool { 7444 switch fpaivs.Selector() { 7445 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7446 return false // repeated/map field 7447 default: 7448 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard: %d", fpaivs.Selector())) 7449 } 7450 } 7451 7452 // DeviceSpecUSBGuard_FieldPathArrayOfValues allows storing slice of values for USBGuard fields according to their type 7453 type DeviceSpecUSBGuard_FieldPathArrayOfValues interface { 7454 gotenobject.FieldPathArrayOfValues 7455 DeviceSpecUSBGuard_FieldPath 7456 } 7457 7458 func ParseDeviceSpecUSBGuard_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecUSBGuard_FieldPathArrayOfValues, error) { 7459 fp, err := ParseDeviceSpecUSBGuard_FieldPath(pathStr) 7460 if err != nil { 7461 return nil, err 7462 } 7463 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 7464 if err != nil { 7465 return nil, status.Errorf(codes.InvalidArgument, "error parsing USBGuard field path array of values from %s: %v", valuesStr, err) 7466 } 7467 return fpaov.(DeviceSpecUSBGuard_FieldPathArrayOfValues), nil 7468 } 7469 7470 func MustParseDeviceSpecUSBGuard_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecUSBGuard_FieldPathArrayOfValues { 7471 fpaov, err := ParseDeviceSpecUSBGuard_FieldPathArrayOfValues(pathStr, valuesStr) 7472 if err != nil { 7473 panic(err) 7474 } 7475 return fpaov 7476 } 7477 7478 type DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues struct { 7479 DeviceSpecUSBGuard_FieldTerminalPath 7480 values interface{} 7481 } 7482 7483 var _ DeviceSpecUSBGuard_FieldPathArrayOfValues = (*DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues)(nil) 7484 7485 func (fpaov *DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 7486 switch fpaov.selector { 7487 case DeviceSpecUSBGuard_FieldPathSelectorEnable: 7488 for _, v := range fpaov.values.([]bool) { 7489 values = append(values, v) 7490 } 7491 case DeviceSpecUSBGuard_FieldPathSelectorWhiteList: 7492 for _, v := range fpaov.values.([][]*Device_Spec_USBGuard_WhiteList) { 7493 values = append(values, v) 7494 } 7495 } 7496 return 7497 } 7498 func (fpaov *DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues) AsEnableArrayOfValues() ([]bool, bool) { 7499 res, ok := fpaov.values.([]bool) 7500 return res, ok 7501 } 7502 func (fpaov *DeviceSpecUSBGuard_FieldTerminalPathArrayOfValues) AsWhiteListArrayOfValues() ([][]*Device_Spec_USBGuard_WhiteList, bool) { 7503 res, ok := fpaov.values.([][]*Device_Spec_USBGuard_WhiteList) 7504 return res, ok 7505 } 7506 7507 type DeviceSpecUSBGuard_FieldSubPathArrayOfValues struct { 7508 DeviceSpecUSBGuard_FieldPath 7509 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 7510 } 7511 7512 var _ DeviceSpecUSBGuard_FieldPathArrayOfValues = (*DeviceSpecUSBGuard_FieldSubPathArrayOfValues)(nil) 7513 7514 func (fpsaov *DeviceSpecUSBGuard_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 7515 return fpsaov.subPathArrayOfValues.GetRawValues() 7516 } 7517 func (fpsaov *DeviceSpecUSBGuard_FieldSubPathArrayOfValues) AsWhiteListPathArrayOfValues() (DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues, bool) { 7518 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues) 7519 return res, ok 7520 } 7521 7522 // FieldPath provides implementation to handle 7523 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 7524 type DeviceSpecSSHConfigAuthKey_FieldPath interface { 7525 gotenobject.FieldPath 7526 Selector() DeviceSpecSSHConfigAuthKey_FieldPathSelector 7527 Get(source *Device_Spec_SSHConfig_AuthKey) []interface{} 7528 GetSingle(source *Device_Spec_SSHConfig_AuthKey) (interface{}, bool) 7529 ClearValue(item *Device_Spec_SSHConfig_AuthKey) 7530 7531 // Those methods build corresponding DeviceSpecSSHConfigAuthKey_FieldPathValue 7532 // (or array of values) and holds passed value. Panics if injected type is incorrect. 7533 WithIValue(value interface{}) DeviceSpecSSHConfigAuthKey_FieldPathValue 7534 WithIArrayOfValues(values interface{}) DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues 7535 WithIArrayItemValue(value interface{}) DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue 7536 } 7537 7538 type DeviceSpecSSHConfigAuthKey_FieldPathSelector int32 7539 7540 const ( 7541 DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey DeviceSpecSSHConfigAuthKey_FieldPathSelector = 0 7542 DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority DeviceSpecSSHConfigAuthKey_FieldPathSelector = 1 7543 DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand DeviceSpecSSHConfigAuthKey_FieldPathSelector = 2 7544 DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment DeviceSpecSSHConfigAuthKey_FieldPathSelector = 3 7545 DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom DeviceSpecSSHConfigAuthKey_FieldPathSelector = 4 7546 DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding DeviceSpecSSHConfigAuthKey_FieldPathSelector = 5 7547 DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding DeviceSpecSSHConfigAuthKey_FieldPathSelector = 6 7548 DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty DeviceSpecSSHConfigAuthKey_FieldPathSelector = 7 7549 DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc DeviceSpecSSHConfigAuthKey_FieldPathSelector = 8 7550 DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding DeviceSpecSSHConfigAuthKey_FieldPathSelector = 9 7551 DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen DeviceSpecSSHConfigAuthKey_FieldPathSelector = 10 7552 DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals DeviceSpecSSHConfigAuthKey_FieldPathSelector = 11 7553 DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel DeviceSpecSSHConfigAuthKey_FieldPathSelector = 12 7554 DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict DeviceSpecSSHConfigAuthKey_FieldPathSelector = 13 7555 ) 7556 7557 func (s DeviceSpecSSHConfigAuthKey_FieldPathSelector) String() string { 7558 switch s { 7559 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7560 return "ssha_key" 7561 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7562 return "cert_authority" 7563 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7564 return "command" 7565 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7566 return "environment" 7567 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7568 return "from" 7569 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7570 return "no_agent_forwarding" 7571 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7572 return "no_port_forwarding" 7573 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7574 return "no_pty" 7575 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7576 return "no_user_rc" 7577 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7578 return "no_x11_forwarding" 7579 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7580 return "permitopen" 7581 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7582 return "principals" 7583 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7584 return "tunnel" 7585 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7586 return "restrict" 7587 default: 7588 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", s)) 7589 } 7590 } 7591 7592 func BuildDeviceSpecSSHConfigAuthKey_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecSSHConfigAuthKey_FieldPath, error) { 7593 if len(fp) == 0 { 7594 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_SSHConfig_AuthKey") 7595 } 7596 if len(fp) == 1 { 7597 switch fp[0] { 7598 case "ssha_key", "sshaKey", "ssha-key": 7599 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey}, nil 7600 case "cert_authority", "certAuthority", "cert-authority": 7601 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority}, nil 7602 case "command": 7603 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand}, nil 7604 case "environment": 7605 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment}, nil 7606 case "from": 7607 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom}, nil 7608 case "no_agent_forwarding", "noAgentForwarding", "no-agent-forwarding": 7609 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding}, nil 7610 case "no_port_forwarding", "noPortForwarding", "no-port-forwarding": 7611 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding}, nil 7612 case "no_pty", "noPty", "no-pty": 7613 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty}, nil 7614 case "no_user_rc", "noUserRc", "no-user-rc": 7615 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc}, nil 7616 case "no_x11_forwarding", "noX11Forwarding", "no-x11-forwarding": 7617 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding}, nil 7618 case "permitopen": 7619 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen}, nil 7620 case "principals": 7621 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals}, nil 7622 case "tunnel": 7623 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel}, nil 7624 case "restrict": 7625 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPath{selector: DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict}, nil 7626 } 7627 } 7628 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_SSHConfig_AuthKey", fp) 7629 } 7630 7631 func ParseDeviceSpecSSHConfigAuthKey_FieldPath(rawField string) (DeviceSpecSSHConfigAuthKey_FieldPath, error) { 7632 fp, err := gotenobject.ParseRawFieldPath(rawField) 7633 if err != nil { 7634 return nil, err 7635 } 7636 return BuildDeviceSpecSSHConfigAuthKey_FieldPath(fp) 7637 } 7638 7639 func MustParseDeviceSpecSSHConfigAuthKey_FieldPath(rawField string) DeviceSpecSSHConfigAuthKey_FieldPath { 7640 fp, err := ParseDeviceSpecSSHConfigAuthKey_FieldPath(rawField) 7641 if err != nil { 7642 panic(err) 7643 } 7644 return fp 7645 } 7646 7647 type DeviceSpecSSHConfigAuthKey_FieldTerminalPath struct { 7648 selector DeviceSpecSSHConfigAuthKey_FieldPathSelector 7649 } 7650 7651 var _ DeviceSpecSSHConfigAuthKey_FieldPath = (*DeviceSpecSSHConfigAuthKey_FieldTerminalPath)(nil) 7652 7653 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) Selector() DeviceSpecSSHConfigAuthKey_FieldPathSelector { 7654 return fp.selector 7655 } 7656 7657 // String returns path representation in proto convention 7658 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) String() string { 7659 return fp.selector.String() 7660 } 7661 7662 // JSONString returns path representation is JSON convention 7663 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) JSONString() string { 7664 return strcase.ToLowerCamel(fp.String()) 7665 } 7666 7667 // Get returns all values pointed by specific field from source Device_Spec_SSHConfig_AuthKey 7668 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) Get(source *Device_Spec_SSHConfig_AuthKey) (values []interface{}) { 7669 if source != nil { 7670 switch fp.selector { 7671 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7672 values = append(values, source.SshaKey) 7673 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7674 values = append(values, source.CertAuthority) 7675 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7676 values = append(values, source.Command) 7677 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7678 values = append(values, source.Environment) 7679 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7680 values = append(values, source.From) 7681 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7682 values = append(values, source.NoAgentForwarding) 7683 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7684 values = append(values, source.NoPortForwarding) 7685 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7686 values = append(values, source.NoPty) 7687 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7688 values = append(values, source.NoUserRc) 7689 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7690 values = append(values, source.NoX11Forwarding) 7691 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7692 values = append(values, source.Permitopen) 7693 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7694 values = append(values, source.Principals) 7695 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7696 values = append(values, source.Tunnel) 7697 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7698 values = append(values, source.Restrict) 7699 default: 7700 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7701 } 7702 } 7703 return 7704 } 7705 7706 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 7707 return fp.Get(source.(*Device_Spec_SSHConfig_AuthKey)) 7708 } 7709 7710 // GetSingle returns value pointed by specific field of from source Device_Spec_SSHConfig_AuthKey 7711 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) GetSingle(source *Device_Spec_SSHConfig_AuthKey) (interface{}, bool) { 7712 switch fp.selector { 7713 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7714 return source.GetSshaKey(), source != nil 7715 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7716 return source.GetCertAuthority(), source != nil 7717 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7718 return source.GetCommand(), source != nil 7719 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7720 return source.GetEnvironment(), source != nil 7721 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7722 return source.GetFrom(), source != nil 7723 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7724 return source.GetNoAgentForwarding(), source != nil 7725 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7726 return source.GetNoPortForwarding(), source != nil 7727 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7728 return source.GetNoPty(), source != nil 7729 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7730 return source.GetNoUserRc(), source != nil 7731 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7732 return source.GetNoX11Forwarding(), source != nil 7733 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7734 return source.GetPermitopen(), source != nil 7735 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7736 return source.GetPrincipals(), source != nil 7737 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7738 return source.GetTunnel(), source != nil 7739 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7740 return source.GetRestrict(), source != nil 7741 default: 7742 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7743 } 7744 } 7745 7746 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7747 return fp.GetSingle(source.(*Device_Spec_SSHConfig_AuthKey)) 7748 } 7749 7750 // GetDefault returns a default value of the field type 7751 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) GetDefault() interface{} { 7752 switch fp.selector { 7753 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7754 return "" 7755 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7756 return false 7757 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7758 return "" 7759 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7760 return "" 7761 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7762 return "" 7763 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7764 return false 7765 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7766 return false 7767 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7768 return false 7769 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7770 return false 7771 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7772 return false 7773 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7774 return "" 7775 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7776 return "" 7777 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7778 return "" 7779 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7780 return false 7781 default: 7782 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7783 } 7784 } 7785 7786 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) ClearValue(item *Device_Spec_SSHConfig_AuthKey) { 7787 if item != nil { 7788 switch fp.selector { 7789 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7790 item.SshaKey = "" 7791 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7792 item.CertAuthority = false 7793 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7794 item.Command = "" 7795 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7796 item.Environment = "" 7797 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7798 item.From = "" 7799 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7800 item.NoAgentForwarding = false 7801 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7802 item.NoPortForwarding = false 7803 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7804 item.NoPty = false 7805 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7806 item.NoUserRc = false 7807 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7808 item.NoX11Forwarding = false 7809 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7810 item.Permitopen = "" 7811 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7812 item.Principals = "" 7813 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7814 item.Tunnel = "" 7815 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7816 item.Restrict = false 7817 default: 7818 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7819 } 7820 } 7821 } 7822 7823 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) ClearValueRaw(item proto.Message) { 7824 fp.ClearValue(item.(*Device_Spec_SSHConfig_AuthKey)) 7825 } 7826 7827 // IsLeaf - whether field path is holds simple value 7828 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) IsLeaf() bool { 7829 return fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey || 7830 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority || 7831 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand || 7832 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment || 7833 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom || 7834 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding || 7835 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding || 7836 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty || 7837 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc || 7838 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding || 7839 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen || 7840 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals || 7841 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel || 7842 fp.selector == DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict 7843 } 7844 7845 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 7846 return []gotenobject.FieldPath{fp} 7847 } 7848 7849 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecSSHConfigAuthKey_FieldPathValue { 7850 switch fp.selector { 7851 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7852 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7853 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7854 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7855 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7856 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7857 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7858 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7859 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7860 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7861 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7862 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7863 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7864 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7865 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7866 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7867 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7868 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7869 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7870 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7871 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7872 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7873 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7874 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7875 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7876 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(string)} 7877 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7878 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, value: value.(bool)} 7879 default: 7880 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7881 } 7882 } 7883 7884 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 7885 return fp.WithIValue(value) 7886 } 7887 7888 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues { 7889 fpaov := &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp} 7890 switch fp.selector { 7891 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 7892 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7893 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 7894 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7895 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 7896 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7897 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 7898 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7899 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 7900 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7901 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 7902 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7903 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 7904 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7905 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 7906 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7907 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 7908 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7909 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 7910 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7911 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 7912 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7913 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 7914 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7915 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 7916 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]string)} 7917 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 7918 return &DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues{DeviceSpecSSHConfigAuthKey_FieldTerminalPath: *fp, values: values.([]bool)} 7919 default: 7920 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7921 } 7922 return fpaov 7923 } 7924 7925 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 7926 return fp.WithIArrayOfValues(values) 7927 } 7928 7929 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue { 7930 switch fp.selector { 7931 default: 7932 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fp.selector)) 7933 } 7934 } 7935 7936 func (fp *DeviceSpecSSHConfigAuthKey_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 7937 return fp.WithIArrayItemValue(value) 7938 } 7939 7940 // DeviceSpecSSHConfigAuthKey_FieldPathValue allows storing values for AuthKey fields according to their type 7941 type DeviceSpecSSHConfigAuthKey_FieldPathValue interface { 7942 DeviceSpecSSHConfigAuthKey_FieldPath 7943 gotenobject.FieldPathValue 7944 SetTo(target **Device_Spec_SSHConfig_AuthKey) 7945 CompareWith(*Device_Spec_SSHConfig_AuthKey) (cmp int, comparable bool) 7946 } 7947 7948 func ParseDeviceSpecSSHConfigAuthKey_FieldPathValue(pathStr, valueStr string) (DeviceSpecSSHConfigAuthKey_FieldPathValue, error) { 7949 fp, err := ParseDeviceSpecSSHConfigAuthKey_FieldPath(pathStr) 7950 if err != nil { 7951 return nil, err 7952 } 7953 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 7954 if err != nil { 7955 return nil, status.Errorf(codes.InvalidArgument, "error parsing AuthKey field path value from %s: %v", valueStr, err) 7956 } 7957 return fpv.(DeviceSpecSSHConfigAuthKey_FieldPathValue), nil 7958 } 7959 7960 func MustParseDeviceSpecSSHConfigAuthKey_FieldPathValue(pathStr, valueStr string) DeviceSpecSSHConfigAuthKey_FieldPathValue { 7961 fpv, err := ParseDeviceSpecSSHConfigAuthKey_FieldPathValue(pathStr, valueStr) 7962 if err != nil { 7963 panic(err) 7964 } 7965 return fpv 7966 } 7967 7968 type DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue struct { 7969 DeviceSpecSSHConfigAuthKey_FieldTerminalPath 7970 value interface{} 7971 } 7972 7973 var _ DeviceSpecSSHConfigAuthKey_FieldPathValue = (*DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue)(nil) 7974 7975 // GetRawValue returns raw value stored under selected path for 'AuthKey' as interface{} 7976 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) GetRawValue() interface{} { 7977 return fpv.value 7978 } 7979 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsSshaKeyValue() (string, bool) { 7980 res, ok := fpv.value.(string) 7981 return res, ok 7982 } 7983 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsCertAuthorityValue() (bool, bool) { 7984 res, ok := fpv.value.(bool) 7985 return res, ok 7986 } 7987 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsCommandValue() (string, bool) { 7988 res, ok := fpv.value.(string) 7989 return res, ok 7990 } 7991 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsEnvironmentValue() (string, bool) { 7992 res, ok := fpv.value.(string) 7993 return res, ok 7994 } 7995 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsFromValue() (string, bool) { 7996 res, ok := fpv.value.(string) 7997 return res, ok 7998 } 7999 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsNoAgentForwardingValue() (bool, bool) { 8000 res, ok := fpv.value.(bool) 8001 return res, ok 8002 } 8003 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsNoPortForwardingValue() (bool, bool) { 8004 res, ok := fpv.value.(bool) 8005 return res, ok 8006 } 8007 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsNoPtyValue() (bool, bool) { 8008 res, ok := fpv.value.(bool) 8009 return res, ok 8010 } 8011 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsNoUserRcValue() (bool, bool) { 8012 res, ok := fpv.value.(bool) 8013 return res, ok 8014 } 8015 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsNoX11ForwardingValue() (bool, bool) { 8016 res, ok := fpv.value.(bool) 8017 return res, ok 8018 } 8019 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsPermitopenValue() (string, bool) { 8020 res, ok := fpv.value.(string) 8021 return res, ok 8022 } 8023 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsPrincipalsValue() (string, bool) { 8024 res, ok := fpv.value.(string) 8025 return res, ok 8026 } 8027 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsTunnelValue() (string, bool) { 8028 res, ok := fpv.value.(string) 8029 return res, ok 8030 } 8031 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) AsRestrictValue() (bool, bool) { 8032 res, ok := fpv.value.(bool) 8033 return res, ok 8034 } 8035 8036 // SetTo stores value for selected field for object AuthKey 8037 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) SetTo(target **Device_Spec_SSHConfig_AuthKey) { 8038 if *target == nil { 8039 *target = new(Device_Spec_SSHConfig_AuthKey) 8040 } 8041 switch fpv.selector { 8042 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 8043 (*target).SshaKey = fpv.value.(string) 8044 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 8045 (*target).CertAuthority = fpv.value.(bool) 8046 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 8047 (*target).Command = fpv.value.(string) 8048 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 8049 (*target).Environment = fpv.value.(string) 8050 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 8051 (*target).From = fpv.value.(string) 8052 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 8053 (*target).NoAgentForwarding = fpv.value.(bool) 8054 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 8055 (*target).NoPortForwarding = fpv.value.(bool) 8056 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 8057 (*target).NoPty = fpv.value.(bool) 8058 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 8059 (*target).NoUserRc = fpv.value.(bool) 8060 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 8061 (*target).NoX11Forwarding = fpv.value.(bool) 8062 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 8063 (*target).Permitopen = fpv.value.(string) 8064 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 8065 (*target).Principals = fpv.value.(string) 8066 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 8067 (*target).Tunnel = fpv.value.(string) 8068 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 8069 (*target).Restrict = fpv.value.(bool) 8070 default: 8071 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fpv.selector)) 8072 } 8073 } 8074 8075 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) SetToRaw(target proto.Message) { 8076 typedObject := target.(*Device_Spec_SSHConfig_AuthKey) 8077 fpv.SetTo(&typedObject) 8078 } 8079 8080 // CompareWith compares value in the 'DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue' with the value under path in 'Device_Spec_SSHConfig_AuthKey'. 8081 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) CompareWith(source *Device_Spec_SSHConfig_AuthKey) (int, bool) { 8082 switch fpv.selector { 8083 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 8084 leftValue := fpv.value.(string) 8085 rightValue := source.GetSshaKey() 8086 if (leftValue) == (rightValue) { 8087 return 0, true 8088 } else if (leftValue) < (rightValue) { 8089 return -1, true 8090 } else { 8091 return 1, true 8092 } 8093 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 8094 leftValue := fpv.value.(bool) 8095 rightValue := source.GetCertAuthority() 8096 if (leftValue) == (rightValue) { 8097 return 0, true 8098 } else if !(leftValue) && (rightValue) { 8099 return -1, true 8100 } else { 8101 return 1, true 8102 } 8103 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 8104 leftValue := fpv.value.(string) 8105 rightValue := source.GetCommand() 8106 if (leftValue) == (rightValue) { 8107 return 0, true 8108 } else if (leftValue) < (rightValue) { 8109 return -1, true 8110 } else { 8111 return 1, true 8112 } 8113 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 8114 leftValue := fpv.value.(string) 8115 rightValue := source.GetEnvironment() 8116 if (leftValue) == (rightValue) { 8117 return 0, true 8118 } else if (leftValue) < (rightValue) { 8119 return -1, true 8120 } else { 8121 return 1, true 8122 } 8123 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 8124 leftValue := fpv.value.(string) 8125 rightValue := source.GetFrom() 8126 if (leftValue) == (rightValue) { 8127 return 0, true 8128 } else if (leftValue) < (rightValue) { 8129 return -1, true 8130 } else { 8131 return 1, true 8132 } 8133 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 8134 leftValue := fpv.value.(bool) 8135 rightValue := source.GetNoAgentForwarding() 8136 if (leftValue) == (rightValue) { 8137 return 0, true 8138 } else if !(leftValue) && (rightValue) { 8139 return -1, true 8140 } else { 8141 return 1, true 8142 } 8143 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 8144 leftValue := fpv.value.(bool) 8145 rightValue := source.GetNoPortForwarding() 8146 if (leftValue) == (rightValue) { 8147 return 0, true 8148 } else if !(leftValue) && (rightValue) { 8149 return -1, true 8150 } else { 8151 return 1, true 8152 } 8153 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 8154 leftValue := fpv.value.(bool) 8155 rightValue := source.GetNoPty() 8156 if (leftValue) == (rightValue) { 8157 return 0, true 8158 } else if !(leftValue) && (rightValue) { 8159 return -1, true 8160 } else { 8161 return 1, true 8162 } 8163 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 8164 leftValue := fpv.value.(bool) 8165 rightValue := source.GetNoUserRc() 8166 if (leftValue) == (rightValue) { 8167 return 0, true 8168 } else if !(leftValue) && (rightValue) { 8169 return -1, true 8170 } else { 8171 return 1, true 8172 } 8173 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 8174 leftValue := fpv.value.(bool) 8175 rightValue := source.GetNoX11Forwarding() 8176 if (leftValue) == (rightValue) { 8177 return 0, true 8178 } else if !(leftValue) && (rightValue) { 8179 return -1, true 8180 } else { 8181 return 1, true 8182 } 8183 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 8184 leftValue := fpv.value.(string) 8185 rightValue := source.GetPermitopen() 8186 if (leftValue) == (rightValue) { 8187 return 0, true 8188 } else if (leftValue) < (rightValue) { 8189 return -1, true 8190 } else { 8191 return 1, true 8192 } 8193 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 8194 leftValue := fpv.value.(string) 8195 rightValue := source.GetPrincipals() 8196 if (leftValue) == (rightValue) { 8197 return 0, true 8198 } else if (leftValue) < (rightValue) { 8199 return -1, true 8200 } else { 8201 return 1, true 8202 } 8203 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 8204 leftValue := fpv.value.(string) 8205 rightValue := source.GetTunnel() 8206 if (leftValue) == (rightValue) { 8207 return 0, true 8208 } else if (leftValue) < (rightValue) { 8209 return -1, true 8210 } else { 8211 return 1, true 8212 } 8213 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 8214 leftValue := fpv.value.(bool) 8215 rightValue := source.GetRestrict() 8216 if (leftValue) == (rightValue) { 8217 return 0, true 8218 } else if !(leftValue) && (rightValue) { 8219 return -1, true 8220 } else { 8221 return 1, true 8222 } 8223 default: 8224 panic(fmt.Sprintf("Invalid selector for Device_Spec_SSHConfig_AuthKey: %d", fpv.selector)) 8225 } 8226 } 8227 8228 func (fpv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 8229 return fpv.CompareWith(source.(*Device_Spec_SSHConfig_AuthKey)) 8230 } 8231 8232 // DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue allows storing single item in Path-specific values for AuthKey according to their type 8233 // Present only for array (repeated) types. 8234 type DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue interface { 8235 gotenobject.FieldPathArrayItemValue 8236 DeviceSpecSSHConfigAuthKey_FieldPath 8237 ContainsValue(*Device_Spec_SSHConfig_AuthKey) bool 8238 } 8239 8240 // ParseDeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 8241 func ParseDeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue, error) { 8242 fp, err := ParseDeviceSpecSSHConfigAuthKey_FieldPath(pathStr) 8243 if err != nil { 8244 return nil, err 8245 } 8246 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 8247 if err != nil { 8248 return nil, status.Errorf(codes.InvalidArgument, "error parsing AuthKey field path array item value from %s: %v", valueStr, err) 8249 } 8250 return fpaiv.(DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue), nil 8251 } 8252 8253 func MustParseDeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue { 8254 fpaiv, err := ParseDeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue(pathStr, valueStr) 8255 if err != nil { 8256 panic(err) 8257 } 8258 return fpaiv 8259 } 8260 8261 type DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayItemValue struct { 8262 DeviceSpecSSHConfigAuthKey_FieldTerminalPath 8263 value interface{} 8264 } 8265 8266 var _ DeviceSpecSSHConfigAuthKey_FieldPathArrayItemValue = (*DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayItemValue)(nil) 8267 8268 // GetRawValue returns stored element value for array in object Device_Spec_SSHConfig_AuthKey as interface{} 8269 func (fpaiv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 8270 return fpaiv.value 8271 } 8272 8273 func (fpaiv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_SSHConfig_AuthKey) (interface{}, bool) { 8274 return nil, false 8275 } 8276 8277 func (fpaiv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 8278 return fpaiv.GetSingle(source.(*Device_Spec_SSHConfig_AuthKey)) 8279 } 8280 8281 // Contains returns a boolean indicating if value that is being held is present in given 'AuthKey' 8282 func (fpaiv *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_SSHConfig_AuthKey) bool { 8283 slice := fpaiv.DeviceSpecSSHConfigAuthKey_FieldTerminalPath.Get(source) 8284 for _, v := range slice { 8285 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 8286 if proto.Equal(asProtoMsg, v.(proto.Message)) { 8287 return true 8288 } 8289 } else if reflect.DeepEqual(v, fpaiv.value) { 8290 return true 8291 } 8292 } 8293 return false 8294 } 8295 8296 // DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues allows storing slice of values for AuthKey fields according to their type 8297 type DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues interface { 8298 gotenobject.FieldPathArrayOfValues 8299 DeviceSpecSSHConfigAuthKey_FieldPath 8300 } 8301 8302 func ParseDeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues, error) { 8303 fp, err := ParseDeviceSpecSSHConfigAuthKey_FieldPath(pathStr) 8304 if err != nil { 8305 return nil, err 8306 } 8307 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 8308 if err != nil { 8309 return nil, status.Errorf(codes.InvalidArgument, "error parsing AuthKey field path array of values from %s: %v", valuesStr, err) 8310 } 8311 return fpaov.(DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues), nil 8312 } 8313 8314 func MustParseDeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues { 8315 fpaov, err := ParseDeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues(pathStr, valuesStr) 8316 if err != nil { 8317 panic(err) 8318 } 8319 return fpaov 8320 } 8321 8322 type DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues struct { 8323 DeviceSpecSSHConfigAuthKey_FieldTerminalPath 8324 values interface{} 8325 } 8326 8327 var _ DeviceSpecSSHConfigAuthKey_FieldPathArrayOfValues = (*DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues)(nil) 8328 8329 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 8330 switch fpaov.selector { 8331 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorSshaKey: 8332 for _, v := range fpaov.values.([]string) { 8333 values = append(values, v) 8334 } 8335 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCertAuthority: 8336 for _, v := range fpaov.values.([]bool) { 8337 values = append(values, v) 8338 } 8339 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorCommand: 8340 for _, v := range fpaov.values.([]string) { 8341 values = append(values, v) 8342 } 8343 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorEnvironment: 8344 for _, v := range fpaov.values.([]string) { 8345 values = append(values, v) 8346 } 8347 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorFrom: 8348 for _, v := range fpaov.values.([]string) { 8349 values = append(values, v) 8350 } 8351 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoAgentForwarding: 8352 for _, v := range fpaov.values.([]bool) { 8353 values = append(values, v) 8354 } 8355 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPortForwarding: 8356 for _, v := range fpaov.values.([]bool) { 8357 values = append(values, v) 8358 } 8359 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoPty: 8360 for _, v := range fpaov.values.([]bool) { 8361 values = append(values, v) 8362 } 8363 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoUserRc: 8364 for _, v := range fpaov.values.([]bool) { 8365 values = append(values, v) 8366 } 8367 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorNoX11Forwarding: 8368 for _, v := range fpaov.values.([]bool) { 8369 values = append(values, v) 8370 } 8371 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPermitopen: 8372 for _, v := range fpaov.values.([]string) { 8373 values = append(values, v) 8374 } 8375 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorPrincipals: 8376 for _, v := range fpaov.values.([]string) { 8377 values = append(values, v) 8378 } 8379 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorTunnel: 8380 for _, v := range fpaov.values.([]string) { 8381 values = append(values, v) 8382 } 8383 case DeviceSpecSSHConfigAuthKey_FieldPathSelectorRestrict: 8384 for _, v := range fpaov.values.([]bool) { 8385 values = append(values, v) 8386 } 8387 } 8388 return 8389 } 8390 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsSshaKeyArrayOfValues() ([]string, bool) { 8391 res, ok := fpaov.values.([]string) 8392 return res, ok 8393 } 8394 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsCertAuthorityArrayOfValues() ([]bool, bool) { 8395 res, ok := fpaov.values.([]bool) 8396 return res, ok 8397 } 8398 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsCommandArrayOfValues() ([]string, bool) { 8399 res, ok := fpaov.values.([]string) 8400 return res, ok 8401 } 8402 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsEnvironmentArrayOfValues() ([]string, bool) { 8403 res, ok := fpaov.values.([]string) 8404 return res, ok 8405 } 8406 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsFromArrayOfValues() ([]string, bool) { 8407 res, ok := fpaov.values.([]string) 8408 return res, ok 8409 } 8410 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsNoAgentForwardingArrayOfValues() ([]bool, bool) { 8411 res, ok := fpaov.values.([]bool) 8412 return res, ok 8413 } 8414 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsNoPortForwardingArrayOfValues() ([]bool, bool) { 8415 res, ok := fpaov.values.([]bool) 8416 return res, ok 8417 } 8418 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsNoPtyArrayOfValues() ([]bool, bool) { 8419 res, ok := fpaov.values.([]bool) 8420 return res, ok 8421 } 8422 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsNoUserRcArrayOfValues() ([]bool, bool) { 8423 res, ok := fpaov.values.([]bool) 8424 return res, ok 8425 } 8426 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsNoX11ForwardingArrayOfValues() ([]bool, bool) { 8427 res, ok := fpaov.values.([]bool) 8428 return res, ok 8429 } 8430 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsPermitopenArrayOfValues() ([]string, bool) { 8431 res, ok := fpaov.values.([]string) 8432 return res, ok 8433 } 8434 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsPrincipalsArrayOfValues() ([]string, bool) { 8435 res, ok := fpaov.values.([]string) 8436 return res, ok 8437 } 8438 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsTunnelArrayOfValues() ([]string, bool) { 8439 res, ok := fpaov.values.([]string) 8440 return res, ok 8441 } 8442 func (fpaov *DeviceSpecSSHConfigAuthKey_FieldTerminalPathArrayOfValues) AsRestrictArrayOfValues() ([]bool, bool) { 8443 res, ok := fpaov.values.([]bool) 8444 return res, ok 8445 } 8446 8447 // FieldPath provides implementation to handle 8448 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 8449 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath interface { 8450 gotenobject.FieldPath 8451 Selector() DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelector 8452 Get(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) []interface{} 8453 GetSingle(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) (interface{}, bool) 8454 ClearValue(item *Device_Spec_LoggingConfig_ContainerLoggingConfig) 8455 8456 // Those methods build corresponding DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue 8457 // (or array of values) and holds passed value. Panics if injected type is incorrect. 8458 WithIValue(value interface{}) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue 8459 WithIArrayOfValues(values interface{}) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues 8460 WithIArrayItemValue(value interface{}) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue 8461 } 8462 8463 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelector int32 8464 8465 const ( 8466 DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelector = 0 8467 ) 8468 8469 func (s DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelector) String() string { 8470 switch s { 8471 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8472 return "enable_container_log_export" 8473 default: 8474 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", s)) 8475 } 8476 } 8477 8478 func BuildDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath, error) { 8479 if len(fp) == 0 { 8480 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_LoggingConfig_ContainerLoggingConfig") 8481 } 8482 if len(fp) == 1 { 8483 switch fp[0] { 8484 case "enable_container_log_export", "enableContainerLogExport", "enable-container-log-export": 8485 return &DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath{selector: DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport}, nil 8486 } 8487 } 8488 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_LoggingConfig_ContainerLoggingConfig", fp) 8489 } 8490 8491 func ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(rawField string) (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath, error) { 8492 fp, err := gotenobject.ParseRawFieldPath(rawField) 8493 if err != nil { 8494 return nil, err 8495 } 8496 return BuildDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(fp) 8497 } 8498 8499 func MustParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(rawField string) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath { 8500 fp, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(rawField) 8501 if err != nil { 8502 panic(err) 8503 } 8504 return fp 8505 } 8506 8507 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath struct { 8508 selector DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelector 8509 } 8510 8511 var _ DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath = (*DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath)(nil) 8512 8513 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) Selector() DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelector { 8514 return fp.selector 8515 } 8516 8517 // String returns path representation in proto convention 8518 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) String() string { 8519 return fp.selector.String() 8520 } 8521 8522 // JSONString returns path representation is JSON convention 8523 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) JSONString() string { 8524 return strcase.ToLowerCamel(fp.String()) 8525 } 8526 8527 // Get returns all values pointed by specific field from source Device_Spec_LoggingConfig_ContainerLoggingConfig 8528 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) Get(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) (values []interface{}) { 8529 if source != nil { 8530 switch fp.selector { 8531 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8532 values = append(values, source.EnableContainerLogExport) 8533 default: 8534 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8535 } 8536 } 8537 return 8538 } 8539 8540 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 8541 return fp.Get(source.(*Device_Spec_LoggingConfig_ContainerLoggingConfig)) 8542 } 8543 8544 // GetSingle returns value pointed by specific field of from source Device_Spec_LoggingConfig_ContainerLoggingConfig 8545 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) GetSingle(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) (interface{}, bool) { 8546 switch fp.selector { 8547 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8548 return source.GetEnableContainerLogExport(), source != nil 8549 default: 8550 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8551 } 8552 } 8553 8554 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 8555 return fp.GetSingle(source.(*Device_Spec_LoggingConfig_ContainerLoggingConfig)) 8556 } 8557 8558 // GetDefault returns a default value of the field type 8559 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) GetDefault() interface{} { 8560 switch fp.selector { 8561 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8562 return false 8563 default: 8564 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8565 } 8566 } 8567 8568 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) ClearValue(item *Device_Spec_LoggingConfig_ContainerLoggingConfig) { 8569 if item != nil { 8570 switch fp.selector { 8571 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8572 item.EnableContainerLogExport = false 8573 default: 8574 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8575 } 8576 } 8577 } 8578 8579 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) ClearValueRaw(item proto.Message) { 8580 fp.ClearValue(item.(*Device_Spec_LoggingConfig_ContainerLoggingConfig)) 8581 } 8582 8583 // IsLeaf - whether field path is holds simple value 8584 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) IsLeaf() bool { 8585 return fp.selector == DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport 8586 } 8587 8588 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 8589 return []gotenobject.FieldPath{fp} 8590 } 8591 8592 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue { 8593 switch fp.selector { 8594 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8595 return &DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue{DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath: *fp, value: value.(bool)} 8596 default: 8597 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8598 } 8599 } 8600 8601 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 8602 return fp.WithIValue(value) 8603 } 8604 8605 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues { 8606 fpaov := &DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath: *fp} 8607 switch fp.selector { 8608 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8609 return &DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayOfValues{DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath: *fp, values: values.([]bool)} 8610 default: 8611 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8612 } 8613 return fpaov 8614 } 8615 8616 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 8617 return fp.WithIArrayOfValues(values) 8618 } 8619 8620 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue { 8621 switch fp.selector { 8622 default: 8623 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fp.selector)) 8624 } 8625 } 8626 8627 func (fp *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 8628 return fp.WithIArrayItemValue(value) 8629 } 8630 8631 // DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue allows storing values for ContainerLoggingConfig fields according to their type 8632 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue interface { 8633 DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath 8634 gotenobject.FieldPathValue 8635 SetTo(target **Device_Spec_LoggingConfig_ContainerLoggingConfig) 8636 CompareWith(*Device_Spec_LoggingConfig_ContainerLoggingConfig) (cmp int, comparable bool) 8637 } 8638 8639 func ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue(pathStr, valueStr string) (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue, error) { 8640 fp, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(pathStr) 8641 if err != nil { 8642 return nil, err 8643 } 8644 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 8645 if err != nil { 8646 return nil, status.Errorf(codes.InvalidArgument, "error parsing ContainerLoggingConfig field path value from %s: %v", valueStr, err) 8647 } 8648 return fpv.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue), nil 8649 } 8650 8651 func MustParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue(pathStr, valueStr string) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue { 8652 fpv, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue(pathStr, valueStr) 8653 if err != nil { 8654 panic(err) 8655 } 8656 return fpv 8657 } 8658 8659 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue struct { 8660 DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath 8661 value interface{} 8662 } 8663 8664 var _ DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathValue = (*DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue)(nil) 8665 8666 // GetRawValue returns raw value stored under selected path for 'ContainerLoggingConfig' as interface{} 8667 func (fpv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue) GetRawValue() interface{} { 8668 return fpv.value 8669 } 8670 func (fpv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue) AsEnableContainerLogExportValue() (bool, bool) { 8671 res, ok := fpv.value.(bool) 8672 return res, ok 8673 } 8674 8675 // SetTo stores value for selected field for object ContainerLoggingConfig 8676 func (fpv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue) SetTo(target **Device_Spec_LoggingConfig_ContainerLoggingConfig) { 8677 if *target == nil { 8678 *target = new(Device_Spec_LoggingConfig_ContainerLoggingConfig) 8679 } 8680 switch fpv.selector { 8681 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8682 (*target).EnableContainerLogExport = fpv.value.(bool) 8683 default: 8684 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fpv.selector)) 8685 } 8686 } 8687 8688 func (fpv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue) SetToRaw(target proto.Message) { 8689 typedObject := target.(*Device_Spec_LoggingConfig_ContainerLoggingConfig) 8690 fpv.SetTo(&typedObject) 8691 } 8692 8693 // CompareWith compares value in the 'DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue' with the value under path in 'Device_Spec_LoggingConfig_ContainerLoggingConfig'. 8694 func (fpv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue) CompareWith(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) (int, bool) { 8695 switch fpv.selector { 8696 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8697 leftValue := fpv.value.(bool) 8698 rightValue := source.GetEnableContainerLogExport() 8699 if (leftValue) == (rightValue) { 8700 return 0, true 8701 } else if !(leftValue) && (rightValue) { 8702 return -1, true 8703 } else { 8704 return 1, true 8705 } 8706 default: 8707 panic(fmt.Sprintf("Invalid selector for Device_Spec_LoggingConfig_ContainerLoggingConfig: %d", fpv.selector)) 8708 } 8709 } 8710 8711 func (fpv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 8712 return fpv.CompareWith(source.(*Device_Spec_LoggingConfig_ContainerLoggingConfig)) 8713 } 8714 8715 // DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue allows storing single item in Path-specific values for ContainerLoggingConfig according to their type 8716 // Present only for array (repeated) types. 8717 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue interface { 8718 gotenobject.FieldPathArrayItemValue 8719 DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath 8720 ContainsValue(*Device_Spec_LoggingConfig_ContainerLoggingConfig) bool 8721 } 8722 8723 // ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 8724 func ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue, error) { 8725 fp, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(pathStr) 8726 if err != nil { 8727 return nil, err 8728 } 8729 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 8730 if err != nil { 8731 return nil, status.Errorf(codes.InvalidArgument, "error parsing ContainerLoggingConfig field path array item value from %s: %v", valueStr, err) 8732 } 8733 return fpaiv.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue), nil 8734 } 8735 8736 func MustParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue { 8737 fpaiv, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue(pathStr, valueStr) 8738 if err != nil { 8739 panic(err) 8740 } 8741 return fpaiv 8742 } 8743 8744 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayItemValue struct { 8745 DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath 8746 value interface{} 8747 } 8748 8749 var _ DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayItemValue = (*DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayItemValue)(nil) 8750 8751 // GetRawValue returns stored element value for array in object Device_Spec_LoggingConfig_ContainerLoggingConfig as interface{} 8752 func (fpaiv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 8753 return fpaiv.value 8754 } 8755 8756 func (fpaiv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) (interface{}, bool) { 8757 return nil, false 8758 } 8759 8760 func (fpaiv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 8761 return fpaiv.GetSingle(source.(*Device_Spec_LoggingConfig_ContainerLoggingConfig)) 8762 } 8763 8764 // Contains returns a boolean indicating if value that is being held is present in given 'ContainerLoggingConfig' 8765 func (fpaiv *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_LoggingConfig_ContainerLoggingConfig) bool { 8766 slice := fpaiv.DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath.Get(source) 8767 for _, v := range slice { 8768 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 8769 if proto.Equal(asProtoMsg, v.(proto.Message)) { 8770 return true 8771 } 8772 } else if reflect.DeepEqual(v, fpaiv.value) { 8773 return true 8774 } 8775 } 8776 return false 8777 } 8778 8779 // DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues allows storing slice of values for ContainerLoggingConfig fields according to their type 8780 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues interface { 8781 gotenobject.FieldPathArrayOfValues 8782 DeviceSpecLoggingConfigContainerLoggingConfig_FieldPath 8783 } 8784 8785 func ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues, error) { 8786 fp, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPath(pathStr) 8787 if err != nil { 8788 return nil, err 8789 } 8790 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 8791 if err != nil { 8792 return nil, status.Errorf(codes.InvalidArgument, "error parsing ContainerLoggingConfig field path array of values from %s: %v", valuesStr, err) 8793 } 8794 return fpaov.(DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues), nil 8795 } 8796 8797 func MustParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues { 8798 fpaov, err := ParseDeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues(pathStr, valuesStr) 8799 if err != nil { 8800 panic(err) 8801 } 8802 return fpaov 8803 } 8804 8805 type DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayOfValues struct { 8806 DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPath 8807 values interface{} 8808 } 8809 8810 var _ DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathArrayOfValues = (*DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayOfValues)(nil) 8811 8812 func (fpaov *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 8813 switch fpaov.selector { 8814 case DeviceSpecLoggingConfigContainerLoggingConfig_FieldPathSelectorEnableContainerLogExport: 8815 for _, v := range fpaov.values.([]bool) { 8816 values = append(values, v) 8817 } 8818 } 8819 return 8820 } 8821 func (fpaov *DeviceSpecLoggingConfigContainerLoggingConfig_FieldTerminalPathArrayOfValues) AsEnableContainerLogExportArrayOfValues() ([]bool, bool) { 8822 res, ok := fpaov.values.([]bool) 8823 return res, ok 8824 } 8825 8826 // FieldPath provides implementation to handle 8827 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 8828 type DeviceSpecUSBGuardPort_FieldPath interface { 8829 gotenobject.FieldPath 8830 Selector() DeviceSpecUSBGuardPort_FieldPathSelector 8831 Get(source *Device_Spec_USBGuard_Port) []interface{} 8832 GetSingle(source *Device_Spec_USBGuard_Port) (interface{}, bool) 8833 ClearValue(item *Device_Spec_USBGuard_Port) 8834 8835 // Those methods build corresponding DeviceSpecUSBGuardPort_FieldPathValue 8836 // (or array of values) and holds passed value. Panics if injected type is incorrect. 8837 WithIValue(value interface{}) DeviceSpecUSBGuardPort_FieldPathValue 8838 WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardPort_FieldPathArrayOfValues 8839 WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardPort_FieldPathArrayItemValue 8840 } 8841 8842 type DeviceSpecUSBGuardPort_FieldPathSelector int32 8843 8844 const ( 8845 DeviceSpecUSBGuardPort_FieldPathSelectorEquals DeviceSpecUSBGuardPort_FieldPathSelector = 0 8846 DeviceSpecUSBGuardPort_FieldPathSelectorOneOf DeviceSpecUSBGuardPort_FieldPathSelector = 1 8847 ) 8848 8849 func (s DeviceSpecUSBGuardPort_FieldPathSelector) String() string { 8850 switch s { 8851 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 8852 return "equals" 8853 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 8854 return "one_of" 8855 default: 8856 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", s)) 8857 } 8858 } 8859 8860 func BuildDeviceSpecUSBGuardPort_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecUSBGuardPort_FieldPath, error) { 8861 if len(fp) == 0 { 8862 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_USBGuard_Port") 8863 } 8864 if len(fp) == 1 { 8865 switch fp[0] { 8866 case "equals": 8867 return &DeviceSpecUSBGuardPort_FieldTerminalPath{selector: DeviceSpecUSBGuardPort_FieldPathSelectorEquals}, nil 8868 case "one_of", "oneOf", "one-of": 8869 return &DeviceSpecUSBGuardPort_FieldTerminalPath{selector: DeviceSpecUSBGuardPort_FieldPathSelectorOneOf}, nil 8870 } 8871 } 8872 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_USBGuard_Port", fp) 8873 } 8874 8875 func ParseDeviceSpecUSBGuardPort_FieldPath(rawField string) (DeviceSpecUSBGuardPort_FieldPath, error) { 8876 fp, err := gotenobject.ParseRawFieldPath(rawField) 8877 if err != nil { 8878 return nil, err 8879 } 8880 return BuildDeviceSpecUSBGuardPort_FieldPath(fp) 8881 } 8882 8883 func MustParseDeviceSpecUSBGuardPort_FieldPath(rawField string) DeviceSpecUSBGuardPort_FieldPath { 8884 fp, err := ParseDeviceSpecUSBGuardPort_FieldPath(rawField) 8885 if err != nil { 8886 panic(err) 8887 } 8888 return fp 8889 } 8890 8891 type DeviceSpecUSBGuardPort_FieldTerminalPath struct { 8892 selector DeviceSpecUSBGuardPort_FieldPathSelector 8893 } 8894 8895 var _ DeviceSpecUSBGuardPort_FieldPath = (*DeviceSpecUSBGuardPort_FieldTerminalPath)(nil) 8896 8897 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) Selector() DeviceSpecUSBGuardPort_FieldPathSelector { 8898 return fp.selector 8899 } 8900 8901 // String returns path representation in proto convention 8902 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) String() string { 8903 return fp.selector.String() 8904 } 8905 8906 // JSONString returns path representation is JSON convention 8907 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) JSONString() string { 8908 return strcase.ToLowerCamel(fp.String()) 8909 } 8910 8911 // Get returns all values pointed by specific field from source Device_Spec_USBGuard_Port 8912 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) Get(source *Device_Spec_USBGuard_Port) (values []interface{}) { 8913 if source != nil { 8914 switch fp.selector { 8915 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 8916 for _, value := range source.GetEquals() { 8917 values = append(values, value) 8918 } 8919 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 8920 for _, value := range source.GetOneOf() { 8921 values = append(values, value) 8922 } 8923 default: 8924 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 8925 } 8926 } 8927 return 8928 } 8929 8930 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 8931 return fp.Get(source.(*Device_Spec_USBGuard_Port)) 8932 } 8933 8934 // GetSingle returns value pointed by specific field of from source Device_Spec_USBGuard_Port 8935 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) GetSingle(source *Device_Spec_USBGuard_Port) (interface{}, bool) { 8936 switch fp.selector { 8937 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 8938 res := source.GetEquals() 8939 return res, res != nil 8940 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 8941 res := source.GetOneOf() 8942 return res, res != nil 8943 default: 8944 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 8945 } 8946 } 8947 8948 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 8949 return fp.GetSingle(source.(*Device_Spec_USBGuard_Port)) 8950 } 8951 8952 // GetDefault returns a default value of the field type 8953 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) GetDefault() interface{} { 8954 switch fp.selector { 8955 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 8956 return ([]string)(nil) 8957 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 8958 return ([]string)(nil) 8959 default: 8960 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 8961 } 8962 } 8963 8964 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) ClearValue(item *Device_Spec_USBGuard_Port) { 8965 if item != nil { 8966 switch fp.selector { 8967 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 8968 item.Equals = nil 8969 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 8970 item.OneOf = nil 8971 default: 8972 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 8973 } 8974 } 8975 } 8976 8977 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) ClearValueRaw(item proto.Message) { 8978 fp.ClearValue(item.(*Device_Spec_USBGuard_Port)) 8979 } 8980 8981 // IsLeaf - whether field path is holds simple value 8982 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) IsLeaf() bool { 8983 return fp.selector == DeviceSpecUSBGuardPort_FieldPathSelectorEquals || 8984 fp.selector == DeviceSpecUSBGuardPort_FieldPathSelectorOneOf 8985 } 8986 8987 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 8988 return []gotenobject.FieldPath{fp} 8989 } 8990 8991 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecUSBGuardPort_FieldPathValue { 8992 switch fp.selector { 8993 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 8994 return &DeviceSpecUSBGuardPort_FieldTerminalPathValue{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp, value: value.([]string)} 8995 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 8996 return &DeviceSpecUSBGuardPort_FieldTerminalPathValue{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp, value: value.([]string)} 8997 default: 8998 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 8999 } 9000 } 9001 9002 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 9003 return fp.WithIValue(value) 9004 } 9005 9006 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardPort_FieldPathArrayOfValues { 9007 fpaov := &DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp} 9008 switch fp.selector { 9009 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 9010 return &DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp, values: values.([][]string)} 9011 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 9012 return &DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp, values: values.([][]string)} 9013 default: 9014 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 9015 } 9016 return fpaov 9017 } 9018 9019 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 9020 return fp.WithIArrayOfValues(values) 9021 } 9022 9023 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardPort_FieldPathArrayItemValue { 9024 switch fp.selector { 9025 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 9026 return &DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp, value: value.(string)} 9027 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 9028 return &DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue{DeviceSpecUSBGuardPort_FieldTerminalPath: *fp, value: value.(string)} 9029 default: 9030 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fp.selector)) 9031 } 9032 } 9033 9034 func (fp *DeviceSpecUSBGuardPort_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 9035 return fp.WithIArrayItemValue(value) 9036 } 9037 9038 // DeviceSpecUSBGuardPort_FieldPathValue allows storing values for Port fields according to their type 9039 type DeviceSpecUSBGuardPort_FieldPathValue interface { 9040 DeviceSpecUSBGuardPort_FieldPath 9041 gotenobject.FieldPathValue 9042 SetTo(target **Device_Spec_USBGuard_Port) 9043 CompareWith(*Device_Spec_USBGuard_Port) (cmp int, comparable bool) 9044 } 9045 9046 func ParseDeviceSpecUSBGuardPort_FieldPathValue(pathStr, valueStr string) (DeviceSpecUSBGuardPort_FieldPathValue, error) { 9047 fp, err := ParseDeviceSpecUSBGuardPort_FieldPath(pathStr) 9048 if err != nil { 9049 return nil, err 9050 } 9051 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 9052 if err != nil { 9053 return nil, status.Errorf(codes.InvalidArgument, "error parsing Port field path value from %s: %v", valueStr, err) 9054 } 9055 return fpv.(DeviceSpecUSBGuardPort_FieldPathValue), nil 9056 } 9057 9058 func MustParseDeviceSpecUSBGuardPort_FieldPathValue(pathStr, valueStr string) DeviceSpecUSBGuardPort_FieldPathValue { 9059 fpv, err := ParseDeviceSpecUSBGuardPort_FieldPathValue(pathStr, valueStr) 9060 if err != nil { 9061 panic(err) 9062 } 9063 return fpv 9064 } 9065 9066 type DeviceSpecUSBGuardPort_FieldTerminalPathValue struct { 9067 DeviceSpecUSBGuardPort_FieldTerminalPath 9068 value interface{} 9069 } 9070 9071 var _ DeviceSpecUSBGuardPort_FieldPathValue = (*DeviceSpecUSBGuardPort_FieldTerminalPathValue)(nil) 9072 9073 // GetRawValue returns raw value stored under selected path for 'Port' as interface{} 9074 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) GetRawValue() interface{} { 9075 return fpv.value 9076 } 9077 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) AsEqualsValue() ([]string, bool) { 9078 res, ok := fpv.value.([]string) 9079 return res, ok 9080 } 9081 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) AsOneOfValue() ([]string, bool) { 9082 res, ok := fpv.value.([]string) 9083 return res, ok 9084 } 9085 9086 // SetTo stores value for selected field for object Port 9087 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) SetTo(target **Device_Spec_USBGuard_Port) { 9088 if *target == nil { 9089 *target = new(Device_Spec_USBGuard_Port) 9090 } 9091 switch fpv.selector { 9092 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 9093 (*target).Equals = fpv.value.([]string) 9094 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 9095 (*target).OneOf = fpv.value.([]string) 9096 default: 9097 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fpv.selector)) 9098 } 9099 } 9100 9101 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) SetToRaw(target proto.Message) { 9102 typedObject := target.(*Device_Spec_USBGuard_Port) 9103 fpv.SetTo(&typedObject) 9104 } 9105 9106 // CompareWith compares value in the 'DeviceSpecUSBGuardPort_FieldTerminalPathValue' with the value under path in 'Device_Spec_USBGuard_Port'. 9107 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) CompareWith(source *Device_Spec_USBGuard_Port) (int, bool) { 9108 switch fpv.selector { 9109 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 9110 return 0, false 9111 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 9112 return 0, false 9113 default: 9114 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Port: %d", fpv.selector)) 9115 } 9116 } 9117 9118 func (fpv *DeviceSpecUSBGuardPort_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 9119 return fpv.CompareWith(source.(*Device_Spec_USBGuard_Port)) 9120 } 9121 9122 // DeviceSpecUSBGuardPort_FieldPathArrayItemValue allows storing single item in Path-specific values for Port according to their type 9123 // Present only for array (repeated) types. 9124 type DeviceSpecUSBGuardPort_FieldPathArrayItemValue interface { 9125 gotenobject.FieldPathArrayItemValue 9126 DeviceSpecUSBGuardPort_FieldPath 9127 ContainsValue(*Device_Spec_USBGuard_Port) bool 9128 } 9129 9130 // ParseDeviceSpecUSBGuardPort_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 9131 func ParseDeviceSpecUSBGuardPort_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecUSBGuardPort_FieldPathArrayItemValue, error) { 9132 fp, err := ParseDeviceSpecUSBGuardPort_FieldPath(pathStr) 9133 if err != nil { 9134 return nil, err 9135 } 9136 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 9137 if err != nil { 9138 return nil, status.Errorf(codes.InvalidArgument, "error parsing Port field path array item value from %s: %v", valueStr, err) 9139 } 9140 return fpaiv.(DeviceSpecUSBGuardPort_FieldPathArrayItemValue), nil 9141 } 9142 9143 func MustParseDeviceSpecUSBGuardPort_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecUSBGuardPort_FieldPathArrayItemValue { 9144 fpaiv, err := ParseDeviceSpecUSBGuardPort_FieldPathArrayItemValue(pathStr, valueStr) 9145 if err != nil { 9146 panic(err) 9147 } 9148 return fpaiv 9149 } 9150 9151 type DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue struct { 9152 DeviceSpecUSBGuardPort_FieldTerminalPath 9153 value interface{} 9154 } 9155 9156 var _ DeviceSpecUSBGuardPort_FieldPathArrayItemValue = (*DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue)(nil) 9157 9158 // GetRawValue returns stored element value for array in object Device_Spec_USBGuard_Port as interface{} 9159 func (fpaiv *DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 9160 return fpaiv.value 9161 } 9162 func (fpaiv *DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue) AsEqualsItemValue() (string, bool) { 9163 res, ok := fpaiv.value.(string) 9164 return res, ok 9165 } 9166 func (fpaiv *DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue) AsOneOfItemValue() (string, bool) { 9167 res, ok := fpaiv.value.(string) 9168 return res, ok 9169 } 9170 9171 func (fpaiv *DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_USBGuard_Port) (interface{}, bool) { 9172 return nil, false 9173 } 9174 9175 func (fpaiv *DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 9176 return fpaiv.GetSingle(source.(*Device_Spec_USBGuard_Port)) 9177 } 9178 9179 // Contains returns a boolean indicating if value that is being held is present in given 'Port' 9180 func (fpaiv *DeviceSpecUSBGuardPort_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_USBGuard_Port) bool { 9181 slice := fpaiv.DeviceSpecUSBGuardPort_FieldTerminalPath.Get(source) 9182 for _, v := range slice { 9183 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 9184 if proto.Equal(asProtoMsg, v.(proto.Message)) { 9185 return true 9186 } 9187 } else if reflect.DeepEqual(v, fpaiv.value) { 9188 return true 9189 } 9190 } 9191 return false 9192 } 9193 9194 // DeviceSpecUSBGuardPort_FieldPathArrayOfValues allows storing slice of values for Port fields according to their type 9195 type DeviceSpecUSBGuardPort_FieldPathArrayOfValues interface { 9196 gotenobject.FieldPathArrayOfValues 9197 DeviceSpecUSBGuardPort_FieldPath 9198 } 9199 9200 func ParseDeviceSpecUSBGuardPort_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecUSBGuardPort_FieldPathArrayOfValues, error) { 9201 fp, err := ParseDeviceSpecUSBGuardPort_FieldPath(pathStr) 9202 if err != nil { 9203 return nil, err 9204 } 9205 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 9206 if err != nil { 9207 return nil, status.Errorf(codes.InvalidArgument, "error parsing Port field path array of values from %s: %v", valuesStr, err) 9208 } 9209 return fpaov.(DeviceSpecUSBGuardPort_FieldPathArrayOfValues), nil 9210 } 9211 9212 func MustParseDeviceSpecUSBGuardPort_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecUSBGuardPort_FieldPathArrayOfValues { 9213 fpaov, err := ParseDeviceSpecUSBGuardPort_FieldPathArrayOfValues(pathStr, valuesStr) 9214 if err != nil { 9215 panic(err) 9216 } 9217 return fpaov 9218 } 9219 9220 type DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues struct { 9221 DeviceSpecUSBGuardPort_FieldTerminalPath 9222 values interface{} 9223 } 9224 9225 var _ DeviceSpecUSBGuardPort_FieldPathArrayOfValues = (*DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues)(nil) 9226 9227 func (fpaov *DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 9228 switch fpaov.selector { 9229 case DeviceSpecUSBGuardPort_FieldPathSelectorEquals: 9230 for _, v := range fpaov.values.([][]string) { 9231 values = append(values, v) 9232 } 9233 case DeviceSpecUSBGuardPort_FieldPathSelectorOneOf: 9234 for _, v := range fpaov.values.([][]string) { 9235 values = append(values, v) 9236 } 9237 } 9238 return 9239 } 9240 func (fpaov *DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues) AsEqualsArrayOfValues() ([][]string, bool) { 9241 res, ok := fpaov.values.([][]string) 9242 return res, ok 9243 } 9244 func (fpaov *DeviceSpecUSBGuardPort_FieldTerminalPathArrayOfValues) AsOneOfArrayOfValues() ([][]string, bool) { 9245 res, ok := fpaov.values.([][]string) 9246 return res, ok 9247 } 9248 9249 // FieldPath provides implementation to handle 9250 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 9251 type DeviceSpecUSBGuardInterface_FieldPath interface { 9252 gotenobject.FieldPath 9253 Selector() DeviceSpecUSBGuardInterface_FieldPathSelector 9254 Get(source *Device_Spec_USBGuard_Interface) []interface{} 9255 GetSingle(source *Device_Spec_USBGuard_Interface) (interface{}, bool) 9256 ClearValue(item *Device_Spec_USBGuard_Interface) 9257 9258 // Those methods build corresponding DeviceSpecUSBGuardInterface_FieldPathValue 9259 // (or array of values) and holds passed value. Panics if injected type is incorrect. 9260 WithIValue(value interface{}) DeviceSpecUSBGuardInterface_FieldPathValue 9261 WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardInterface_FieldPathArrayOfValues 9262 WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardInterface_FieldPathArrayItemValue 9263 } 9264 9265 type DeviceSpecUSBGuardInterface_FieldPathSelector int32 9266 9267 const ( 9268 DeviceSpecUSBGuardInterface_FieldPathSelectorEquals DeviceSpecUSBGuardInterface_FieldPathSelector = 0 9269 DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf DeviceSpecUSBGuardInterface_FieldPathSelector = 1 9270 ) 9271 9272 func (s DeviceSpecUSBGuardInterface_FieldPathSelector) String() string { 9273 switch s { 9274 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9275 return "equals" 9276 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9277 return "one_of" 9278 default: 9279 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", s)) 9280 } 9281 } 9282 9283 func BuildDeviceSpecUSBGuardInterface_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecUSBGuardInterface_FieldPath, error) { 9284 if len(fp) == 0 { 9285 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_USBGuard_Interface") 9286 } 9287 if len(fp) == 1 { 9288 switch fp[0] { 9289 case "equals": 9290 return &DeviceSpecUSBGuardInterface_FieldTerminalPath{selector: DeviceSpecUSBGuardInterface_FieldPathSelectorEquals}, nil 9291 case "one_of", "oneOf", "one-of": 9292 return &DeviceSpecUSBGuardInterface_FieldTerminalPath{selector: DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf}, nil 9293 } 9294 } 9295 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_USBGuard_Interface", fp) 9296 } 9297 9298 func ParseDeviceSpecUSBGuardInterface_FieldPath(rawField string) (DeviceSpecUSBGuardInterface_FieldPath, error) { 9299 fp, err := gotenobject.ParseRawFieldPath(rawField) 9300 if err != nil { 9301 return nil, err 9302 } 9303 return BuildDeviceSpecUSBGuardInterface_FieldPath(fp) 9304 } 9305 9306 func MustParseDeviceSpecUSBGuardInterface_FieldPath(rawField string) DeviceSpecUSBGuardInterface_FieldPath { 9307 fp, err := ParseDeviceSpecUSBGuardInterface_FieldPath(rawField) 9308 if err != nil { 9309 panic(err) 9310 } 9311 return fp 9312 } 9313 9314 type DeviceSpecUSBGuardInterface_FieldTerminalPath struct { 9315 selector DeviceSpecUSBGuardInterface_FieldPathSelector 9316 } 9317 9318 var _ DeviceSpecUSBGuardInterface_FieldPath = (*DeviceSpecUSBGuardInterface_FieldTerminalPath)(nil) 9319 9320 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) Selector() DeviceSpecUSBGuardInterface_FieldPathSelector { 9321 return fp.selector 9322 } 9323 9324 // String returns path representation in proto convention 9325 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) String() string { 9326 return fp.selector.String() 9327 } 9328 9329 // JSONString returns path representation is JSON convention 9330 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) JSONString() string { 9331 return strcase.ToLowerCamel(fp.String()) 9332 } 9333 9334 // Get returns all values pointed by specific field from source Device_Spec_USBGuard_Interface 9335 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) Get(source *Device_Spec_USBGuard_Interface) (values []interface{}) { 9336 if source != nil { 9337 switch fp.selector { 9338 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9339 for _, value := range source.GetEquals() { 9340 values = append(values, value) 9341 } 9342 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9343 for _, value := range source.GetOneOf() { 9344 values = append(values, value) 9345 } 9346 default: 9347 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9348 } 9349 } 9350 return 9351 } 9352 9353 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 9354 return fp.Get(source.(*Device_Spec_USBGuard_Interface)) 9355 } 9356 9357 // GetSingle returns value pointed by specific field of from source Device_Spec_USBGuard_Interface 9358 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) GetSingle(source *Device_Spec_USBGuard_Interface) (interface{}, bool) { 9359 switch fp.selector { 9360 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9361 res := source.GetEquals() 9362 return res, res != nil 9363 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9364 res := source.GetOneOf() 9365 return res, res != nil 9366 default: 9367 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9368 } 9369 } 9370 9371 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 9372 return fp.GetSingle(source.(*Device_Spec_USBGuard_Interface)) 9373 } 9374 9375 // GetDefault returns a default value of the field type 9376 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) GetDefault() interface{} { 9377 switch fp.selector { 9378 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9379 return ([]string)(nil) 9380 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9381 return ([]string)(nil) 9382 default: 9383 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9384 } 9385 } 9386 9387 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) ClearValue(item *Device_Spec_USBGuard_Interface) { 9388 if item != nil { 9389 switch fp.selector { 9390 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9391 item.Equals = nil 9392 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9393 item.OneOf = nil 9394 default: 9395 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9396 } 9397 } 9398 } 9399 9400 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) ClearValueRaw(item proto.Message) { 9401 fp.ClearValue(item.(*Device_Spec_USBGuard_Interface)) 9402 } 9403 9404 // IsLeaf - whether field path is holds simple value 9405 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) IsLeaf() bool { 9406 return fp.selector == DeviceSpecUSBGuardInterface_FieldPathSelectorEquals || 9407 fp.selector == DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf 9408 } 9409 9410 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 9411 return []gotenobject.FieldPath{fp} 9412 } 9413 9414 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecUSBGuardInterface_FieldPathValue { 9415 switch fp.selector { 9416 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9417 return &DeviceSpecUSBGuardInterface_FieldTerminalPathValue{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp, value: value.([]string)} 9418 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9419 return &DeviceSpecUSBGuardInterface_FieldTerminalPathValue{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp, value: value.([]string)} 9420 default: 9421 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9422 } 9423 } 9424 9425 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 9426 return fp.WithIValue(value) 9427 } 9428 9429 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardInterface_FieldPathArrayOfValues { 9430 fpaov := &DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp} 9431 switch fp.selector { 9432 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9433 return &DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp, values: values.([][]string)} 9434 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9435 return &DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp, values: values.([][]string)} 9436 default: 9437 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9438 } 9439 return fpaov 9440 } 9441 9442 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 9443 return fp.WithIArrayOfValues(values) 9444 } 9445 9446 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardInterface_FieldPathArrayItemValue { 9447 switch fp.selector { 9448 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9449 return &DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp, value: value.(string)} 9450 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9451 return &DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue{DeviceSpecUSBGuardInterface_FieldTerminalPath: *fp, value: value.(string)} 9452 default: 9453 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fp.selector)) 9454 } 9455 } 9456 9457 func (fp *DeviceSpecUSBGuardInterface_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 9458 return fp.WithIArrayItemValue(value) 9459 } 9460 9461 // DeviceSpecUSBGuardInterface_FieldPathValue allows storing values for Interface fields according to their type 9462 type DeviceSpecUSBGuardInterface_FieldPathValue interface { 9463 DeviceSpecUSBGuardInterface_FieldPath 9464 gotenobject.FieldPathValue 9465 SetTo(target **Device_Spec_USBGuard_Interface) 9466 CompareWith(*Device_Spec_USBGuard_Interface) (cmp int, comparable bool) 9467 } 9468 9469 func ParseDeviceSpecUSBGuardInterface_FieldPathValue(pathStr, valueStr string) (DeviceSpecUSBGuardInterface_FieldPathValue, error) { 9470 fp, err := ParseDeviceSpecUSBGuardInterface_FieldPath(pathStr) 9471 if err != nil { 9472 return nil, err 9473 } 9474 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 9475 if err != nil { 9476 return nil, status.Errorf(codes.InvalidArgument, "error parsing Interface field path value from %s: %v", valueStr, err) 9477 } 9478 return fpv.(DeviceSpecUSBGuardInterface_FieldPathValue), nil 9479 } 9480 9481 func MustParseDeviceSpecUSBGuardInterface_FieldPathValue(pathStr, valueStr string) DeviceSpecUSBGuardInterface_FieldPathValue { 9482 fpv, err := ParseDeviceSpecUSBGuardInterface_FieldPathValue(pathStr, valueStr) 9483 if err != nil { 9484 panic(err) 9485 } 9486 return fpv 9487 } 9488 9489 type DeviceSpecUSBGuardInterface_FieldTerminalPathValue struct { 9490 DeviceSpecUSBGuardInterface_FieldTerminalPath 9491 value interface{} 9492 } 9493 9494 var _ DeviceSpecUSBGuardInterface_FieldPathValue = (*DeviceSpecUSBGuardInterface_FieldTerminalPathValue)(nil) 9495 9496 // GetRawValue returns raw value stored under selected path for 'Interface' as interface{} 9497 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) GetRawValue() interface{} { 9498 return fpv.value 9499 } 9500 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) AsEqualsValue() ([]string, bool) { 9501 res, ok := fpv.value.([]string) 9502 return res, ok 9503 } 9504 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) AsOneOfValue() ([]string, bool) { 9505 res, ok := fpv.value.([]string) 9506 return res, ok 9507 } 9508 9509 // SetTo stores value for selected field for object Interface 9510 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) SetTo(target **Device_Spec_USBGuard_Interface) { 9511 if *target == nil { 9512 *target = new(Device_Spec_USBGuard_Interface) 9513 } 9514 switch fpv.selector { 9515 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9516 (*target).Equals = fpv.value.([]string) 9517 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9518 (*target).OneOf = fpv.value.([]string) 9519 default: 9520 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fpv.selector)) 9521 } 9522 } 9523 9524 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) SetToRaw(target proto.Message) { 9525 typedObject := target.(*Device_Spec_USBGuard_Interface) 9526 fpv.SetTo(&typedObject) 9527 } 9528 9529 // CompareWith compares value in the 'DeviceSpecUSBGuardInterface_FieldTerminalPathValue' with the value under path in 'Device_Spec_USBGuard_Interface'. 9530 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) CompareWith(source *Device_Spec_USBGuard_Interface) (int, bool) { 9531 switch fpv.selector { 9532 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9533 return 0, false 9534 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9535 return 0, false 9536 default: 9537 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_Interface: %d", fpv.selector)) 9538 } 9539 } 9540 9541 func (fpv *DeviceSpecUSBGuardInterface_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 9542 return fpv.CompareWith(source.(*Device_Spec_USBGuard_Interface)) 9543 } 9544 9545 // DeviceSpecUSBGuardInterface_FieldPathArrayItemValue allows storing single item in Path-specific values for Interface according to their type 9546 // Present only for array (repeated) types. 9547 type DeviceSpecUSBGuardInterface_FieldPathArrayItemValue interface { 9548 gotenobject.FieldPathArrayItemValue 9549 DeviceSpecUSBGuardInterface_FieldPath 9550 ContainsValue(*Device_Spec_USBGuard_Interface) bool 9551 } 9552 9553 // ParseDeviceSpecUSBGuardInterface_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 9554 func ParseDeviceSpecUSBGuardInterface_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecUSBGuardInterface_FieldPathArrayItemValue, error) { 9555 fp, err := ParseDeviceSpecUSBGuardInterface_FieldPath(pathStr) 9556 if err != nil { 9557 return nil, err 9558 } 9559 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 9560 if err != nil { 9561 return nil, status.Errorf(codes.InvalidArgument, "error parsing Interface field path array item value from %s: %v", valueStr, err) 9562 } 9563 return fpaiv.(DeviceSpecUSBGuardInterface_FieldPathArrayItemValue), nil 9564 } 9565 9566 func MustParseDeviceSpecUSBGuardInterface_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecUSBGuardInterface_FieldPathArrayItemValue { 9567 fpaiv, err := ParseDeviceSpecUSBGuardInterface_FieldPathArrayItemValue(pathStr, valueStr) 9568 if err != nil { 9569 panic(err) 9570 } 9571 return fpaiv 9572 } 9573 9574 type DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue struct { 9575 DeviceSpecUSBGuardInterface_FieldTerminalPath 9576 value interface{} 9577 } 9578 9579 var _ DeviceSpecUSBGuardInterface_FieldPathArrayItemValue = (*DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue)(nil) 9580 9581 // GetRawValue returns stored element value for array in object Device_Spec_USBGuard_Interface as interface{} 9582 func (fpaiv *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 9583 return fpaiv.value 9584 } 9585 func (fpaiv *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue) AsEqualsItemValue() (string, bool) { 9586 res, ok := fpaiv.value.(string) 9587 return res, ok 9588 } 9589 func (fpaiv *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue) AsOneOfItemValue() (string, bool) { 9590 res, ok := fpaiv.value.(string) 9591 return res, ok 9592 } 9593 9594 func (fpaiv *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_USBGuard_Interface) (interface{}, bool) { 9595 return nil, false 9596 } 9597 9598 func (fpaiv *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 9599 return fpaiv.GetSingle(source.(*Device_Spec_USBGuard_Interface)) 9600 } 9601 9602 // Contains returns a boolean indicating if value that is being held is present in given 'Interface' 9603 func (fpaiv *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_USBGuard_Interface) bool { 9604 slice := fpaiv.DeviceSpecUSBGuardInterface_FieldTerminalPath.Get(source) 9605 for _, v := range slice { 9606 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 9607 if proto.Equal(asProtoMsg, v.(proto.Message)) { 9608 return true 9609 } 9610 } else if reflect.DeepEqual(v, fpaiv.value) { 9611 return true 9612 } 9613 } 9614 return false 9615 } 9616 9617 // DeviceSpecUSBGuardInterface_FieldPathArrayOfValues allows storing slice of values for Interface fields according to their type 9618 type DeviceSpecUSBGuardInterface_FieldPathArrayOfValues interface { 9619 gotenobject.FieldPathArrayOfValues 9620 DeviceSpecUSBGuardInterface_FieldPath 9621 } 9622 9623 func ParseDeviceSpecUSBGuardInterface_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecUSBGuardInterface_FieldPathArrayOfValues, error) { 9624 fp, err := ParseDeviceSpecUSBGuardInterface_FieldPath(pathStr) 9625 if err != nil { 9626 return nil, err 9627 } 9628 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 9629 if err != nil { 9630 return nil, status.Errorf(codes.InvalidArgument, "error parsing Interface field path array of values from %s: %v", valuesStr, err) 9631 } 9632 return fpaov.(DeviceSpecUSBGuardInterface_FieldPathArrayOfValues), nil 9633 } 9634 9635 func MustParseDeviceSpecUSBGuardInterface_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecUSBGuardInterface_FieldPathArrayOfValues { 9636 fpaov, err := ParseDeviceSpecUSBGuardInterface_FieldPathArrayOfValues(pathStr, valuesStr) 9637 if err != nil { 9638 panic(err) 9639 } 9640 return fpaov 9641 } 9642 9643 type DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues struct { 9644 DeviceSpecUSBGuardInterface_FieldTerminalPath 9645 values interface{} 9646 } 9647 9648 var _ DeviceSpecUSBGuardInterface_FieldPathArrayOfValues = (*DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues)(nil) 9649 9650 func (fpaov *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 9651 switch fpaov.selector { 9652 case DeviceSpecUSBGuardInterface_FieldPathSelectorEquals: 9653 for _, v := range fpaov.values.([][]string) { 9654 values = append(values, v) 9655 } 9656 case DeviceSpecUSBGuardInterface_FieldPathSelectorOneOf: 9657 for _, v := range fpaov.values.([][]string) { 9658 values = append(values, v) 9659 } 9660 } 9661 return 9662 } 9663 func (fpaov *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues) AsEqualsArrayOfValues() ([][]string, bool) { 9664 res, ok := fpaov.values.([][]string) 9665 return res, ok 9666 } 9667 func (fpaov *DeviceSpecUSBGuardInterface_FieldTerminalPathArrayOfValues) AsOneOfArrayOfValues() ([][]string, bool) { 9668 res, ok := fpaov.values.([][]string) 9669 return res, ok 9670 } 9671 9672 // FieldPath provides implementation to handle 9673 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 9674 type DeviceSpecUSBGuardWhiteList_FieldPath interface { 9675 gotenobject.FieldPath 9676 Selector() DeviceSpecUSBGuardWhiteList_FieldPathSelector 9677 Get(source *Device_Spec_USBGuard_WhiteList) []interface{} 9678 GetSingle(source *Device_Spec_USBGuard_WhiteList) (interface{}, bool) 9679 ClearValue(item *Device_Spec_USBGuard_WhiteList) 9680 9681 // Those methods build corresponding DeviceSpecUSBGuardWhiteList_FieldPathValue 9682 // (or array of values) and holds passed value. Panics if injected type is incorrect. 9683 WithIValue(value interface{}) DeviceSpecUSBGuardWhiteList_FieldPathValue 9684 WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues 9685 WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue 9686 } 9687 9688 type DeviceSpecUSBGuardWhiteList_FieldPathSelector int32 9689 9690 const ( 9691 DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName DeviceSpecUSBGuardWhiteList_FieldPathSelector = 0 9692 DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId DeviceSpecUSBGuardWhiteList_FieldPathSelector = 1 9693 DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort DeviceSpecUSBGuardWhiteList_FieldPathSelector = 2 9694 DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface DeviceSpecUSBGuardWhiteList_FieldPathSelector = 3 9695 DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType DeviceSpecUSBGuardWhiteList_FieldPathSelector = 4 9696 ) 9697 9698 func (s DeviceSpecUSBGuardWhiteList_FieldPathSelector) String() string { 9699 switch s { 9700 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9701 return "device_name" 9702 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9703 return "device_id" 9704 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9705 return "via_port" 9706 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9707 return "with_interface" 9708 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9709 return "with_connect_type" 9710 default: 9711 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", s)) 9712 } 9713 } 9714 9715 func BuildDeviceSpecUSBGuardWhiteList_FieldPath(fp gotenobject.RawFieldPath) (DeviceSpecUSBGuardWhiteList_FieldPath, error) { 9716 if len(fp) == 0 { 9717 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Spec_USBGuard_WhiteList") 9718 } 9719 if len(fp) == 1 { 9720 switch fp[0] { 9721 case "device_name", "deviceName", "device-name": 9722 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName}, nil 9723 case "device_id", "deviceId", "device-id": 9724 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId}, nil 9725 case "via_port", "viaPort", "via-port": 9726 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort}, nil 9727 case "with_interface", "withInterface", "with-interface": 9728 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface}, nil 9729 case "with_connect_type", "withConnectType", "with-connect-type": 9730 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType}, nil 9731 } 9732 } else { 9733 switch fp[0] { 9734 case "via_port", "viaPort", "via-port": 9735 if subpath, err := BuildDeviceSpecUSBGuardPort_FieldPath(fp[1:]); err != nil { 9736 return nil, err 9737 } else { 9738 return &DeviceSpecUSBGuardWhiteList_FieldSubPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort, subPath: subpath}, nil 9739 } 9740 case "with_interface", "withInterface", "with-interface": 9741 if subpath, err := BuildDeviceSpecUSBGuardInterface_FieldPath(fp[1:]); err != nil { 9742 return nil, err 9743 } else { 9744 return &DeviceSpecUSBGuardWhiteList_FieldSubPath{selector: DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface, subPath: subpath}, nil 9745 } 9746 } 9747 } 9748 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Spec_USBGuard_WhiteList", fp) 9749 } 9750 9751 func ParseDeviceSpecUSBGuardWhiteList_FieldPath(rawField string) (DeviceSpecUSBGuardWhiteList_FieldPath, error) { 9752 fp, err := gotenobject.ParseRawFieldPath(rawField) 9753 if err != nil { 9754 return nil, err 9755 } 9756 return BuildDeviceSpecUSBGuardWhiteList_FieldPath(fp) 9757 } 9758 9759 func MustParseDeviceSpecUSBGuardWhiteList_FieldPath(rawField string) DeviceSpecUSBGuardWhiteList_FieldPath { 9760 fp, err := ParseDeviceSpecUSBGuardWhiteList_FieldPath(rawField) 9761 if err != nil { 9762 panic(err) 9763 } 9764 return fp 9765 } 9766 9767 type DeviceSpecUSBGuardWhiteList_FieldTerminalPath struct { 9768 selector DeviceSpecUSBGuardWhiteList_FieldPathSelector 9769 } 9770 9771 var _ DeviceSpecUSBGuardWhiteList_FieldPath = (*DeviceSpecUSBGuardWhiteList_FieldTerminalPath)(nil) 9772 9773 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) Selector() DeviceSpecUSBGuardWhiteList_FieldPathSelector { 9774 return fp.selector 9775 } 9776 9777 // String returns path representation in proto convention 9778 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) String() string { 9779 return fp.selector.String() 9780 } 9781 9782 // JSONString returns path representation is JSON convention 9783 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) JSONString() string { 9784 return strcase.ToLowerCamel(fp.String()) 9785 } 9786 9787 // Get returns all values pointed by specific field from source Device_Spec_USBGuard_WhiteList 9788 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) Get(source *Device_Spec_USBGuard_WhiteList) (values []interface{}) { 9789 if source != nil { 9790 switch fp.selector { 9791 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9792 values = append(values, source.DeviceName) 9793 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9794 values = append(values, source.DeviceId) 9795 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9796 if source.ViaPort != nil { 9797 values = append(values, source.ViaPort) 9798 } 9799 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9800 if source.WithInterface != nil { 9801 values = append(values, source.WithInterface) 9802 } 9803 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9804 values = append(values, source.WithConnectType) 9805 default: 9806 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9807 } 9808 } 9809 return 9810 } 9811 9812 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 9813 return fp.Get(source.(*Device_Spec_USBGuard_WhiteList)) 9814 } 9815 9816 // GetSingle returns value pointed by specific field of from source Device_Spec_USBGuard_WhiteList 9817 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) GetSingle(source *Device_Spec_USBGuard_WhiteList) (interface{}, bool) { 9818 switch fp.selector { 9819 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9820 return source.GetDeviceName(), source != nil 9821 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9822 return source.GetDeviceId(), source != nil 9823 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9824 res := source.GetViaPort() 9825 return res, res != nil 9826 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9827 res := source.GetWithInterface() 9828 return res, res != nil 9829 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9830 return source.GetWithConnectType(), source != nil 9831 default: 9832 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9833 } 9834 } 9835 9836 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 9837 return fp.GetSingle(source.(*Device_Spec_USBGuard_WhiteList)) 9838 } 9839 9840 // GetDefault returns a default value of the field type 9841 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) GetDefault() interface{} { 9842 switch fp.selector { 9843 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9844 return "" 9845 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9846 return "" 9847 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9848 return (*Device_Spec_USBGuard_Port)(nil) 9849 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9850 return (*Device_Spec_USBGuard_Interface)(nil) 9851 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9852 return "" 9853 default: 9854 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9855 } 9856 } 9857 9858 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) ClearValue(item *Device_Spec_USBGuard_WhiteList) { 9859 if item != nil { 9860 switch fp.selector { 9861 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9862 item.DeviceName = "" 9863 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9864 item.DeviceId = "" 9865 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9866 item.ViaPort = nil 9867 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9868 item.WithInterface = nil 9869 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9870 item.WithConnectType = "" 9871 default: 9872 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9873 } 9874 } 9875 } 9876 9877 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) ClearValueRaw(item proto.Message) { 9878 fp.ClearValue(item.(*Device_Spec_USBGuard_WhiteList)) 9879 } 9880 9881 // IsLeaf - whether field path is holds simple value 9882 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) IsLeaf() bool { 9883 return fp.selector == DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName || 9884 fp.selector == DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId || 9885 fp.selector == DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType 9886 } 9887 9888 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 9889 return []gotenobject.FieldPath{fp} 9890 } 9891 9892 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) WithIValue(value interface{}) DeviceSpecUSBGuardWhiteList_FieldPathValue { 9893 switch fp.selector { 9894 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9895 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, value: value.(string)} 9896 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9897 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, value: value.(string)} 9898 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9899 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, value: value.(*Device_Spec_USBGuard_Port)} 9900 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9901 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, value: value.(*Device_Spec_USBGuard_Interface)} 9902 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9903 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, value: value.(string)} 9904 default: 9905 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9906 } 9907 } 9908 9909 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 9910 return fp.WithIValue(value) 9911 } 9912 9913 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues { 9914 fpaov := &DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp} 9915 switch fp.selector { 9916 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 9917 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, values: values.([]string)} 9918 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 9919 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, values: values.([]string)} 9920 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9921 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, values: values.([]*Device_Spec_USBGuard_Port)} 9922 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9923 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, values: values.([]*Device_Spec_USBGuard_Interface)} 9924 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 9925 return &DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues{DeviceSpecUSBGuardWhiteList_FieldTerminalPath: *fp, values: values.([]string)} 9926 default: 9927 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9928 } 9929 return fpaov 9930 } 9931 9932 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 9933 return fp.WithIArrayOfValues(values) 9934 } 9935 9936 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue { 9937 switch fp.selector { 9938 default: 9939 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fp.selector)) 9940 } 9941 } 9942 9943 func (fp *DeviceSpecUSBGuardWhiteList_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 9944 return fp.WithIArrayItemValue(value) 9945 } 9946 9947 type DeviceSpecUSBGuardWhiteList_FieldSubPath struct { 9948 selector DeviceSpecUSBGuardWhiteList_FieldPathSelector 9949 subPath gotenobject.FieldPath 9950 } 9951 9952 var _ DeviceSpecUSBGuardWhiteList_FieldPath = (*DeviceSpecUSBGuardWhiteList_FieldSubPath)(nil) 9953 9954 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) Selector() DeviceSpecUSBGuardWhiteList_FieldPathSelector { 9955 return fps.selector 9956 } 9957 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) AsViaPortSubPath() (DeviceSpecUSBGuardPort_FieldPath, bool) { 9958 res, ok := fps.subPath.(DeviceSpecUSBGuardPort_FieldPath) 9959 return res, ok 9960 } 9961 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) AsWithInterfaceSubPath() (DeviceSpecUSBGuardInterface_FieldPath, bool) { 9962 res, ok := fps.subPath.(DeviceSpecUSBGuardInterface_FieldPath) 9963 return res, ok 9964 } 9965 9966 // String returns path representation in proto convention 9967 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) String() string { 9968 return fps.selector.String() + "." + fps.subPath.String() 9969 } 9970 9971 // JSONString returns path representation is JSON convention 9972 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) JSONString() string { 9973 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 9974 } 9975 9976 // Get returns all values pointed by selected field from source Device_Spec_USBGuard_WhiteList 9977 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) Get(source *Device_Spec_USBGuard_WhiteList) (values []interface{}) { 9978 switch fps.selector { 9979 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9980 values = append(values, fps.subPath.GetRaw(source.GetViaPort())...) 9981 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 9982 values = append(values, fps.subPath.GetRaw(source.GetWithInterface())...) 9983 default: 9984 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fps.selector)) 9985 } 9986 return 9987 } 9988 9989 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) GetRaw(source proto.Message) []interface{} { 9990 return fps.Get(source.(*Device_Spec_USBGuard_WhiteList)) 9991 } 9992 9993 // GetSingle returns value of selected field from source Device_Spec_USBGuard_WhiteList 9994 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) GetSingle(source *Device_Spec_USBGuard_WhiteList) (interface{}, bool) { 9995 switch fps.selector { 9996 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 9997 if source.GetViaPort() == nil { 9998 return nil, false 9999 } 10000 return fps.subPath.GetSingleRaw(source.GetViaPort()) 10001 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10002 if source.GetWithInterface() == nil { 10003 return nil, false 10004 } 10005 return fps.subPath.GetSingleRaw(source.GetWithInterface()) 10006 default: 10007 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fps.selector)) 10008 } 10009 } 10010 10011 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 10012 return fps.GetSingle(source.(*Device_Spec_USBGuard_WhiteList)) 10013 } 10014 10015 // GetDefault returns a default value of the field type 10016 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) GetDefault() interface{} { 10017 return fps.subPath.GetDefault() 10018 } 10019 10020 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) ClearValue(item *Device_Spec_USBGuard_WhiteList) { 10021 if item != nil { 10022 switch fps.selector { 10023 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10024 fps.subPath.ClearValueRaw(item.ViaPort) 10025 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10026 fps.subPath.ClearValueRaw(item.WithInterface) 10027 default: 10028 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fps.selector)) 10029 } 10030 } 10031 } 10032 10033 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) ClearValueRaw(item proto.Message) { 10034 fps.ClearValue(item.(*Device_Spec_USBGuard_WhiteList)) 10035 } 10036 10037 // IsLeaf - whether field path is holds simple value 10038 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) IsLeaf() bool { 10039 return fps.subPath.IsLeaf() 10040 } 10041 10042 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 10043 iPaths := []gotenobject.FieldPath{&DeviceSpecUSBGuardWhiteList_FieldTerminalPath{selector: fps.selector}} 10044 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 10045 return iPaths 10046 } 10047 10048 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) WithIValue(value interface{}) DeviceSpecUSBGuardWhiteList_FieldPathValue { 10049 return &DeviceSpecUSBGuardWhiteList_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 10050 } 10051 10052 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 10053 return fps.WithIValue(value) 10054 } 10055 10056 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues { 10057 return &DeviceSpecUSBGuardWhiteList_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 10058 } 10059 10060 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 10061 return fps.WithIArrayOfValues(values) 10062 } 10063 10064 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue { 10065 return &DeviceSpecUSBGuardWhiteList_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 10066 } 10067 10068 func (fps *DeviceSpecUSBGuardWhiteList_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 10069 return fps.WithIArrayItemValue(value) 10070 } 10071 10072 // DeviceSpecUSBGuardWhiteList_FieldPathValue allows storing values for WhiteList fields according to their type 10073 type DeviceSpecUSBGuardWhiteList_FieldPathValue interface { 10074 DeviceSpecUSBGuardWhiteList_FieldPath 10075 gotenobject.FieldPathValue 10076 SetTo(target **Device_Spec_USBGuard_WhiteList) 10077 CompareWith(*Device_Spec_USBGuard_WhiteList) (cmp int, comparable bool) 10078 } 10079 10080 func ParseDeviceSpecUSBGuardWhiteList_FieldPathValue(pathStr, valueStr string) (DeviceSpecUSBGuardWhiteList_FieldPathValue, error) { 10081 fp, err := ParseDeviceSpecUSBGuardWhiteList_FieldPath(pathStr) 10082 if err != nil { 10083 return nil, err 10084 } 10085 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 10086 if err != nil { 10087 return nil, status.Errorf(codes.InvalidArgument, "error parsing WhiteList field path value from %s: %v", valueStr, err) 10088 } 10089 return fpv.(DeviceSpecUSBGuardWhiteList_FieldPathValue), nil 10090 } 10091 10092 func MustParseDeviceSpecUSBGuardWhiteList_FieldPathValue(pathStr, valueStr string) DeviceSpecUSBGuardWhiteList_FieldPathValue { 10093 fpv, err := ParseDeviceSpecUSBGuardWhiteList_FieldPathValue(pathStr, valueStr) 10094 if err != nil { 10095 panic(err) 10096 } 10097 return fpv 10098 } 10099 10100 type DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue struct { 10101 DeviceSpecUSBGuardWhiteList_FieldTerminalPath 10102 value interface{} 10103 } 10104 10105 var _ DeviceSpecUSBGuardWhiteList_FieldPathValue = (*DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue)(nil) 10106 10107 // GetRawValue returns raw value stored under selected path for 'WhiteList' as interface{} 10108 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) GetRawValue() interface{} { 10109 return fpv.value 10110 } 10111 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) AsDeviceNameValue() (string, bool) { 10112 res, ok := fpv.value.(string) 10113 return res, ok 10114 } 10115 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) AsDeviceIdValue() (string, bool) { 10116 res, ok := fpv.value.(string) 10117 return res, ok 10118 } 10119 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) AsViaPortValue() (*Device_Spec_USBGuard_Port, bool) { 10120 res, ok := fpv.value.(*Device_Spec_USBGuard_Port) 10121 return res, ok 10122 } 10123 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) AsWithInterfaceValue() (*Device_Spec_USBGuard_Interface, bool) { 10124 res, ok := fpv.value.(*Device_Spec_USBGuard_Interface) 10125 return res, ok 10126 } 10127 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) AsWithConnectTypeValue() (string, bool) { 10128 res, ok := fpv.value.(string) 10129 return res, ok 10130 } 10131 10132 // SetTo stores value for selected field for object WhiteList 10133 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) SetTo(target **Device_Spec_USBGuard_WhiteList) { 10134 if *target == nil { 10135 *target = new(Device_Spec_USBGuard_WhiteList) 10136 } 10137 switch fpv.selector { 10138 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 10139 (*target).DeviceName = fpv.value.(string) 10140 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 10141 (*target).DeviceId = fpv.value.(string) 10142 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10143 (*target).ViaPort = fpv.value.(*Device_Spec_USBGuard_Port) 10144 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10145 (*target).WithInterface = fpv.value.(*Device_Spec_USBGuard_Interface) 10146 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 10147 (*target).WithConnectType = fpv.value.(string) 10148 default: 10149 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fpv.selector)) 10150 } 10151 } 10152 10153 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) SetToRaw(target proto.Message) { 10154 typedObject := target.(*Device_Spec_USBGuard_WhiteList) 10155 fpv.SetTo(&typedObject) 10156 } 10157 10158 // CompareWith compares value in the 'DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue' with the value under path in 'Device_Spec_USBGuard_WhiteList'. 10159 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) CompareWith(source *Device_Spec_USBGuard_WhiteList) (int, bool) { 10160 switch fpv.selector { 10161 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 10162 leftValue := fpv.value.(string) 10163 rightValue := source.GetDeviceName() 10164 if (leftValue) == (rightValue) { 10165 return 0, true 10166 } else if (leftValue) < (rightValue) { 10167 return -1, true 10168 } else { 10169 return 1, true 10170 } 10171 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 10172 leftValue := fpv.value.(string) 10173 rightValue := source.GetDeviceId() 10174 if (leftValue) == (rightValue) { 10175 return 0, true 10176 } else if (leftValue) < (rightValue) { 10177 return -1, true 10178 } else { 10179 return 1, true 10180 } 10181 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10182 return 0, false 10183 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10184 return 0, false 10185 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 10186 leftValue := fpv.value.(string) 10187 rightValue := source.GetWithConnectType() 10188 if (leftValue) == (rightValue) { 10189 return 0, true 10190 } else if (leftValue) < (rightValue) { 10191 return -1, true 10192 } else { 10193 return 1, true 10194 } 10195 default: 10196 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fpv.selector)) 10197 } 10198 } 10199 10200 func (fpv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 10201 return fpv.CompareWith(source.(*Device_Spec_USBGuard_WhiteList)) 10202 } 10203 10204 type DeviceSpecUSBGuardWhiteList_FieldSubPathValue struct { 10205 DeviceSpecUSBGuardWhiteList_FieldPath 10206 subPathValue gotenobject.FieldPathValue 10207 } 10208 10209 var _ DeviceSpecUSBGuardWhiteList_FieldPathValue = (*DeviceSpecUSBGuardWhiteList_FieldSubPathValue)(nil) 10210 10211 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) AsViaPortPathValue() (DeviceSpecUSBGuardPort_FieldPathValue, bool) { 10212 res, ok := fpvs.subPathValue.(DeviceSpecUSBGuardPort_FieldPathValue) 10213 return res, ok 10214 } 10215 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) AsWithInterfacePathValue() (DeviceSpecUSBGuardInterface_FieldPathValue, bool) { 10216 res, ok := fpvs.subPathValue.(DeviceSpecUSBGuardInterface_FieldPathValue) 10217 return res, ok 10218 } 10219 10220 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) SetTo(target **Device_Spec_USBGuard_WhiteList) { 10221 if *target == nil { 10222 *target = new(Device_Spec_USBGuard_WhiteList) 10223 } 10224 switch fpvs.Selector() { 10225 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10226 fpvs.subPathValue.(DeviceSpecUSBGuardPort_FieldPathValue).SetTo(&(*target).ViaPort) 10227 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10228 fpvs.subPathValue.(DeviceSpecUSBGuardInterface_FieldPathValue).SetTo(&(*target).WithInterface) 10229 default: 10230 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fpvs.Selector())) 10231 } 10232 } 10233 10234 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) SetToRaw(target proto.Message) { 10235 typedObject := target.(*Device_Spec_USBGuard_WhiteList) 10236 fpvs.SetTo(&typedObject) 10237 } 10238 10239 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) GetRawValue() interface{} { 10240 return fpvs.subPathValue.GetRawValue() 10241 } 10242 10243 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) CompareWith(source *Device_Spec_USBGuard_WhiteList) (int, bool) { 10244 switch fpvs.Selector() { 10245 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10246 return fpvs.subPathValue.(DeviceSpecUSBGuardPort_FieldPathValue).CompareWith(source.GetViaPort()) 10247 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10248 return fpvs.subPathValue.(DeviceSpecUSBGuardInterface_FieldPathValue).CompareWith(source.GetWithInterface()) 10249 default: 10250 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fpvs.Selector())) 10251 } 10252 } 10253 10254 func (fpvs *DeviceSpecUSBGuardWhiteList_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 10255 return fpvs.CompareWith(source.(*Device_Spec_USBGuard_WhiteList)) 10256 } 10257 10258 // DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue allows storing single item in Path-specific values for WhiteList according to their type 10259 // Present only for array (repeated) types. 10260 type DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue interface { 10261 gotenobject.FieldPathArrayItemValue 10262 DeviceSpecUSBGuardWhiteList_FieldPath 10263 ContainsValue(*Device_Spec_USBGuard_WhiteList) bool 10264 } 10265 10266 // ParseDeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 10267 func ParseDeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue, error) { 10268 fp, err := ParseDeviceSpecUSBGuardWhiteList_FieldPath(pathStr) 10269 if err != nil { 10270 return nil, err 10271 } 10272 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 10273 if err != nil { 10274 return nil, status.Errorf(codes.InvalidArgument, "error parsing WhiteList field path array item value from %s: %v", valueStr, err) 10275 } 10276 return fpaiv.(DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue), nil 10277 } 10278 10279 func MustParseDeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue(pathStr, valueStr string) DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue { 10280 fpaiv, err := ParseDeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue(pathStr, valueStr) 10281 if err != nil { 10282 panic(err) 10283 } 10284 return fpaiv 10285 } 10286 10287 type DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayItemValue struct { 10288 DeviceSpecUSBGuardWhiteList_FieldTerminalPath 10289 value interface{} 10290 } 10291 10292 var _ DeviceSpecUSBGuardWhiteList_FieldPathArrayItemValue = (*DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayItemValue)(nil) 10293 10294 // GetRawValue returns stored element value for array in object Device_Spec_USBGuard_WhiteList as interface{} 10295 func (fpaiv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 10296 return fpaiv.value 10297 } 10298 10299 func (fpaiv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Spec_USBGuard_WhiteList) (interface{}, bool) { 10300 return nil, false 10301 } 10302 10303 func (fpaiv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 10304 return fpaiv.GetSingle(source.(*Device_Spec_USBGuard_WhiteList)) 10305 } 10306 10307 // Contains returns a boolean indicating if value that is being held is present in given 'WhiteList' 10308 func (fpaiv *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Spec_USBGuard_WhiteList) bool { 10309 slice := fpaiv.DeviceSpecUSBGuardWhiteList_FieldTerminalPath.Get(source) 10310 for _, v := range slice { 10311 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 10312 if proto.Equal(asProtoMsg, v.(proto.Message)) { 10313 return true 10314 } 10315 } else if reflect.DeepEqual(v, fpaiv.value) { 10316 return true 10317 } 10318 } 10319 return false 10320 } 10321 10322 type DeviceSpecUSBGuardWhiteList_FieldSubPathArrayItemValue struct { 10323 DeviceSpecUSBGuardWhiteList_FieldPath 10324 subPathItemValue gotenobject.FieldPathArrayItemValue 10325 } 10326 10327 // GetRawValue returns stored array item value 10328 func (fpaivs *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 10329 return fpaivs.subPathItemValue.GetRawItemValue() 10330 } 10331 func (fpaivs *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayItemValue) AsViaPortPathItemValue() (DeviceSpecUSBGuardPort_FieldPathArrayItemValue, bool) { 10332 res, ok := fpaivs.subPathItemValue.(DeviceSpecUSBGuardPort_FieldPathArrayItemValue) 10333 return res, ok 10334 } 10335 func (fpaivs *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayItemValue) AsWithInterfacePathItemValue() (DeviceSpecUSBGuardInterface_FieldPathArrayItemValue, bool) { 10336 res, ok := fpaivs.subPathItemValue.(DeviceSpecUSBGuardInterface_FieldPathArrayItemValue) 10337 return res, ok 10338 } 10339 10340 // Contains returns a boolean indicating if value that is being held is present in given 'WhiteList' 10341 func (fpaivs *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayItemValue) ContainsValue(source *Device_Spec_USBGuard_WhiteList) bool { 10342 switch fpaivs.Selector() { 10343 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10344 return fpaivs.subPathItemValue.(DeviceSpecUSBGuardPort_FieldPathArrayItemValue).ContainsValue(source.GetViaPort()) 10345 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10346 return fpaivs.subPathItemValue.(DeviceSpecUSBGuardInterface_FieldPathArrayItemValue).ContainsValue(source.GetWithInterface()) 10347 default: 10348 panic(fmt.Sprintf("Invalid selector for Device_Spec_USBGuard_WhiteList: %d", fpaivs.Selector())) 10349 } 10350 } 10351 10352 // DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues allows storing slice of values for WhiteList fields according to their type 10353 type DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues interface { 10354 gotenobject.FieldPathArrayOfValues 10355 DeviceSpecUSBGuardWhiteList_FieldPath 10356 } 10357 10358 func ParseDeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues, error) { 10359 fp, err := ParseDeviceSpecUSBGuardWhiteList_FieldPath(pathStr) 10360 if err != nil { 10361 return nil, err 10362 } 10363 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 10364 if err != nil { 10365 return nil, status.Errorf(codes.InvalidArgument, "error parsing WhiteList field path array of values from %s: %v", valuesStr, err) 10366 } 10367 return fpaov.(DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues), nil 10368 } 10369 10370 func MustParseDeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues { 10371 fpaov, err := ParseDeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues(pathStr, valuesStr) 10372 if err != nil { 10373 panic(err) 10374 } 10375 return fpaov 10376 } 10377 10378 type DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues struct { 10379 DeviceSpecUSBGuardWhiteList_FieldTerminalPath 10380 values interface{} 10381 } 10382 10383 var _ DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues = (*DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues)(nil) 10384 10385 func (fpaov *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 10386 switch fpaov.selector { 10387 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceName: 10388 for _, v := range fpaov.values.([]string) { 10389 values = append(values, v) 10390 } 10391 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorDeviceId: 10392 for _, v := range fpaov.values.([]string) { 10393 values = append(values, v) 10394 } 10395 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorViaPort: 10396 for _, v := range fpaov.values.([]*Device_Spec_USBGuard_Port) { 10397 values = append(values, v) 10398 } 10399 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithInterface: 10400 for _, v := range fpaov.values.([]*Device_Spec_USBGuard_Interface) { 10401 values = append(values, v) 10402 } 10403 case DeviceSpecUSBGuardWhiteList_FieldPathSelectorWithConnectType: 10404 for _, v := range fpaov.values.([]string) { 10405 values = append(values, v) 10406 } 10407 } 10408 return 10409 } 10410 func (fpaov *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues) AsDeviceNameArrayOfValues() ([]string, bool) { 10411 res, ok := fpaov.values.([]string) 10412 return res, ok 10413 } 10414 func (fpaov *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues) AsDeviceIdArrayOfValues() ([]string, bool) { 10415 res, ok := fpaov.values.([]string) 10416 return res, ok 10417 } 10418 func (fpaov *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues) AsViaPortArrayOfValues() ([]*Device_Spec_USBGuard_Port, bool) { 10419 res, ok := fpaov.values.([]*Device_Spec_USBGuard_Port) 10420 return res, ok 10421 } 10422 func (fpaov *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues) AsWithInterfaceArrayOfValues() ([]*Device_Spec_USBGuard_Interface, bool) { 10423 res, ok := fpaov.values.([]*Device_Spec_USBGuard_Interface) 10424 return res, ok 10425 } 10426 func (fpaov *DeviceSpecUSBGuardWhiteList_FieldTerminalPathArrayOfValues) AsWithConnectTypeArrayOfValues() ([]string, bool) { 10427 res, ok := fpaov.values.([]string) 10428 return res, ok 10429 } 10430 10431 type DeviceSpecUSBGuardWhiteList_FieldSubPathArrayOfValues struct { 10432 DeviceSpecUSBGuardWhiteList_FieldPath 10433 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 10434 } 10435 10436 var _ DeviceSpecUSBGuardWhiteList_FieldPathArrayOfValues = (*DeviceSpecUSBGuardWhiteList_FieldSubPathArrayOfValues)(nil) 10437 10438 func (fpsaov *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 10439 return fpsaov.subPathArrayOfValues.GetRawValues() 10440 } 10441 func (fpsaov *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayOfValues) AsViaPortPathArrayOfValues() (DeviceSpecUSBGuardPort_FieldPathArrayOfValues, bool) { 10442 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecUSBGuardPort_FieldPathArrayOfValues) 10443 return res, ok 10444 } 10445 func (fpsaov *DeviceSpecUSBGuardWhiteList_FieldSubPathArrayOfValues) AsWithInterfacePathArrayOfValues() (DeviceSpecUSBGuardInterface_FieldPathArrayOfValues, bool) { 10446 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecUSBGuardInterface_FieldPathArrayOfValues) 10447 return res, ok 10448 } 10449 10450 // FieldPath provides implementation to handle 10451 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 10452 type DeviceStatusAddress_FieldPath interface { 10453 gotenobject.FieldPath 10454 Selector() DeviceStatusAddress_FieldPathSelector 10455 Get(source *Device_Status_Address) []interface{} 10456 GetSingle(source *Device_Status_Address) (interface{}, bool) 10457 ClearValue(item *Device_Status_Address) 10458 10459 // Those methods build corresponding DeviceStatusAddress_FieldPathValue 10460 // (or array of values) and holds passed value. Panics if injected type is incorrect. 10461 WithIValue(value interface{}) DeviceStatusAddress_FieldPathValue 10462 WithIArrayOfValues(values interface{}) DeviceStatusAddress_FieldPathArrayOfValues 10463 WithIArrayItemValue(value interface{}) DeviceStatusAddress_FieldPathArrayItemValue 10464 } 10465 10466 type DeviceStatusAddress_FieldPathSelector int32 10467 10468 const ( 10469 DeviceStatusAddress_FieldPathSelectorAddress DeviceStatusAddress_FieldPathSelector = 0 10470 DeviceStatusAddress_FieldPathSelectorType DeviceStatusAddress_FieldPathSelector = 1 10471 ) 10472 10473 func (s DeviceStatusAddress_FieldPathSelector) String() string { 10474 switch s { 10475 case DeviceStatusAddress_FieldPathSelectorAddress: 10476 return "address" 10477 case DeviceStatusAddress_FieldPathSelectorType: 10478 return "type" 10479 default: 10480 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", s)) 10481 } 10482 } 10483 10484 func BuildDeviceStatusAddress_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusAddress_FieldPath, error) { 10485 if len(fp) == 0 { 10486 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_Address") 10487 } 10488 if len(fp) == 1 { 10489 switch fp[0] { 10490 case "address": 10491 return &DeviceStatusAddress_FieldTerminalPath{selector: DeviceStatusAddress_FieldPathSelectorAddress}, nil 10492 case "type": 10493 return &DeviceStatusAddress_FieldTerminalPath{selector: DeviceStatusAddress_FieldPathSelectorType}, nil 10494 } 10495 } 10496 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_Address", fp) 10497 } 10498 10499 func ParseDeviceStatusAddress_FieldPath(rawField string) (DeviceStatusAddress_FieldPath, error) { 10500 fp, err := gotenobject.ParseRawFieldPath(rawField) 10501 if err != nil { 10502 return nil, err 10503 } 10504 return BuildDeviceStatusAddress_FieldPath(fp) 10505 } 10506 10507 func MustParseDeviceStatusAddress_FieldPath(rawField string) DeviceStatusAddress_FieldPath { 10508 fp, err := ParseDeviceStatusAddress_FieldPath(rawField) 10509 if err != nil { 10510 panic(err) 10511 } 10512 return fp 10513 } 10514 10515 type DeviceStatusAddress_FieldTerminalPath struct { 10516 selector DeviceStatusAddress_FieldPathSelector 10517 } 10518 10519 var _ DeviceStatusAddress_FieldPath = (*DeviceStatusAddress_FieldTerminalPath)(nil) 10520 10521 func (fp *DeviceStatusAddress_FieldTerminalPath) Selector() DeviceStatusAddress_FieldPathSelector { 10522 return fp.selector 10523 } 10524 10525 // String returns path representation in proto convention 10526 func (fp *DeviceStatusAddress_FieldTerminalPath) String() string { 10527 return fp.selector.String() 10528 } 10529 10530 // JSONString returns path representation is JSON convention 10531 func (fp *DeviceStatusAddress_FieldTerminalPath) JSONString() string { 10532 return strcase.ToLowerCamel(fp.String()) 10533 } 10534 10535 // Get returns all values pointed by specific field from source Device_Status_Address 10536 func (fp *DeviceStatusAddress_FieldTerminalPath) Get(source *Device_Status_Address) (values []interface{}) { 10537 if source != nil { 10538 switch fp.selector { 10539 case DeviceStatusAddress_FieldPathSelectorAddress: 10540 values = append(values, source.Address) 10541 case DeviceStatusAddress_FieldPathSelectorType: 10542 values = append(values, source.Type) 10543 default: 10544 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10545 } 10546 } 10547 return 10548 } 10549 10550 func (fp *DeviceStatusAddress_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 10551 return fp.Get(source.(*Device_Status_Address)) 10552 } 10553 10554 // GetSingle returns value pointed by specific field of from source Device_Status_Address 10555 func (fp *DeviceStatusAddress_FieldTerminalPath) GetSingle(source *Device_Status_Address) (interface{}, bool) { 10556 switch fp.selector { 10557 case DeviceStatusAddress_FieldPathSelectorAddress: 10558 return source.GetAddress(), source != nil 10559 case DeviceStatusAddress_FieldPathSelectorType: 10560 return source.GetType(), source != nil 10561 default: 10562 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10563 } 10564 } 10565 10566 func (fp *DeviceStatusAddress_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 10567 return fp.GetSingle(source.(*Device_Status_Address)) 10568 } 10569 10570 // GetDefault returns a default value of the field type 10571 func (fp *DeviceStatusAddress_FieldTerminalPath) GetDefault() interface{} { 10572 switch fp.selector { 10573 case DeviceStatusAddress_FieldPathSelectorAddress: 10574 return "" 10575 case DeviceStatusAddress_FieldPathSelectorType: 10576 return "" 10577 default: 10578 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10579 } 10580 } 10581 10582 func (fp *DeviceStatusAddress_FieldTerminalPath) ClearValue(item *Device_Status_Address) { 10583 if item != nil { 10584 switch fp.selector { 10585 case DeviceStatusAddress_FieldPathSelectorAddress: 10586 item.Address = "" 10587 case DeviceStatusAddress_FieldPathSelectorType: 10588 item.Type = "" 10589 default: 10590 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10591 } 10592 } 10593 } 10594 10595 func (fp *DeviceStatusAddress_FieldTerminalPath) ClearValueRaw(item proto.Message) { 10596 fp.ClearValue(item.(*Device_Status_Address)) 10597 } 10598 10599 // IsLeaf - whether field path is holds simple value 10600 func (fp *DeviceStatusAddress_FieldTerminalPath) IsLeaf() bool { 10601 return fp.selector == DeviceStatusAddress_FieldPathSelectorAddress || 10602 fp.selector == DeviceStatusAddress_FieldPathSelectorType 10603 } 10604 10605 func (fp *DeviceStatusAddress_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 10606 return []gotenobject.FieldPath{fp} 10607 } 10608 10609 func (fp *DeviceStatusAddress_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusAddress_FieldPathValue { 10610 switch fp.selector { 10611 case DeviceStatusAddress_FieldPathSelectorAddress: 10612 return &DeviceStatusAddress_FieldTerminalPathValue{DeviceStatusAddress_FieldTerminalPath: *fp, value: value.(string)} 10613 case DeviceStatusAddress_FieldPathSelectorType: 10614 return &DeviceStatusAddress_FieldTerminalPathValue{DeviceStatusAddress_FieldTerminalPath: *fp, value: value.(string)} 10615 default: 10616 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10617 } 10618 } 10619 10620 func (fp *DeviceStatusAddress_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 10621 return fp.WithIValue(value) 10622 } 10623 10624 func (fp *DeviceStatusAddress_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusAddress_FieldPathArrayOfValues { 10625 fpaov := &DeviceStatusAddress_FieldTerminalPathArrayOfValues{DeviceStatusAddress_FieldTerminalPath: *fp} 10626 switch fp.selector { 10627 case DeviceStatusAddress_FieldPathSelectorAddress: 10628 return &DeviceStatusAddress_FieldTerminalPathArrayOfValues{DeviceStatusAddress_FieldTerminalPath: *fp, values: values.([]string)} 10629 case DeviceStatusAddress_FieldPathSelectorType: 10630 return &DeviceStatusAddress_FieldTerminalPathArrayOfValues{DeviceStatusAddress_FieldTerminalPath: *fp, values: values.([]string)} 10631 default: 10632 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10633 } 10634 return fpaov 10635 } 10636 10637 func (fp *DeviceStatusAddress_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 10638 return fp.WithIArrayOfValues(values) 10639 } 10640 10641 func (fp *DeviceStatusAddress_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusAddress_FieldPathArrayItemValue { 10642 switch fp.selector { 10643 default: 10644 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fp.selector)) 10645 } 10646 } 10647 10648 func (fp *DeviceStatusAddress_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 10649 return fp.WithIArrayItemValue(value) 10650 } 10651 10652 // DeviceStatusAddress_FieldPathValue allows storing values for Address fields according to their type 10653 type DeviceStatusAddress_FieldPathValue interface { 10654 DeviceStatusAddress_FieldPath 10655 gotenobject.FieldPathValue 10656 SetTo(target **Device_Status_Address) 10657 CompareWith(*Device_Status_Address) (cmp int, comparable bool) 10658 } 10659 10660 func ParseDeviceStatusAddress_FieldPathValue(pathStr, valueStr string) (DeviceStatusAddress_FieldPathValue, error) { 10661 fp, err := ParseDeviceStatusAddress_FieldPath(pathStr) 10662 if err != nil { 10663 return nil, err 10664 } 10665 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 10666 if err != nil { 10667 return nil, status.Errorf(codes.InvalidArgument, "error parsing Address field path value from %s: %v", valueStr, err) 10668 } 10669 return fpv.(DeviceStatusAddress_FieldPathValue), nil 10670 } 10671 10672 func MustParseDeviceStatusAddress_FieldPathValue(pathStr, valueStr string) DeviceStatusAddress_FieldPathValue { 10673 fpv, err := ParseDeviceStatusAddress_FieldPathValue(pathStr, valueStr) 10674 if err != nil { 10675 panic(err) 10676 } 10677 return fpv 10678 } 10679 10680 type DeviceStatusAddress_FieldTerminalPathValue struct { 10681 DeviceStatusAddress_FieldTerminalPath 10682 value interface{} 10683 } 10684 10685 var _ DeviceStatusAddress_FieldPathValue = (*DeviceStatusAddress_FieldTerminalPathValue)(nil) 10686 10687 // GetRawValue returns raw value stored under selected path for 'Address' as interface{} 10688 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) GetRawValue() interface{} { 10689 return fpv.value 10690 } 10691 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) AsAddressValue() (string, bool) { 10692 res, ok := fpv.value.(string) 10693 return res, ok 10694 } 10695 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) AsTypeValue() (string, bool) { 10696 res, ok := fpv.value.(string) 10697 return res, ok 10698 } 10699 10700 // SetTo stores value for selected field for object Address 10701 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) SetTo(target **Device_Status_Address) { 10702 if *target == nil { 10703 *target = new(Device_Status_Address) 10704 } 10705 switch fpv.selector { 10706 case DeviceStatusAddress_FieldPathSelectorAddress: 10707 (*target).Address = fpv.value.(string) 10708 case DeviceStatusAddress_FieldPathSelectorType: 10709 (*target).Type = fpv.value.(string) 10710 default: 10711 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fpv.selector)) 10712 } 10713 } 10714 10715 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) SetToRaw(target proto.Message) { 10716 typedObject := target.(*Device_Status_Address) 10717 fpv.SetTo(&typedObject) 10718 } 10719 10720 // CompareWith compares value in the 'DeviceStatusAddress_FieldTerminalPathValue' with the value under path in 'Device_Status_Address'. 10721 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) CompareWith(source *Device_Status_Address) (int, bool) { 10722 switch fpv.selector { 10723 case DeviceStatusAddress_FieldPathSelectorAddress: 10724 leftValue := fpv.value.(string) 10725 rightValue := source.GetAddress() 10726 if (leftValue) == (rightValue) { 10727 return 0, true 10728 } else if (leftValue) < (rightValue) { 10729 return -1, true 10730 } else { 10731 return 1, true 10732 } 10733 case DeviceStatusAddress_FieldPathSelectorType: 10734 leftValue := fpv.value.(string) 10735 rightValue := source.GetType() 10736 if (leftValue) == (rightValue) { 10737 return 0, true 10738 } else if (leftValue) < (rightValue) { 10739 return -1, true 10740 } else { 10741 return 1, true 10742 } 10743 default: 10744 panic(fmt.Sprintf("Invalid selector for Device_Status_Address: %d", fpv.selector)) 10745 } 10746 } 10747 10748 func (fpv *DeviceStatusAddress_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 10749 return fpv.CompareWith(source.(*Device_Status_Address)) 10750 } 10751 10752 // DeviceStatusAddress_FieldPathArrayItemValue allows storing single item in Path-specific values for Address according to their type 10753 // Present only for array (repeated) types. 10754 type DeviceStatusAddress_FieldPathArrayItemValue interface { 10755 gotenobject.FieldPathArrayItemValue 10756 DeviceStatusAddress_FieldPath 10757 ContainsValue(*Device_Status_Address) bool 10758 } 10759 10760 // ParseDeviceStatusAddress_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 10761 func ParseDeviceStatusAddress_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusAddress_FieldPathArrayItemValue, error) { 10762 fp, err := ParseDeviceStatusAddress_FieldPath(pathStr) 10763 if err != nil { 10764 return nil, err 10765 } 10766 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 10767 if err != nil { 10768 return nil, status.Errorf(codes.InvalidArgument, "error parsing Address field path array item value from %s: %v", valueStr, err) 10769 } 10770 return fpaiv.(DeviceStatusAddress_FieldPathArrayItemValue), nil 10771 } 10772 10773 func MustParseDeviceStatusAddress_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusAddress_FieldPathArrayItemValue { 10774 fpaiv, err := ParseDeviceStatusAddress_FieldPathArrayItemValue(pathStr, valueStr) 10775 if err != nil { 10776 panic(err) 10777 } 10778 return fpaiv 10779 } 10780 10781 type DeviceStatusAddress_FieldTerminalPathArrayItemValue struct { 10782 DeviceStatusAddress_FieldTerminalPath 10783 value interface{} 10784 } 10785 10786 var _ DeviceStatusAddress_FieldPathArrayItemValue = (*DeviceStatusAddress_FieldTerminalPathArrayItemValue)(nil) 10787 10788 // GetRawValue returns stored element value for array in object Device_Status_Address as interface{} 10789 func (fpaiv *DeviceStatusAddress_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 10790 return fpaiv.value 10791 } 10792 10793 func (fpaiv *DeviceStatusAddress_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_Address) (interface{}, bool) { 10794 return nil, false 10795 } 10796 10797 func (fpaiv *DeviceStatusAddress_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 10798 return fpaiv.GetSingle(source.(*Device_Status_Address)) 10799 } 10800 10801 // Contains returns a boolean indicating if value that is being held is present in given 'Address' 10802 func (fpaiv *DeviceStatusAddress_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_Address) bool { 10803 slice := fpaiv.DeviceStatusAddress_FieldTerminalPath.Get(source) 10804 for _, v := range slice { 10805 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 10806 if proto.Equal(asProtoMsg, v.(proto.Message)) { 10807 return true 10808 } 10809 } else if reflect.DeepEqual(v, fpaiv.value) { 10810 return true 10811 } 10812 } 10813 return false 10814 } 10815 10816 // DeviceStatusAddress_FieldPathArrayOfValues allows storing slice of values for Address fields according to their type 10817 type DeviceStatusAddress_FieldPathArrayOfValues interface { 10818 gotenobject.FieldPathArrayOfValues 10819 DeviceStatusAddress_FieldPath 10820 } 10821 10822 func ParseDeviceStatusAddress_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusAddress_FieldPathArrayOfValues, error) { 10823 fp, err := ParseDeviceStatusAddress_FieldPath(pathStr) 10824 if err != nil { 10825 return nil, err 10826 } 10827 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 10828 if err != nil { 10829 return nil, status.Errorf(codes.InvalidArgument, "error parsing Address field path array of values from %s: %v", valuesStr, err) 10830 } 10831 return fpaov.(DeviceStatusAddress_FieldPathArrayOfValues), nil 10832 } 10833 10834 func MustParseDeviceStatusAddress_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusAddress_FieldPathArrayOfValues { 10835 fpaov, err := ParseDeviceStatusAddress_FieldPathArrayOfValues(pathStr, valuesStr) 10836 if err != nil { 10837 panic(err) 10838 } 10839 return fpaov 10840 } 10841 10842 type DeviceStatusAddress_FieldTerminalPathArrayOfValues struct { 10843 DeviceStatusAddress_FieldTerminalPath 10844 values interface{} 10845 } 10846 10847 var _ DeviceStatusAddress_FieldPathArrayOfValues = (*DeviceStatusAddress_FieldTerminalPathArrayOfValues)(nil) 10848 10849 func (fpaov *DeviceStatusAddress_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 10850 switch fpaov.selector { 10851 case DeviceStatusAddress_FieldPathSelectorAddress: 10852 for _, v := range fpaov.values.([]string) { 10853 values = append(values, v) 10854 } 10855 case DeviceStatusAddress_FieldPathSelectorType: 10856 for _, v := range fpaov.values.([]string) { 10857 values = append(values, v) 10858 } 10859 } 10860 return 10861 } 10862 func (fpaov *DeviceStatusAddress_FieldTerminalPathArrayOfValues) AsAddressArrayOfValues() ([]string, bool) { 10863 res, ok := fpaov.values.([]string) 10864 return res, ok 10865 } 10866 func (fpaov *DeviceStatusAddress_FieldTerminalPathArrayOfValues) AsTypeArrayOfValues() ([]string, bool) { 10867 res, ok := fpaov.values.([]string) 10868 return res, ok 10869 } 10870 10871 // FieldPath provides implementation to handle 10872 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 10873 type DeviceStatusCondition_FieldPath interface { 10874 gotenobject.FieldPath 10875 Selector() DeviceStatusCondition_FieldPathSelector 10876 Get(source *Device_Status_Condition) []interface{} 10877 GetSingle(source *Device_Status_Condition) (interface{}, bool) 10878 ClearValue(item *Device_Status_Condition) 10879 10880 // Those methods build corresponding DeviceStatusCondition_FieldPathValue 10881 // (or array of values) and holds passed value. Panics if injected type is incorrect. 10882 WithIValue(value interface{}) DeviceStatusCondition_FieldPathValue 10883 WithIArrayOfValues(values interface{}) DeviceStatusCondition_FieldPathArrayOfValues 10884 WithIArrayItemValue(value interface{}) DeviceStatusCondition_FieldPathArrayItemValue 10885 } 10886 10887 type DeviceStatusCondition_FieldPathSelector int32 10888 10889 const ( 10890 DeviceStatusCondition_FieldPathSelectorMessage DeviceStatusCondition_FieldPathSelector = 0 10891 DeviceStatusCondition_FieldPathSelectorReason DeviceStatusCondition_FieldPathSelector = 1 10892 DeviceStatusCondition_FieldPathSelectorStatus DeviceStatusCondition_FieldPathSelector = 2 10893 DeviceStatusCondition_FieldPathSelectorType DeviceStatusCondition_FieldPathSelector = 3 10894 DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime DeviceStatusCondition_FieldPathSelector = 4 10895 DeviceStatusCondition_FieldPathSelectorLastTransitionTime DeviceStatusCondition_FieldPathSelector = 5 10896 ) 10897 10898 func (s DeviceStatusCondition_FieldPathSelector) String() string { 10899 switch s { 10900 case DeviceStatusCondition_FieldPathSelectorMessage: 10901 return "message" 10902 case DeviceStatusCondition_FieldPathSelectorReason: 10903 return "reason" 10904 case DeviceStatusCondition_FieldPathSelectorStatus: 10905 return "status" 10906 case DeviceStatusCondition_FieldPathSelectorType: 10907 return "type" 10908 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 10909 return "last_heart_beat_time" 10910 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 10911 return "last_transition_time" 10912 default: 10913 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", s)) 10914 } 10915 } 10916 10917 func BuildDeviceStatusCondition_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusCondition_FieldPath, error) { 10918 if len(fp) == 0 { 10919 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_Condition") 10920 } 10921 if len(fp) == 1 { 10922 switch fp[0] { 10923 case "message": 10924 return &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorMessage}, nil 10925 case "reason": 10926 return &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorReason}, nil 10927 case "status": 10928 return &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorStatus}, nil 10929 case "type": 10930 return &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorType}, nil 10931 case "last_heart_beat_time", "lastHeartBeatTime", "last-heart-beat-time": 10932 return &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime}, nil 10933 case "last_transition_time", "lastTransitionTime", "last-transition-time": 10934 return &DeviceStatusCondition_FieldTerminalPath{selector: DeviceStatusCondition_FieldPathSelectorLastTransitionTime}, nil 10935 } 10936 } 10937 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_Condition", fp) 10938 } 10939 10940 func ParseDeviceStatusCondition_FieldPath(rawField string) (DeviceStatusCondition_FieldPath, error) { 10941 fp, err := gotenobject.ParseRawFieldPath(rawField) 10942 if err != nil { 10943 return nil, err 10944 } 10945 return BuildDeviceStatusCondition_FieldPath(fp) 10946 } 10947 10948 func MustParseDeviceStatusCondition_FieldPath(rawField string) DeviceStatusCondition_FieldPath { 10949 fp, err := ParseDeviceStatusCondition_FieldPath(rawField) 10950 if err != nil { 10951 panic(err) 10952 } 10953 return fp 10954 } 10955 10956 type DeviceStatusCondition_FieldTerminalPath struct { 10957 selector DeviceStatusCondition_FieldPathSelector 10958 } 10959 10960 var _ DeviceStatusCondition_FieldPath = (*DeviceStatusCondition_FieldTerminalPath)(nil) 10961 10962 func (fp *DeviceStatusCondition_FieldTerminalPath) Selector() DeviceStatusCondition_FieldPathSelector { 10963 return fp.selector 10964 } 10965 10966 // String returns path representation in proto convention 10967 func (fp *DeviceStatusCondition_FieldTerminalPath) String() string { 10968 return fp.selector.String() 10969 } 10970 10971 // JSONString returns path representation is JSON convention 10972 func (fp *DeviceStatusCondition_FieldTerminalPath) JSONString() string { 10973 return strcase.ToLowerCamel(fp.String()) 10974 } 10975 10976 // Get returns all values pointed by specific field from source Device_Status_Condition 10977 func (fp *DeviceStatusCondition_FieldTerminalPath) Get(source *Device_Status_Condition) (values []interface{}) { 10978 if source != nil { 10979 switch fp.selector { 10980 case DeviceStatusCondition_FieldPathSelectorMessage: 10981 values = append(values, source.Message) 10982 case DeviceStatusCondition_FieldPathSelectorReason: 10983 values = append(values, source.Reason) 10984 case DeviceStatusCondition_FieldPathSelectorStatus: 10985 values = append(values, source.Status) 10986 case DeviceStatusCondition_FieldPathSelectorType: 10987 values = append(values, source.Type) 10988 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 10989 if source.LastHeartBeatTime != nil { 10990 values = append(values, source.LastHeartBeatTime) 10991 } 10992 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 10993 if source.LastTransitionTime != nil { 10994 values = append(values, source.LastTransitionTime) 10995 } 10996 default: 10997 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 10998 } 10999 } 11000 return 11001 } 11002 11003 func (fp *DeviceStatusCondition_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 11004 return fp.Get(source.(*Device_Status_Condition)) 11005 } 11006 11007 // GetSingle returns value pointed by specific field of from source Device_Status_Condition 11008 func (fp *DeviceStatusCondition_FieldTerminalPath) GetSingle(source *Device_Status_Condition) (interface{}, bool) { 11009 switch fp.selector { 11010 case DeviceStatusCondition_FieldPathSelectorMessage: 11011 return source.GetMessage(), source != nil 11012 case DeviceStatusCondition_FieldPathSelectorReason: 11013 return source.GetReason(), source != nil 11014 case DeviceStatusCondition_FieldPathSelectorStatus: 11015 return source.GetStatus(), source != nil 11016 case DeviceStatusCondition_FieldPathSelectorType: 11017 return source.GetType(), source != nil 11018 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11019 res := source.GetLastHeartBeatTime() 11020 return res, res != nil 11021 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11022 res := source.GetLastTransitionTime() 11023 return res, res != nil 11024 default: 11025 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 11026 } 11027 } 11028 11029 func (fp *DeviceStatusCondition_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 11030 return fp.GetSingle(source.(*Device_Status_Condition)) 11031 } 11032 11033 // GetDefault returns a default value of the field type 11034 func (fp *DeviceStatusCondition_FieldTerminalPath) GetDefault() interface{} { 11035 switch fp.selector { 11036 case DeviceStatusCondition_FieldPathSelectorMessage: 11037 return "" 11038 case DeviceStatusCondition_FieldPathSelectorReason: 11039 return "" 11040 case DeviceStatusCondition_FieldPathSelectorStatus: 11041 return "" 11042 case DeviceStatusCondition_FieldPathSelectorType: 11043 return "" 11044 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11045 return (*timestamppb.Timestamp)(nil) 11046 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11047 return (*timestamppb.Timestamp)(nil) 11048 default: 11049 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 11050 } 11051 } 11052 11053 func (fp *DeviceStatusCondition_FieldTerminalPath) ClearValue(item *Device_Status_Condition) { 11054 if item != nil { 11055 switch fp.selector { 11056 case DeviceStatusCondition_FieldPathSelectorMessage: 11057 item.Message = "" 11058 case DeviceStatusCondition_FieldPathSelectorReason: 11059 item.Reason = "" 11060 case DeviceStatusCondition_FieldPathSelectorStatus: 11061 item.Status = "" 11062 case DeviceStatusCondition_FieldPathSelectorType: 11063 item.Type = "" 11064 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11065 item.LastHeartBeatTime = nil 11066 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11067 item.LastTransitionTime = nil 11068 default: 11069 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 11070 } 11071 } 11072 } 11073 11074 func (fp *DeviceStatusCondition_FieldTerminalPath) ClearValueRaw(item proto.Message) { 11075 fp.ClearValue(item.(*Device_Status_Condition)) 11076 } 11077 11078 // IsLeaf - whether field path is holds simple value 11079 func (fp *DeviceStatusCondition_FieldTerminalPath) IsLeaf() bool { 11080 return fp.selector == DeviceStatusCondition_FieldPathSelectorMessage || 11081 fp.selector == DeviceStatusCondition_FieldPathSelectorReason || 11082 fp.selector == DeviceStatusCondition_FieldPathSelectorStatus || 11083 fp.selector == DeviceStatusCondition_FieldPathSelectorType || 11084 fp.selector == DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime || 11085 fp.selector == DeviceStatusCondition_FieldPathSelectorLastTransitionTime 11086 } 11087 11088 func (fp *DeviceStatusCondition_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 11089 return []gotenobject.FieldPath{fp} 11090 } 11091 11092 func (fp *DeviceStatusCondition_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusCondition_FieldPathValue { 11093 switch fp.selector { 11094 case DeviceStatusCondition_FieldPathSelectorMessage: 11095 return &DeviceStatusCondition_FieldTerminalPathValue{DeviceStatusCondition_FieldTerminalPath: *fp, value: value.(string)} 11096 case DeviceStatusCondition_FieldPathSelectorReason: 11097 return &DeviceStatusCondition_FieldTerminalPathValue{DeviceStatusCondition_FieldTerminalPath: *fp, value: value.(string)} 11098 case DeviceStatusCondition_FieldPathSelectorStatus: 11099 return &DeviceStatusCondition_FieldTerminalPathValue{DeviceStatusCondition_FieldTerminalPath: *fp, value: value.(string)} 11100 case DeviceStatusCondition_FieldPathSelectorType: 11101 return &DeviceStatusCondition_FieldTerminalPathValue{DeviceStatusCondition_FieldTerminalPath: *fp, value: value.(string)} 11102 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11103 return &DeviceStatusCondition_FieldTerminalPathValue{DeviceStatusCondition_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 11104 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11105 return &DeviceStatusCondition_FieldTerminalPathValue{DeviceStatusCondition_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 11106 default: 11107 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 11108 } 11109 } 11110 11111 func (fp *DeviceStatusCondition_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 11112 return fp.WithIValue(value) 11113 } 11114 11115 func (fp *DeviceStatusCondition_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusCondition_FieldPathArrayOfValues { 11116 fpaov := &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp} 11117 switch fp.selector { 11118 case DeviceStatusCondition_FieldPathSelectorMessage: 11119 return &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp, values: values.([]string)} 11120 case DeviceStatusCondition_FieldPathSelectorReason: 11121 return &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp, values: values.([]string)} 11122 case DeviceStatusCondition_FieldPathSelectorStatus: 11123 return &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp, values: values.([]string)} 11124 case DeviceStatusCondition_FieldPathSelectorType: 11125 return &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp, values: values.([]string)} 11126 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11127 return &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 11128 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11129 return &DeviceStatusCondition_FieldTerminalPathArrayOfValues{DeviceStatusCondition_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 11130 default: 11131 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 11132 } 11133 return fpaov 11134 } 11135 11136 func (fp *DeviceStatusCondition_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 11137 return fp.WithIArrayOfValues(values) 11138 } 11139 11140 func (fp *DeviceStatusCondition_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusCondition_FieldPathArrayItemValue { 11141 switch fp.selector { 11142 default: 11143 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fp.selector)) 11144 } 11145 } 11146 11147 func (fp *DeviceStatusCondition_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 11148 return fp.WithIArrayItemValue(value) 11149 } 11150 11151 // DeviceStatusCondition_FieldPathValue allows storing values for Condition fields according to their type 11152 type DeviceStatusCondition_FieldPathValue interface { 11153 DeviceStatusCondition_FieldPath 11154 gotenobject.FieldPathValue 11155 SetTo(target **Device_Status_Condition) 11156 CompareWith(*Device_Status_Condition) (cmp int, comparable bool) 11157 } 11158 11159 func ParseDeviceStatusCondition_FieldPathValue(pathStr, valueStr string) (DeviceStatusCondition_FieldPathValue, error) { 11160 fp, err := ParseDeviceStatusCondition_FieldPath(pathStr) 11161 if err != nil { 11162 return nil, err 11163 } 11164 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 11165 if err != nil { 11166 return nil, status.Errorf(codes.InvalidArgument, "error parsing Condition field path value from %s: %v", valueStr, err) 11167 } 11168 return fpv.(DeviceStatusCondition_FieldPathValue), nil 11169 } 11170 11171 func MustParseDeviceStatusCondition_FieldPathValue(pathStr, valueStr string) DeviceStatusCondition_FieldPathValue { 11172 fpv, err := ParseDeviceStatusCondition_FieldPathValue(pathStr, valueStr) 11173 if err != nil { 11174 panic(err) 11175 } 11176 return fpv 11177 } 11178 11179 type DeviceStatusCondition_FieldTerminalPathValue struct { 11180 DeviceStatusCondition_FieldTerminalPath 11181 value interface{} 11182 } 11183 11184 var _ DeviceStatusCondition_FieldPathValue = (*DeviceStatusCondition_FieldTerminalPathValue)(nil) 11185 11186 // GetRawValue returns raw value stored under selected path for 'Condition' as interface{} 11187 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) GetRawValue() interface{} { 11188 return fpv.value 11189 } 11190 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) AsMessageValue() (string, bool) { 11191 res, ok := fpv.value.(string) 11192 return res, ok 11193 } 11194 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) AsReasonValue() (string, bool) { 11195 res, ok := fpv.value.(string) 11196 return res, ok 11197 } 11198 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) AsStatusValue() (string, bool) { 11199 res, ok := fpv.value.(string) 11200 return res, ok 11201 } 11202 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) AsTypeValue() (string, bool) { 11203 res, ok := fpv.value.(string) 11204 return res, ok 11205 } 11206 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) AsLastHeartBeatTimeValue() (*timestamppb.Timestamp, bool) { 11207 res, ok := fpv.value.(*timestamppb.Timestamp) 11208 return res, ok 11209 } 11210 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) AsLastTransitionTimeValue() (*timestamppb.Timestamp, bool) { 11211 res, ok := fpv.value.(*timestamppb.Timestamp) 11212 return res, ok 11213 } 11214 11215 // SetTo stores value for selected field for object Condition 11216 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) SetTo(target **Device_Status_Condition) { 11217 if *target == nil { 11218 *target = new(Device_Status_Condition) 11219 } 11220 switch fpv.selector { 11221 case DeviceStatusCondition_FieldPathSelectorMessage: 11222 (*target).Message = fpv.value.(string) 11223 case DeviceStatusCondition_FieldPathSelectorReason: 11224 (*target).Reason = fpv.value.(string) 11225 case DeviceStatusCondition_FieldPathSelectorStatus: 11226 (*target).Status = fpv.value.(string) 11227 case DeviceStatusCondition_FieldPathSelectorType: 11228 (*target).Type = fpv.value.(string) 11229 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11230 (*target).LastHeartBeatTime = fpv.value.(*timestamppb.Timestamp) 11231 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11232 (*target).LastTransitionTime = fpv.value.(*timestamppb.Timestamp) 11233 default: 11234 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fpv.selector)) 11235 } 11236 } 11237 11238 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) SetToRaw(target proto.Message) { 11239 typedObject := target.(*Device_Status_Condition) 11240 fpv.SetTo(&typedObject) 11241 } 11242 11243 // CompareWith compares value in the 'DeviceStatusCondition_FieldTerminalPathValue' with the value under path in 'Device_Status_Condition'. 11244 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) CompareWith(source *Device_Status_Condition) (int, bool) { 11245 switch fpv.selector { 11246 case DeviceStatusCondition_FieldPathSelectorMessage: 11247 leftValue := fpv.value.(string) 11248 rightValue := source.GetMessage() 11249 if (leftValue) == (rightValue) { 11250 return 0, true 11251 } else if (leftValue) < (rightValue) { 11252 return -1, true 11253 } else { 11254 return 1, true 11255 } 11256 case DeviceStatusCondition_FieldPathSelectorReason: 11257 leftValue := fpv.value.(string) 11258 rightValue := source.GetReason() 11259 if (leftValue) == (rightValue) { 11260 return 0, true 11261 } else if (leftValue) < (rightValue) { 11262 return -1, true 11263 } else { 11264 return 1, true 11265 } 11266 case DeviceStatusCondition_FieldPathSelectorStatus: 11267 leftValue := fpv.value.(string) 11268 rightValue := source.GetStatus() 11269 if (leftValue) == (rightValue) { 11270 return 0, true 11271 } else if (leftValue) < (rightValue) { 11272 return -1, true 11273 } else { 11274 return 1, true 11275 } 11276 case DeviceStatusCondition_FieldPathSelectorType: 11277 leftValue := fpv.value.(string) 11278 rightValue := source.GetType() 11279 if (leftValue) == (rightValue) { 11280 return 0, true 11281 } else if (leftValue) < (rightValue) { 11282 return -1, true 11283 } else { 11284 return 1, true 11285 } 11286 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11287 leftValue := fpv.value.(*timestamppb.Timestamp) 11288 rightValue := source.GetLastHeartBeatTime() 11289 if leftValue == nil { 11290 if rightValue != nil { 11291 return -1, true 11292 } 11293 return 0, true 11294 } 11295 if rightValue == nil { 11296 return 1, true 11297 } 11298 if leftValue.AsTime().Equal(rightValue.AsTime()) { 11299 return 0, true 11300 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 11301 return -1, true 11302 } else { 11303 return 1, true 11304 } 11305 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11306 leftValue := fpv.value.(*timestamppb.Timestamp) 11307 rightValue := source.GetLastTransitionTime() 11308 if leftValue == nil { 11309 if rightValue != nil { 11310 return -1, true 11311 } 11312 return 0, true 11313 } 11314 if rightValue == nil { 11315 return 1, true 11316 } 11317 if leftValue.AsTime().Equal(rightValue.AsTime()) { 11318 return 0, true 11319 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 11320 return -1, true 11321 } else { 11322 return 1, true 11323 } 11324 default: 11325 panic(fmt.Sprintf("Invalid selector for Device_Status_Condition: %d", fpv.selector)) 11326 } 11327 } 11328 11329 func (fpv *DeviceStatusCondition_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 11330 return fpv.CompareWith(source.(*Device_Status_Condition)) 11331 } 11332 11333 // DeviceStatusCondition_FieldPathArrayItemValue allows storing single item in Path-specific values for Condition according to their type 11334 // Present only for array (repeated) types. 11335 type DeviceStatusCondition_FieldPathArrayItemValue interface { 11336 gotenobject.FieldPathArrayItemValue 11337 DeviceStatusCondition_FieldPath 11338 ContainsValue(*Device_Status_Condition) bool 11339 } 11340 11341 // ParseDeviceStatusCondition_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 11342 func ParseDeviceStatusCondition_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusCondition_FieldPathArrayItemValue, error) { 11343 fp, err := ParseDeviceStatusCondition_FieldPath(pathStr) 11344 if err != nil { 11345 return nil, err 11346 } 11347 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 11348 if err != nil { 11349 return nil, status.Errorf(codes.InvalidArgument, "error parsing Condition field path array item value from %s: %v", valueStr, err) 11350 } 11351 return fpaiv.(DeviceStatusCondition_FieldPathArrayItemValue), nil 11352 } 11353 11354 func MustParseDeviceStatusCondition_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusCondition_FieldPathArrayItemValue { 11355 fpaiv, err := ParseDeviceStatusCondition_FieldPathArrayItemValue(pathStr, valueStr) 11356 if err != nil { 11357 panic(err) 11358 } 11359 return fpaiv 11360 } 11361 11362 type DeviceStatusCondition_FieldTerminalPathArrayItemValue struct { 11363 DeviceStatusCondition_FieldTerminalPath 11364 value interface{} 11365 } 11366 11367 var _ DeviceStatusCondition_FieldPathArrayItemValue = (*DeviceStatusCondition_FieldTerminalPathArrayItemValue)(nil) 11368 11369 // GetRawValue returns stored element value for array in object Device_Status_Condition as interface{} 11370 func (fpaiv *DeviceStatusCondition_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 11371 return fpaiv.value 11372 } 11373 11374 func (fpaiv *DeviceStatusCondition_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_Condition) (interface{}, bool) { 11375 return nil, false 11376 } 11377 11378 func (fpaiv *DeviceStatusCondition_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 11379 return fpaiv.GetSingle(source.(*Device_Status_Condition)) 11380 } 11381 11382 // Contains returns a boolean indicating if value that is being held is present in given 'Condition' 11383 func (fpaiv *DeviceStatusCondition_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_Condition) bool { 11384 slice := fpaiv.DeviceStatusCondition_FieldTerminalPath.Get(source) 11385 for _, v := range slice { 11386 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 11387 if proto.Equal(asProtoMsg, v.(proto.Message)) { 11388 return true 11389 } 11390 } else if reflect.DeepEqual(v, fpaiv.value) { 11391 return true 11392 } 11393 } 11394 return false 11395 } 11396 11397 // DeviceStatusCondition_FieldPathArrayOfValues allows storing slice of values for Condition fields according to their type 11398 type DeviceStatusCondition_FieldPathArrayOfValues interface { 11399 gotenobject.FieldPathArrayOfValues 11400 DeviceStatusCondition_FieldPath 11401 } 11402 11403 func ParseDeviceStatusCondition_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusCondition_FieldPathArrayOfValues, error) { 11404 fp, err := ParseDeviceStatusCondition_FieldPath(pathStr) 11405 if err != nil { 11406 return nil, err 11407 } 11408 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 11409 if err != nil { 11410 return nil, status.Errorf(codes.InvalidArgument, "error parsing Condition field path array of values from %s: %v", valuesStr, err) 11411 } 11412 return fpaov.(DeviceStatusCondition_FieldPathArrayOfValues), nil 11413 } 11414 11415 func MustParseDeviceStatusCondition_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusCondition_FieldPathArrayOfValues { 11416 fpaov, err := ParseDeviceStatusCondition_FieldPathArrayOfValues(pathStr, valuesStr) 11417 if err != nil { 11418 panic(err) 11419 } 11420 return fpaov 11421 } 11422 11423 type DeviceStatusCondition_FieldTerminalPathArrayOfValues struct { 11424 DeviceStatusCondition_FieldTerminalPath 11425 values interface{} 11426 } 11427 11428 var _ DeviceStatusCondition_FieldPathArrayOfValues = (*DeviceStatusCondition_FieldTerminalPathArrayOfValues)(nil) 11429 11430 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 11431 switch fpaov.selector { 11432 case DeviceStatusCondition_FieldPathSelectorMessage: 11433 for _, v := range fpaov.values.([]string) { 11434 values = append(values, v) 11435 } 11436 case DeviceStatusCondition_FieldPathSelectorReason: 11437 for _, v := range fpaov.values.([]string) { 11438 values = append(values, v) 11439 } 11440 case DeviceStatusCondition_FieldPathSelectorStatus: 11441 for _, v := range fpaov.values.([]string) { 11442 values = append(values, v) 11443 } 11444 case DeviceStatusCondition_FieldPathSelectorType: 11445 for _, v := range fpaov.values.([]string) { 11446 values = append(values, v) 11447 } 11448 case DeviceStatusCondition_FieldPathSelectorLastHeartBeatTime: 11449 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 11450 values = append(values, v) 11451 } 11452 case DeviceStatusCondition_FieldPathSelectorLastTransitionTime: 11453 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 11454 values = append(values, v) 11455 } 11456 } 11457 return 11458 } 11459 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) AsMessageArrayOfValues() ([]string, bool) { 11460 res, ok := fpaov.values.([]string) 11461 return res, ok 11462 } 11463 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) AsReasonArrayOfValues() ([]string, bool) { 11464 res, ok := fpaov.values.([]string) 11465 return res, ok 11466 } 11467 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) AsStatusArrayOfValues() ([]string, bool) { 11468 res, ok := fpaov.values.([]string) 11469 return res, ok 11470 } 11471 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) AsTypeArrayOfValues() ([]string, bool) { 11472 res, ok := fpaov.values.([]string) 11473 return res, ok 11474 } 11475 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) AsLastHeartBeatTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 11476 res, ok := fpaov.values.([]*timestamppb.Timestamp) 11477 return res, ok 11478 } 11479 func (fpaov *DeviceStatusCondition_FieldTerminalPathArrayOfValues) AsLastTransitionTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 11480 res, ok := fpaov.values.([]*timestamppb.Timestamp) 11481 return res, ok 11482 } 11483 11484 // FieldPath provides implementation to handle 11485 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 11486 type DeviceStatusNetworkConfigState_FieldPath interface { 11487 gotenobject.FieldPath 11488 Selector() DeviceStatusNetworkConfigState_FieldPathSelector 11489 Get(source *Device_Status_NetworkConfigState) []interface{} 11490 GetSingle(source *Device_Status_NetworkConfigState) (interface{}, bool) 11491 ClearValue(item *Device_Status_NetworkConfigState) 11492 11493 // Those methods build corresponding DeviceStatusNetworkConfigState_FieldPathValue 11494 // (or array of values) and holds passed value. Panics if injected type is incorrect. 11495 WithIValue(value interface{}) DeviceStatusNetworkConfigState_FieldPathValue 11496 WithIArrayOfValues(values interface{}) DeviceStatusNetworkConfigState_FieldPathArrayOfValues 11497 WithIArrayItemValue(value interface{}) DeviceStatusNetworkConfigState_FieldPathArrayItemValue 11498 } 11499 11500 type DeviceStatusNetworkConfigState_FieldPathSelector int32 11501 11502 const ( 11503 DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource DeviceStatusNetworkConfigState_FieldPathSelector = 0 11504 DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource DeviceStatusNetworkConfigState_FieldPathSelector = 1 11505 DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError DeviceStatusNetworkConfigState_FieldPathSelector = 2 11506 DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig DeviceStatusNetworkConfigState_FieldPathSelector = 3 11507 DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig DeviceStatusNetworkConfigState_FieldPathSelector = 4 11508 DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig DeviceStatusNetworkConfigState_FieldPathSelector = 5 11509 ) 11510 11511 func (s DeviceStatusNetworkConfigState_FieldPathSelector) String() string { 11512 switch s { 11513 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11514 return "active_network_config_source" 11515 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11516 return "desired_network_config_source" 11517 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11518 return "desired_network_config_error" 11519 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11520 return "default_netplan_config" 11521 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11522 return "active_netplan_config" 11523 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11524 return "desired_netplan_config" 11525 default: 11526 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", s)) 11527 } 11528 } 11529 11530 func BuildDeviceStatusNetworkConfigState_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusNetworkConfigState_FieldPath, error) { 11531 if len(fp) == 0 { 11532 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_NetworkConfigState") 11533 } 11534 if len(fp) == 1 { 11535 switch fp[0] { 11536 case "active_network_config_source", "activeNetworkConfigSource", "active-network-config-source": 11537 return &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource}, nil 11538 case "desired_network_config_source", "desiredNetworkConfigSource", "desired-network-config-source": 11539 return &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource}, nil 11540 case "desired_network_config_error", "desiredNetworkConfigError", "desired-network-config-error": 11541 return &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError}, nil 11542 case "default_netplan_config", "defaultNetplanConfig", "default-netplan-config": 11543 return &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig}, nil 11544 case "active_netplan_config", "activeNetplanConfig", "active-netplan-config": 11545 return &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig}, nil 11546 case "desired_netplan_config", "desiredNetplanConfig", "desired-netplan-config": 11547 return &DeviceStatusNetworkConfigState_FieldTerminalPath{selector: DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig}, nil 11548 } 11549 } 11550 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_NetworkConfigState", fp) 11551 } 11552 11553 func ParseDeviceStatusNetworkConfigState_FieldPath(rawField string) (DeviceStatusNetworkConfigState_FieldPath, error) { 11554 fp, err := gotenobject.ParseRawFieldPath(rawField) 11555 if err != nil { 11556 return nil, err 11557 } 11558 return BuildDeviceStatusNetworkConfigState_FieldPath(fp) 11559 } 11560 11561 func MustParseDeviceStatusNetworkConfigState_FieldPath(rawField string) DeviceStatusNetworkConfigState_FieldPath { 11562 fp, err := ParseDeviceStatusNetworkConfigState_FieldPath(rawField) 11563 if err != nil { 11564 panic(err) 11565 } 11566 return fp 11567 } 11568 11569 type DeviceStatusNetworkConfigState_FieldTerminalPath struct { 11570 selector DeviceStatusNetworkConfigState_FieldPathSelector 11571 } 11572 11573 var _ DeviceStatusNetworkConfigState_FieldPath = (*DeviceStatusNetworkConfigState_FieldTerminalPath)(nil) 11574 11575 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) Selector() DeviceStatusNetworkConfigState_FieldPathSelector { 11576 return fp.selector 11577 } 11578 11579 // String returns path representation in proto convention 11580 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) String() string { 11581 return fp.selector.String() 11582 } 11583 11584 // JSONString returns path representation is JSON convention 11585 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) JSONString() string { 11586 return strcase.ToLowerCamel(fp.String()) 11587 } 11588 11589 // Get returns all values pointed by specific field from source Device_Status_NetworkConfigState 11590 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) Get(source *Device_Status_NetworkConfigState) (values []interface{}) { 11591 if source != nil { 11592 switch fp.selector { 11593 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11594 values = append(values, source.ActiveNetworkConfigSource) 11595 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11596 values = append(values, source.DesiredNetworkConfigSource) 11597 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11598 values = append(values, source.DesiredNetworkConfigError) 11599 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11600 values = append(values, source.DefaultNetplanConfig) 11601 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11602 values = append(values, source.ActiveNetplanConfig) 11603 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11604 values = append(values, source.DesiredNetplanConfig) 11605 default: 11606 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11607 } 11608 } 11609 return 11610 } 11611 11612 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 11613 return fp.Get(source.(*Device_Status_NetworkConfigState)) 11614 } 11615 11616 // GetSingle returns value pointed by specific field of from source Device_Status_NetworkConfigState 11617 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) GetSingle(source *Device_Status_NetworkConfigState) (interface{}, bool) { 11618 switch fp.selector { 11619 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11620 return source.GetActiveNetworkConfigSource(), source != nil 11621 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11622 return source.GetDesiredNetworkConfigSource(), source != nil 11623 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11624 return source.GetDesiredNetworkConfigError(), source != nil 11625 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11626 return source.GetDefaultNetplanConfig(), source != nil 11627 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11628 return source.GetActiveNetplanConfig(), source != nil 11629 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11630 return source.GetDesiredNetplanConfig(), source != nil 11631 default: 11632 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11633 } 11634 } 11635 11636 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 11637 return fp.GetSingle(source.(*Device_Status_NetworkConfigState)) 11638 } 11639 11640 // GetDefault returns a default value of the field type 11641 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) GetDefault() interface{} { 11642 switch fp.selector { 11643 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11644 return Device_Status_NetworkConfigState_UNKNOWN 11645 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11646 return Device_Status_NetworkConfigState_UNKNOWN 11647 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11648 return "" 11649 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11650 return "" 11651 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11652 return "" 11653 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11654 return "" 11655 default: 11656 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11657 } 11658 } 11659 11660 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) ClearValue(item *Device_Status_NetworkConfigState) { 11661 if item != nil { 11662 switch fp.selector { 11663 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11664 item.ActiveNetworkConfigSource = Device_Status_NetworkConfigState_UNKNOWN 11665 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11666 item.DesiredNetworkConfigSource = Device_Status_NetworkConfigState_UNKNOWN 11667 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11668 item.DesiredNetworkConfigError = "" 11669 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11670 item.DefaultNetplanConfig = "" 11671 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11672 item.ActiveNetplanConfig = "" 11673 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11674 item.DesiredNetplanConfig = "" 11675 default: 11676 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11677 } 11678 } 11679 } 11680 11681 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) ClearValueRaw(item proto.Message) { 11682 fp.ClearValue(item.(*Device_Status_NetworkConfigState)) 11683 } 11684 11685 // IsLeaf - whether field path is holds simple value 11686 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) IsLeaf() bool { 11687 return fp.selector == DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource || 11688 fp.selector == DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource || 11689 fp.selector == DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError || 11690 fp.selector == DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig || 11691 fp.selector == DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig || 11692 fp.selector == DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig 11693 } 11694 11695 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 11696 return []gotenobject.FieldPath{fp} 11697 } 11698 11699 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusNetworkConfigState_FieldPathValue { 11700 switch fp.selector { 11701 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11702 return &DeviceStatusNetworkConfigState_FieldTerminalPathValue{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, value: value.(Device_Status_NetworkConfigState_NetworkConfigSource)} 11703 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11704 return &DeviceStatusNetworkConfigState_FieldTerminalPathValue{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, value: value.(Device_Status_NetworkConfigState_NetworkConfigSource)} 11705 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11706 return &DeviceStatusNetworkConfigState_FieldTerminalPathValue{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, value: value.(string)} 11707 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11708 return &DeviceStatusNetworkConfigState_FieldTerminalPathValue{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, value: value.(string)} 11709 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11710 return &DeviceStatusNetworkConfigState_FieldTerminalPathValue{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, value: value.(string)} 11711 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11712 return &DeviceStatusNetworkConfigState_FieldTerminalPathValue{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, value: value.(string)} 11713 default: 11714 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11715 } 11716 } 11717 11718 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 11719 return fp.WithIValue(value) 11720 } 11721 11722 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusNetworkConfigState_FieldPathArrayOfValues { 11723 fpaov := &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp} 11724 switch fp.selector { 11725 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11726 return &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, values: values.([]Device_Status_NetworkConfigState_NetworkConfigSource)} 11727 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11728 return &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, values: values.([]Device_Status_NetworkConfigState_NetworkConfigSource)} 11729 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11730 return &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, values: values.([]string)} 11731 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11732 return &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, values: values.([]string)} 11733 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11734 return &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, values: values.([]string)} 11735 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11736 return &DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues{DeviceStatusNetworkConfigState_FieldTerminalPath: *fp, values: values.([]string)} 11737 default: 11738 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11739 } 11740 return fpaov 11741 } 11742 11743 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 11744 return fp.WithIArrayOfValues(values) 11745 } 11746 11747 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusNetworkConfigState_FieldPathArrayItemValue { 11748 switch fp.selector { 11749 default: 11750 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fp.selector)) 11751 } 11752 } 11753 11754 func (fp *DeviceStatusNetworkConfigState_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 11755 return fp.WithIArrayItemValue(value) 11756 } 11757 11758 // DeviceStatusNetworkConfigState_FieldPathValue allows storing values for NetworkConfigState fields according to their type 11759 type DeviceStatusNetworkConfigState_FieldPathValue interface { 11760 DeviceStatusNetworkConfigState_FieldPath 11761 gotenobject.FieldPathValue 11762 SetTo(target **Device_Status_NetworkConfigState) 11763 CompareWith(*Device_Status_NetworkConfigState) (cmp int, comparable bool) 11764 } 11765 11766 func ParseDeviceStatusNetworkConfigState_FieldPathValue(pathStr, valueStr string) (DeviceStatusNetworkConfigState_FieldPathValue, error) { 11767 fp, err := ParseDeviceStatusNetworkConfigState_FieldPath(pathStr) 11768 if err != nil { 11769 return nil, err 11770 } 11771 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 11772 if err != nil { 11773 return nil, status.Errorf(codes.InvalidArgument, "error parsing NetworkConfigState field path value from %s: %v", valueStr, err) 11774 } 11775 return fpv.(DeviceStatusNetworkConfigState_FieldPathValue), nil 11776 } 11777 11778 func MustParseDeviceStatusNetworkConfigState_FieldPathValue(pathStr, valueStr string) DeviceStatusNetworkConfigState_FieldPathValue { 11779 fpv, err := ParseDeviceStatusNetworkConfigState_FieldPathValue(pathStr, valueStr) 11780 if err != nil { 11781 panic(err) 11782 } 11783 return fpv 11784 } 11785 11786 type DeviceStatusNetworkConfigState_FieldTerminalPathValue struct { 11787 DeviceStatusNetworkConfigState_FieldTerminalPath 11788 value interface{} 11789 } 11790 11791 var _ DeviceStatusNetworkConfigState_FieldPathValue = (*DeviceStatusNetworkConfigState_FieldTerminalPathValue)(nil) 11792 11793 // GetRawValue returns raw value stored under selected path for 'NetworkConfigState' as interface{} 11794 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) GetRawValue() interface{} { 11795 return fpv.value 11796 } 11797 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) AsActiveNetworkConfigSourceValue() (Device_Status_NetworkConfigState_NetworkConfigSource, bool) { 11798 res, ok := fpv.value.(Device_Status_NetworkConfigState_NetworkConfigSource) 11799 return res, ok 11800 } 11801 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) AsDesiredNetworkConfigSourceValue() (Device_Status_NetworkConfigState_NetworkConfigSource, bool) { 11802 res, ok := fpv.value.(Device_Status_NetworkConfigState_NetworkConfigSource) 11803 return res, ok 11804 } 11805 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) AsDesiredNetworkConfigErrorValue() (string, bool) { 11806 res, ok := fpv.value.(string) 11807 return res, ok 11808 } 11809 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) AsDefaultNetplanConfigValue() (string, bool) { 11810 res, ok := fpv.value.(string) 11811 return res, ok 11812 } 11813 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) AsActiveNetplanConfigValue() (string, bool) { 11814 res, ok := fpv.value.(string) 11815 return res, ok 11816 } 11817 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) AsDesiredNetplanConfigValue() (string, bool) { 11818 res, ok := fpv.value.(string) 11819 return res, ok 11820 } 11821 11822 // SetTo stores value for selected field for object NetworkConfigState 11823 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) SetTo(target **Device_Status_NetworkConfigState) { 11824 if *target == nil { 11825 *target = new(Device_Status_NetworkConfigState) 11826 } 11827 switch fpv.selector { 11828 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11829 (*target).ActiveNetworkConfigSource = fpv.value.(Device_Status_NetworkConfigState_NetworkConfigSource) 11830 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11831 (*target).DesiredNetworkConfigSource = fpv.value.(Device_Status_NetworkConfigState_NetworkConfigSource) 11832 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11833 (*target).DesiredNetworkConfigError = fpv.value.(string) 11834 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11835 (*target).DefaultNetplanConfig = fpv.value.(string) 11836 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11837 (*target).ActiveNetplanConfig = fpv.value.(string) 11838 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11839 (*target).DesiredNetplanConfig = fpv.value.(string) 11840 default: 11841 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fpv.selector)) 11842 } 11843 } 11844 11845 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) SetToRaw(target proto.Message) { 11846 typedObject := target.(*Device_Status_NetworkConfigState) 11847 fpv.SetTo(&typedObject) 11848 } 11849 11850 // CompareWith compares value in the 'DeviceStatusNetworkConfigState_FieldTerminalPathValue' with the value under path in 'Device_Status_NetworkConfigState'. 11851 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) CompareWith(source *Device_Status_NetworkConfigState) (int, bool) { 11852 switch fpv.selector { 11853 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 11854 leftValue := fpv.value.(Device_Status_NetworkConfigState_NetworkConfigSource) 11855 rightValue := source.GetActiveNetworkConfigSource() 11856 if (leftValue) == (rightValue) { 11857 return 0, true 11858 } else if (leftValue) < (rightValue) { 11859 return -1, true 11860 } else { 11861 return 1, true 11862 } 11863 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 11864 leftValue := fpv.value.(Device_Status_NetworkConfigState_NetworkConfigSource) 11865 rightValue := source.GetDesiredNetworkConfigSource() 11866 if (leftValue) == (rightValue) { 11867 return 0, true 11868 } else if (leftValue) < (rightValue) { 11869 return -1, true 11870 } else { 11871 return 1, true 11872 } 11873 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 11874 leftValue := fpv.value.(string) 11875 rightValue := source.GetDesiredNetworkConfigError() 11876 if (leftValue) == (rightValue) { 11877 return 0, true 11878 } else if (leftValue) < (rightValue) { 11879 return -1, true 11880 } else { 11881 return 1, true 11882 } 11883 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 11884 leftValue := fpv.value.(string) 11885 rightValue := source.GetDefaultNetplanConfig() 11886 if (leftValue) == (rightValue) { 11887 return 0, true 11888 } else if (leftValue) < (rightValue) { 11889 return -1, true 11890 } else { 11891 return 1, true 11892 } 11893 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 11894 leftValue := fpv.value.(string) 11895 rightValue := source.GetActiveNetplanConfig() 11896 if (leftValue) == (rightValue) { 11897 return 0, true 11898 } else if (leftValue) < (rightValue) { 11899 return -1, true 11900 } else { 11901 return 1, true 11902 } 11903 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 11904 leftValue := fpv.value.(string) 11905 rightValue := source.GetDesiredNetplanConfig() 11906 if (leftValue) == (rightValue) { 11907 return 0, true 11908 } else if (leftValue) < (rightValue) { 11909 return -1, true 11910 } else { 11911 return 1, true 11912 } 11913 default: 11914 panic(fmt.Sprintf("Invalid selector for Device_Status_NetworkConfigState: %d", fpv.selector)) 11915 } 11916 } 11917 11918 func (fpv *DeviceStatusNetworkConfigState_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 11919 return fpv.CompareWith(source.(*Device_Status_NetworkConfigState)) 11920 } 11921 11922 // DeviceStatusNetworkConfigState_FieldPathArrayItemValue allows storing single item in Path-specific values for NetworkConfigState according to their type 11923 // Present only for array (repeated) types. 11924 type DeviceStatusNetworkConfigState_FieldPathArrayItemValue interface { 11925 gotenobject.FieldPathArrayItemValue 11926 DeviceStatusNetworkConfigState_FieldPath 11927 ContainsValue(*Device_Status_NetworkConfigState) bool 11928 } 11929 11930 // ParseDeviceStatusNetworkConfigState_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 11931 func ParseDeviceStatusNetworkConfigState_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusNetworkConfigState_FieldPathArrayItemValue, error) { 11932 fp, err := ParseDeviceStatusNetworkConfigState_FieldPath(pathStr) 11933 if err != nil { 11934 return nil, err 11935 } 11936 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 11937 if err != nil { 11938 return nil, status.Errorf(codes.InvalidArgument, "error parsing NetworkConfigState field path array item value from %s: %v", valueStr, err) 11939 } 11940 return fpaiv.(DeviceStatusNetworkConfigState_FieldPathArrayItemValue), nil 11941 } 11942 11943 func MustParseDeviceStatusNetworkConfigState_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusNetworkConfigState_FieldPathArrayItemValue { 11944 fpaiv, err := ParseDeviceStatusNetworkConfigState_FieldPathArrayItemValue(pathStr, valueStr) 11945 if err != nil { 11946 panic(err) 11947 } 11948 return fpaiv 11949 } 11950 11951 type DeviceStatusNetworkConfigState_FieldTerminalPathArrayItemValue struct { 11952 DeviceStatusNetworkConfigState_FieldTerminalPath 11953 value interface{} 11954 } 11955 11956 var _ DeviceStatusNetworkConfigState_FieldPathArrayItemValue = (*DeviceStatusNetworkConfigState_FieldTerminalPathArrayItemValue)(nil) 11957 11958 // GetRawValue returns stored element value for array in object Device_Status_NetworkConfigState as interface{} 11959 func (fpaiv *DeviceStatusNetworkConfigState_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 11960 return fpaiv.value 11961 } 11962 11963 func (fpaiv *DeviceStatusNetworkConfigState_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_NetworkConfigState) (interface{}, bool) { 11964 return nil, false 11965 } 11966 11967 func (fpaiv *DeviceStatusNetworkConfigState_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 11968 return fpaiv.GetSingle(source.(*Device_Status_NetworkConfigState)) 11969 } 11970 11971 // Contains returns a boolean indicating if value that is being held is present in given 'NetworkConfigState' 11972 func (fpaiv *DeviceStatusNetworkConfigState_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_NetworkConfigState) bool { 11973 slice := fpaiv.DeviceStatusNetworkConfigState_FieldTerminalPath.Get(source) 11974 for _, v := range slice { 11975 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 11976 if proto.Equal(asProtoMsg, v.(proto.Message)) { 11977 return true 11978 } 11979 } else if reflect.DeepEqual(v, fpaiv.value) { 11980 return true 11981 } 11982 } 11983 return false 11984 } 11985 11986 // DeviceStatusNetworkConfigState_FieldPathArrayOfValues allows storing slice of values for NetworkConfigState fields according to their type 11987 type DeviceStatusNetworkConfigState_FieldPathArrayOfValues interface { 11988 gotenobject.FieldPathArrayOfValues 11989 DeviceStatusNetworkConfigState_FieldPath 11990 } 11991 11992 func ParseDeviceStatusNetworkConfigState_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusNetworkConfigState_FieldPathArrayOfValues, error) { 11993 fp, err := ParseDeviceStatusNetworkConfigState_FieldPath(pathStr) 11994 if err != nil { 11995 return nil, err 11996 } 11997 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 11998 if err != nil { 11999 return nil, status.Errorf(codes.InvalidArgument, "error parsing NetworkConfigState field path array of values from %s: %v", valuesStr, err) 12000 } 12001 return fpaov.(DeviceStatusNetworkConfigState_FieldPathArrayOfValues), nil 12002 } 12003 12004 func MustParseDeviceStatusNetworkConfigState_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusNetworkConfigState_FieldPathArrayOfValues { 12005 fpaov, err := ParseDeviceStatusNetworkConfigState_FieldPathArrayOfValues(pathStr, valuesStr) 12006 if err != nil { 12007 panic(err) 12008 } 12009 return fpaov 12010 } 12011 12012 type DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues struct { 12013 DeviceStatusNetworkConfigState_FieldTerminalPath 12014 values interface{} 12015 } 12016 12017 var _ DeviceStatusNetworkConfigState_FieldPathArrayOfValues = (*DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues)(nil) 12018 12019 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 12020 switch fpaov.selector { 12021 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetworkConfigSource: 12022 for _, v := range fpaov.values.([]Device_Status_NetworkConfigState_NetworkConfigSource) { 12023 values = append(values, v) 12024 } 12025 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigSource: 12026 for _, v := range fpaov.values.([]Device_Status_NetworkConfigState_NetworkConfigSource) { 12027 values = append(values, v) 12028 } 12029 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetworkConfigError: 12030 for _, v := range fpaov.values.([]string) { 12031 values = append(values, v) 12032 } 12033 case DeviceStatusNetworkConfigState_FieldPathSelectorDefaultNetplanConfig: 12034 for _, v := range fpaov.values.([]string) { 12035 values = append(values, v) 12036 } 12037 case DeviceStatusNetworkConfigState_FieldPathSelectorActiveNetplanConfig: 12038 for _, v := range fpaov.values.([]string) { 12039 values = append(values, v) 12040 } 12041 case DeviceStatusNetworkConfigState_FieldPathSelectorDesiredNetplanConfig: 12042 for _, v := range fpaov.values.([]string) { 12043 values = append(values, v) 12044 } 12045 } 12046 return 12047 } 12048 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) AsActiveNetworkConfigSourceArrayOfValues() ([]Device_Status_NetworkConfigState_NetworkConfigSource, bool) { 12049 res, ok := fpaov.values.([]Device_Status_NetworkConfigState_NetworkConfigSource) 12050 return res, ok 12051 } 12052 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) AsDesiredNetworkConfigSourceArrayOfValues() ([]Device_Status_NetworkConfigState_NetworkConfigSource, bool) { 12053 res, ok := fpaov.values.([]Device_Status_NetworkConfigState_NetworkConfigSource) 12054 return res, ok 12055 } 12056 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) AsDesiredNetworkConfigErrorArrayOfValues() ([]string, bool) { 12057 res, ok := fpaov.values.([]string) 12058 return res, ok 12059 } 12060 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) AsDefaultNetplanConfigArrayOfValues() ([]string, bool) { 12061 res, ok := fpaov.values.([]string) 12062 return res, ok 12063 } 12064 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) AsActiveNetplanConfigArrayOfValues() ([]string, bool) { 12065 res, ok := fpaov.values.([]string) 12066 return res, ok 12067 } 12068 func (fpaov *DeviceStatusNetworkConfigState_FieldTerminalPathArrayOfValues) AsDesiredNetplanConfigArrayOfValues() ([]string, bool) { 12069 res, ok := fpaov.values.([]string) 12070 return res, ok 12071 } 12072 12073 // FieldPath provides implementation to handle 12074 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 12075 type DeviceStatusProxyConfigStatus_FieldPath interface { 12076 gotenobject.FieldPath 12077 Selector() DeviceStatusProxyConfigStatus_FieldPathSelector 12078 Get(source *Device_Status_ProxyConfigStatus) []interface{} 12079 GetSingle(source *Device_Status_ProxyConfigStatus) (interface{}, bool) 12080 ClearValue(item *Device_Status_ProxyConfigStatus) 12081 12082 // Those methods build corresponding DeviceStatusProxyConfigStatus_FieldPathValue 12083 // (or array of values) and holds passed value. Panics if injected type is incorrect. 12084 WithIValue(value interface{}) DeviceStatusProxyConfigStatus_FieldPathValue 12085 WithIArrayOfValues(values interface{}) DeviceStatusProxyConfigStatus_FieldPathArrayOfValues 12086 WithIArrayItemValue(value interface{}) DeviceStatusProxyConfigStatus_FieldPathArrayItemValue 12087 } 12088 12089 type DeviceStatusProxyConfigStatus_FieldPathSelector int32 12090 12091 const ( 12092 DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource DeviceStatusProxyConfigStatus_FieldPathSelector = 0 12093 DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource DeviceStatusProxyConfigStatus_FieldPathSelector = 1 12094 DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError DeviceStatusProxyConfigStatus_FieldPathSelector = 2 12095 DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig DeviceStatusProxyConfigStatus_FieldPathSelector = 3 12096 DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig DeviceStatusProxyConfigStatus_FieldPathSelector = 4 12097 DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig DeviceStatusProxyConfigStatus_FieldPathSelector = 5 12098 ) 12099 12100 func (s DeviceStatusProxyConfigStatus_FieldPathSelector) String() string { 12101 switch s { 12102 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12103 return "active_config_source" 12104 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12105 return "desired_config_source" 12106 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12107 return "proxy_config_error" 12108 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12109 return "default_config" 12110 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12111 return "active_config" 12112 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12113 return "api_config" 12114 default: 12115 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", s)) 12116 } 12117 } 12118 12119 func BuildDeviceStatusProxyConfigStatus_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusProxyConfigStatus_FieldPath, error) { 12120 if len(fp) == 0 { 12121 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_ProxyConfigStatus") 12122 } 12123 if len(fp) == 1 { 12124 switch fp[0] { 12125 case "active_config_source", "activeConfigSource", "active-config-source": 12126 return &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource}, nil 12127 case "desired_config_source", "desiredConfigSource", "desired-config-source": 12128 return &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource}, nil 12129 case "proxy_config_error", "proxyConfigError", "proxy-config-error": 12130 return &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError}, nil 12131 case "default_config", "defaultConfig", "default-config": 12132 return &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig}, nil 12133 case "active_config", "activeConfig", "active-config": 12134 return &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig}, nil 12135 case "api_config", "apiConfig", "api-config": 12136 return &DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig}, nil 12137 } 12138 } else { 12139 switch fp[0] { 12140 case "default_config", "defaultConfig", "default-config": 12141 if subpath, err := BuildDeviceSpecProxyConfig_FieldPath(fp[1:]); err != nil { 12142 return nil, err 12143 } else { 12144 return &DeviceStatusProxyConfigStatus_FieldSubPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig, subPath: subpath}, nil 12145 } 12146 case "active_config", "activeConfig", "active-config": 12147 if subpath, err := BuildDeviceSpecProxyConfig_FieldPath(fp[1:]); err != nil { 12148 return nil, err 12149 } else { 12150 return &DeviceStatusProxyConfigStatus_FieldSubPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig, subPath: subpath}, nil 12151 } 12152 case "api_config", "apiConfig", "api-config": 12153 if subpath, err := BuildDeviceSpecProxyConfig_FieldPath(fp[1:]); err != nil { 12154 return nil, err 12155 } else { 12156 return &DeviceStatusProxyConfigStatus_FieldSubPath{selector: DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig, subPath: subpath}, nil 12157 } 12158 } 12159 } 12160 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_ProxyConfigStatus", fp) 12161 } 12162 12163 func ParseDeviceStatusProxyConfigStatus_FieldPath(rawField string) (DeviceStatusProxyConfigStatus_FieldPath, error) { 12164 fp, err := gotenobject.ParseRawFieldPath(rawField) 12165 if err != nil { 12166 return nil, err 12167 } 12168 return BuildDeviceStatusProxyConfigStatus_FieldPath(fp) 12169 } 12170 12171 func MustParseDeviceStatusProxyConfigStatus_FieldPath(rawField string) DeviceStatusProxyConfigStatus_FieldPath { 12172 fp, err := ParseDeviceStatusProxyConfigStatus_FieldPath(rawField) 12173 if err != nil { 12174 panic(err) 12175 } 12176 return fp 12177 } 12178 12179 type DeviceStatusProxyConfigStatus_FieldTerminalPath struct { 12180 selector DeviceStatusProxyConfigStatus_FieldPathSelector 12181 } 12182 12183 var _ DeviceStatusProxyConfigStatus_FieldPath = (*DeviceStatusProxyConfigStatus_FieldTerminalPath)(nil) 12184 12185 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) Selector() DeviceStatusProxyConfigStatus_FieldPathSelector { 12186 return fp.selector 12187 } 12188 12189 // String returns path representation in proto convention 12190 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) String() string { 12191 return fp.selector.String() 12192 } 12193 12194 // JSONString returns path representation is JSON convention 12195 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) JSONString() string { 12196 return strcase.ToLowerCamel(fp.String()) 12197 } 12198 12199 // Get returns all values pointed by specific field from source Device_Status_ProxyConfigStatus 12200 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) Get(source *Device_Status_ProxyConfigStatus) (values []interface{}) { 12201 if source != nil { 12202 switch fp.selector { 12203 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12204 values = append(values, source.ActiveConfigSource) 12205 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12206 values = append(values, source.DesiredConfigSource) 12207 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12208 values = append(values, source.ProxyConfigError) 12209 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12210 if source.DefaultConfig != nil { 12211 values = append(values, source.DefaultConfig) 12212 } 12213 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12214 if source.ActiveConfig != nil { 12215 values = append(values, source.ActiveConfig) 12216 } 12217 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12218 if source.ApiConfig != nil { 12219 values = append(values, source.ApiConfig) 12220 } 12221 default: 12222 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12223 } 12224 } 12225 return 12226 } 12227 12228 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 12229 return fp.Get(source.(*Device_Status_ProxyConfigStatus)) 12230 } 12231 12232 // GetSingle returns value pointed by specific field of from source Device_Status_ProxyConfigStatus 12233 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) GetSingle(source *Device_Status_ProxyConfigStatus) (interface{}, bool) { 12234 switch fp.selector { 12235 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12236 return source.GetActiveConfigSource(), source != nil 12237 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12238 return source.GetDesiredConfigSource(), source != nil 12239 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12240 return source.GetProxyConfigError(), source != nil 12241 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12242 res := source.GetDefaultConfig() 12243 return res, res != nil 12244 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12245 res := source.GetActiveConfig() 12246 return res, res != nil 12247 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12248 res := source.GetApiConfig() 12249 return res, res != nil 12250 default: 12251 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12252 } 12253 } 12254 12255 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 12256 return fp.GetSingle(source.(*Device_Status_ProxyConfigStatus)) 12257 } 12258 12259 // GetDefault returns a default value of the field type 12260 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) GetDefault() interface{} { 12261 switch fp.selector { 12262 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12263 return Device_Status_ProxyConfigStatus_NO_CONFIG 12264 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12265 return Device_Status_ProxyConfigStatus_NO_CONFIG 12266 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12267 return "" 12268 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12269 return (*Device_Spec_ProxyConfig)(nil) 12270 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12271 return (*Device_Spec_ProxyConfig)(nil) 12272 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12273 return (*Device_Spec_ProxyConfig)(nil) 12274 default: 12275 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12276 } 12277 } 12278 12279 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) ClearValue(item *Device_Status_ProxyConfigStatus) { 12280 if item != nil { 12281 switch fp.selector { 12282 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12283 item.ActiveConfigSource = Device_Status_ProxyConfigStatus_NO_CONFIG 12284 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12285 item.DesiredConfigSource = Device_Status_ProxyConfigStatus_NO_CONFIG 12286 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12287 item.ProxyConfigError = "" 12288 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12289 item.DefaultConfig = nil 12290 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12291 item.ActiveConfig = nil 12292 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12293 item.ApiConfig = nil 12294 default: 12295 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12296 } 12297 } 12298 } 12299 12300 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) ClearValueRaw(item proto.Message) { 12301 fp.ClearValue(item.(*Device_Status_ProxyConfigStatus)) 12302 } 12303 12304 // IsLeaf - whether field path is holds simple value 12305 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) IsLeaf() bool { 12306 return fp.selector == DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource || 12307 fp.selector == DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource || 12308 fp.selector == DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError 12309 } 12310 12311 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 12312 return []gotenobject.FieldPath{fp} 12313 } 12314 12315 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusProxyConfigStatus_FieldPathValue { 12316 switch fp.selector { 12317 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12318 return &DeviceStatusProxyConfigStatus_FieldTerminalPathValue{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, value: value.(Device_Status_ProxyConfigStatus_ProxyConfigSource)} 12319 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12320 return &DeviceStatusProxyConfigStatus_FieldTerminalPathValue{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, value: value.(Device_Status_ProxyConfigStatus_ProxyConfigSource)} 12321 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12322 return &DeviceStatusProxyConfigStatus_FieldTerminalPathValue{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, value: value.(string)} 12323 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12324 return &DeviceStatusProxyConfigStatus_FieldTerminalPathValue{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, value: value.(*Device_Spec_ProxyConfig)} 12325 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12326 return &DeviceStatusProxyConfigStatus_FieldTerminalPathValue{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, value: value.(*Device_Spec_ProxyConfig)} 12327 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12328 return &DeviceStatusProxyConfigStatus_FieldTerminalPathValue{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, value: value.(*Device_Spec_ProxyConfig)} 12329 default: 12330 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12331 } 12332 } 12333 12334 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 12335 return fp.WithIValue(value) 12336 } 12337 12338 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusProxyConfigStatus_FieldPathArrayOfValues { 12339 fpaov := &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp} 12340 switch fp.selector { 12341 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12342 return &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, values: values.([]Device_Status_ProxyConfigStatus_ProxyConfigSource)} 12343 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12344 return &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, values: values.([]Device_Status_ProxyConfigStatus_ProxyConfigSource)} 12345 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12346 return &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, values: values.([]string)} 12347 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12348 return &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, values: values.([]*Device_Spec_ProxyConfig)} 12349 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12350 return &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, values: values.([]*Device_Spec_ProxyConfig)} 12351 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12352 return &DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues{DeviceStatusProxyConfigStatus_FieldTerminalPath: *fp, values: values.([]*Device_Spec_ProxyConfig)} 12353 default: 12354 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12355 } 12356 return fpaov 12357 } 12358 12359 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 12360 return fp.WithIArrayOfValues(values) 12361 } 12362 12363 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusProxyConfigStatus_FieldPathArrayItemValue { 12364 switch fp.selector { 12365 default: 12366 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fp.selector)) 12367 } 12368 } 12369 12370 func (fp *DeviceStatusProxyConfigStatus_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 12371 return fp.WithIArrayItemValue(value) 12372 } 12373 12374 type DeviceStatusProxyConfigStatus_FieldSubPath struct { 12375 selector DeviceStatusProxyConfigStatus_FieldPathSelector 12376 subPath gotenobject.FieldPath 12377 } 12378 12379 var _ DeviceStatusProxyConfigStatus_FieldPath = (*DeviceStatusProxyConfigStatus_FieldSubPath)(nil) 12380 12381 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) Selector() DeviceStatusProxyConfigStatus_FieldPathSelector { 12382 return fps.selector 12383 } 12384 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) AsDefaultConfigSubPath() (DeviceSpecProxyConfig_FieldPath, bool) { 12385 res, ok := fps.subPath.(DeviceSpecProxyConfig_FieldPath) 12386 return res, ok 12387 } 12388 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) AsActiveConfigSubPath() (DeviceSpecProxyConfig_FieldPath, bool) { 12389 res, ok := fps.subPath.(DeviceSpecProxyConfig_FieldPath) 12390 return res, ok 12391 } 12392 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) AsApiConfigSubPath() (DeviceSpecProxyConfig_FieldPath, bool) { 12393 res, ok := fps.subPath.(DeviceSpecProxyConfig_FieldPath) 12394 return res, ok 12395 } 12396 12397 // String returns path representation in proto convention 12398 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) String() string { 12399 return fps.selector.String() + "." + fps.subPath.String() 12400 } 12401 12402 // JSONString returns path representation is JSON convention 12403 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) JSONString() string { 12404 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 12405 } 12406 12407 // Get returns all values pointed by selected field from source Device_Status_ProxyConfigStatus 12408 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) Get(source *Device_Status_ProxyConfigStatus) (values []interface{}) { 12409 switch fps.selector { 12410 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12411 values = append(values, fps.subPath.GetRaw(source.GetDefaultConfig())...) 12412 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12413 values = append(values, fps.subPath.GetRaw(source.GetActiveConfig())...) 12414 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12415 values = append(values, fps.subPath.GetRaw(source.GetApiConfig())...) 12416 default: 12417 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fps.selector)) 12418 } 12419 return 12420 } 12421 12422 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) GetRaw(source proto.Message) []interface{} { 12423 return fps.Get(source.(*Device_Status_ProxyConfigStatus)) 12424 } 12425 12426 // GetSingle returns value of selected field from source Device_Status_ProxyConfigStatus 12427 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) GetSingle(source *Device_Status_ProxyConfigStatus) (interface{}, bool) { 12428 switch fps.selector { 12429 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12430 if source.GetDefaultConfig() == nil { 12431 return nil, false 12432 } 12433 return fps.subPath.GetSingleRaw(source.GetDefaultConfig()) 12434 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12435 if source.GetActiveConfig() == nil { 12436 return nil, false 12437 } 12438 return fps.subPath.GetSingleRaw(source.GetActiveConfig()) 12439 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12440 if source.GetApiConfig() == nil { 12441 return nil, false 12442 } 12443 return fps.subPath.GetSingleRaw(source.GetApiConfig()) 12444 default: 12445 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fps.selector)) 12446 } 12447 } 12448 12449 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 12450 return fps.GetSingle(source.(*Device_Status_ProxyConfigStatus)) 12451 } 12452 12453 // GetDefault returns a default value of the field type 12454 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) GetDefault() interface{} { 12455 return fps.subPath.GetDefault() 12456 } 12457 12458 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) ClearValue(item *Device_Status_ProxyConfigStatus) { 12459 if item != nil { 12460 switch fps.selector { 12461 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12462 fps.subPath.ClearValueRaw(item.DefaultConfig) 12463 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12464 fps.subPath.ClearValueRaw(item.ActiveConfig) 12465 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12466 fps.subPath.ClearValueRaw(item.ApiConfig) 12467 default: 12468 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fps.selector)) 12469 } 12470 } 12471 } 12472 12473 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) ClearValueRaw(item proto.Message) { 12474 fps.ClearValue(item.(*Device_Status_ProxyConfigStatus)) 12475 } 12476 12477 // IsLeaf - whether field path is holds simple value 12478 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) IsLeaf() bool { 12479 return fps.subPath.IsLeaf() 12480 } 12481 12482 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 12483 iPaths := []gotenobject.FieldPath{&DeviceStatusProxyConfigStatus_FieldTerminalPath{selector: fps.selector}} 12484 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 12485 return iPaths 12486 } 12487 12488 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) WithIValue(value interface{}) DeviceStatusProxyConfigStatus_FieldPathValue { 12489 return &DeviceStatusProxyConfigStatus_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 12490 } 12491 12492 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 12493 return fps.WithIValue(value) 12494 } 12495 12496 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusProxyConfigStatus_FieldPathArrayOfValues { 12497 return &DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 12498 } 12499 12500 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 12501 return fps.WithIArrayOfValues(values) 12502 } 12503 12504 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusProxyConfigStatus_FieldPathArrayItemValue { 12505 return &DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 12506 } 12507 12508 func (fps *DeviceStatusProxyConfigStatus_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 12509 return fps.WithIArrayItemValue(value) 12510 } 12511 12512 // DeviceStatusProxyConfigStatus_FieldPathValue allows storing values for ProxyConfigStatus fields according to their type 12513 type DeviceStatusProxyConfigStatus_FieldPathValue interface { 12514 DeviceStatusProxyConfigStatus_FieldPath 12515 gotenobject.FieldPathValue 12516 SetTo(target **Device_Status_ProxyConfigStatus) 12517 CompareWith(*Device_Status_ProxyConfigStatus) (cmp int, comparable bool) 12518 } 12519 12520 func ParseDeviceStatusProxyConfigStatus_FieldPathValue(pathStr, valueStr string) (DeviceStatusProxyConfigStatus_FieldPathValue, error) { 12521 fp, err := ParseDeviceStatusProxyConfigStatus_FieldPath(pathStr) 12522 if err != nil { 12523 return nil, err 12524 } 12525 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 12526 if err != nil { 12527 return nil, status.Errorf(codes.InvalidArgument, "error parsing ProxyConfigStatus field path value from %s: %v", valueStr, err) 12528 } 12529 return fpv.(DeviceStatusProxyConfigStatus_FieldPathValue), nil 12530 } 12531 12532 func MustParseDeviceStatusProxyConfigStatus_FieldPathValue(pathStr, valueStr string) DeviceStatusProxyConfigStatus_FieldPathValue { 12533 fpv, err := ParseDeviceStatusProxyConfigStatus_FieldPathValue(pathStr, valueStr) 12534 if err != nil { 12535 panic(err) 12536 } 12537 return fpv 12538 } 12539 12540 type DeviceStatusProxyConfigStatus_FieldTerminalPathValue struct { 12541 DeviceStatusProxyConfigStatus_FieldTerminalPath 12542 value interface{} 12543 } 12544 12545 var _ DeviceStatusProxyConfigStatus_FieldPathValue = (*DeviceStatusProxyConfigStatus_FieldTerminalPathValue)(nil) 12546 12547 // GetRawValue returns raw value stored under selected path for 'ProxyConfigStatus' as interface{} 12548 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) GetRawValue() interface{} { 12549 return fpv.value 12550 } 12551 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) AsActiveConfigSourceValue() (Device_Status_ProxyConfigStatus_ProxyConfigSource, bool) { 12552 res, ok := fpv.value.(Device_Status_ProxyConfigStatus_ProxyConfigSource) 12553 return res, ok 12554 } 12555 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) AsDesiredConfigSourceValue() (Device_Status_ProxyConfigStatus_ProxyConfigSource, bool) { 12556 res, ok := fpv.value.(Device_Status_ProxyConfigStatus_ProxyConfigSource) 12557 return res, ok 12558 } 12559 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) AsProxyConfigErrorValue() (string, bool) { 12560 res, ok := fpv.value.(string) 12561 return res, ok 12562 } 12563 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) AsDefaultConfigValue() (*Device_Spec_ProxyConfig, bool) { 12564 res, ok := fpv.value.(*Device_Spec_ProxyConfig) 12565 return res, ok 12566 } 12567 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) AsActiveConfigValue() (*Device_Spec_ProxyConfig, bool) { 12568 res, ok := fpv.value.(*Device_Spec_ProxyConfig) 12569 return res, ok 12570 } 12571 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) AsApiConfigValue() (*Device_Spec_ProxyConfig, bool) { 12572 res, ok := fpv.value.(*Device_Spec_ProxyConfig) 12573 return res, ok 12574 } 12575 12576 // SetTo stores value for selected field for object ProxyConfigStatus 12577 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) SetTo(target **Device_Status_ProxyConfigStatus) { 12578 if *target == nil { 12579 *target = new(Device_Status_ProxyConfigStatus) 12580 } 12581 switch fpv.selector { 12582 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12583 (*target).ActiveConfigSource = fpv.value.(Device_Status_ProxyConfigStatus_ProxyConfigSource) 12584 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12585 (*target).DesiredConfigSource = fpv.value.(Device_Status_ProxyConfigStatus_ProxyConfigSource) 12586 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12587 (*target).ProxyConfigError = fpv.value.(string) 12588 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12589 (*target).DefaultConfig = fpv.value.(*Device_Spec_ProxyConfig) 12590 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12591 (*target).ActiveConfig = fpv.value.(*Device_Spec_ProxyConfig) 12592 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12593 (*target).ApiConfig = fpv.value.(*Device_Spec_ProxyConfig) 12594 default: 12595 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fpv.selector)) 12596 } 12597 } 12598 12599 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) SetToRaw(target proto.Message) { 12600 typedObject := target.(*Device_Status_ProxyConfigStatus) 12601 fpv.SetTo(&typedObject) 12602 } 12603 12604 // CompareWith compares value in the 'DeviceStatusProxyConfigStatus_FieldTerminalPathValue' with the value under path in 'Device_Status_ProxyConfigStatus'. 12605 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) CompareWith(source *Device_Status_ProxyConfigStatus) (int, bool) { 12606 switch fpv.selector { 12607 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12608 leftValue := fpv.value.(Device_Status_ProxyConfigStatus_ProxyConfigSource) 12609 rightValue := source.GetActiveConfigSource() 12610 if (leftValue) == (rightValue) { 12611 return 0, true 12612 } else if (leftValue) < (rightValue) { 12613 return -1, true 12614 } else { 12615 return 1, true 12616 } 12617 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12618 leftValue := fpv.value.(Device_Status_ProxyConfigStatus_ProxyConfigSource) 12619 rightValue := source.GetDesiredConfigSource() 12620 if (leftValue) == (rightValue) { 12621 return 0, true 12622 } else if (leftValue) < (rightValue) { 12623 return -1, true 12624 } else { 12625 return 1, true 12626 } 12627 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12628 leftValue := fpv.value.(string) 12629 rightValue := source.GetProxyConfigError() 12630 if (leftValue) == (rightValue) { 12631 return 0, true 12632 } else if (leftValue) < (rightValue) { 12633 return -1, true 12634 } else { 12635 return 1, true 12636 } 12637 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12638 return 0, false 12639 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12640 return 0, false 12641 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12642 return 0, false 12643 default: 12644 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fpv.selector)) 12645 } 12646 } 12647 12648 func (fpv *DeviceStatusProxyConfigStatus_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 12649 return fpv.CompareWith(source.(*Device_Status_ProxyConfigStatus)) 12650 } 12651 12652 type DeviceStatusProxyConfigStatus_FieldSubPathValue struct { 12653 DeviceStatusProxyConfigStatus_FieldPath 12654 subPathValue gotenobject.FieldPathValue 12655 } 12656 12657 var _ DeviceStatusProxyConfigStatus_FieldPathValue = (*DeviceStatusProxyConfigStatus_FieldSubPathValue)(nil) 12658 12659 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) AsDefaultConfigPathValue() (DeviceSpecProxyConfig_FieldPathValue, bool) { 12660 res, ok := fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue) 12661 return res, ok 12662 } 12663 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) AsActiveConfigPathValue() (DeviceSpecProxyConfig_FieldPathValue, bool) { 12664 res, ok := fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue) 12665 return res, ok 12666 } 12667 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) AsApiConfigPathValue() (DeviceSpecProxyConfig_FieldPathValue, bool) { 12668 res, ok := fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue) 12669 return res, ok 12670 } 12671 12672 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) SetTo(target **Device_Status_ProxyConfigStatus) { 12673 if *target == nil { 12674 *target = new(Device_Status_ProxyConfigStatus) 12675 } 12676 switch fpvs.Selector() { 12677 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12678 fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).SetTo(&(*target).DefaultConfig) 12679 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12680 fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).SetTo(&(*target).ActiveConfig) 12681 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12682 fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).SetTo(&(*target).ApiConfig) 12683 default: 12684 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fpvs.Selector())) 12685 } 12686 } 12687 12688 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) SetToRaw(target proto.Message) { 12689 typedObject := target.(*Device_Status_ProxyConfigStatus) 12690 fpvs.SetTo(&typedObject) 12691 } 12692 12693 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) GetRawValue() interface{} { 12694 return fpvs.subPathValue.GetRawValue() 12695 } 12696 12697 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) CompareWith(source *Device_Status_ProxyConfigStatus) (int, bool) { 12698 switch fpvs.Selector() { 12699 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12700 return fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).CompareWith(source.GetDefaultConfig()) 12701 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12702 return fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).CompareWith(source.GetActiveConfig()) 12703 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12704 return fpvs.subPathValue.(DeviceSpecProxyConfig_FieldPathValue).CompareWith(source.GetApiConfig()) 12705 default: 12706 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fpvs.Selector())) 12707 } 12708 } 12709 12710 func (fpvs *DeviceStatusProxyConfigStatus_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 12711 return fpvs.CompareWith(source.(*Device_Status_ProxyConfigStatus)) 12712 } 12713 12714 // DeviceStatusProxyConfigStatus_FieldPathArrayItemValue allows storing single item in Path-specific values for ProxyConfigStatus according to their type 12715 // Present only for array (repeated) types. 12716 type DeviceStatusProxyConfigStatus_FieldPathArrayItemValue interface { 12717 gotenobject.FieldPathArrayItemValue 12718 DeviceStatusProxyConfigStatus_FieldPath 12719 ContainsValue(*Device_Status_ProxyConfigStatus) bool 12720 } 12721 12722 // ParseDeviceStatusProxyConfigStatus_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 12723 func ParseDeviceStatusProxyConfigStatus_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusProxyConfigStatus_FieldPathArrayItemValue, error) { 12724 fp, err := ParseDeviceStatusProxyConfigStatus_FieldPath(pathStr) 12725 if err != nil { 12726 return nil, err 12727 } 12728 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 12729 if err != nil { 12730 return nil, status.Errorf(codes.InvalidArgument, "error parsing ProxyConfigStatus field path array item value from %s: %v", valueStr, err) 12731 } 12732 return fpaiv.(DeviceStatusProxyConfigStatus_FieldPathArrayItemValue), nil 12733 } 12734 12735 func MustParseDeviceStatusProxyConfigStatus_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusProxyConfigStatus_FieldPathArrayItemValue { 12736 fpaiv, err := ParseDeviceStatusProxyConfigStatus_FieldPathArrayItemValue(pathStr, valueStr) 12737 if err != nil { 12738 panic(err) 12739 } 12740 return fpaiv 12741 } 12742 12743 type DeviceStatusProxyConfigStatus_FieldTerminalPathArrayItemValue struct { 12744 DeviceStatusProxyConfigStatus_FieldTerminalPath 12745 value interface{} 12746 } 12747 12748 var _ DeviceStatusProxyConfigStatus_FieldPathArrayItemValue = (*DeviceStatusProxyConfigStatus_FieldTerminalPathArrayItemValue)(nil) 12749 12750 // GetRawValue returns stored element value for array in object Device_Status_ProxyConfigStatus as interface{} 12751 func (fpaiv *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 12752 return fpaiv.value 12753 } 12754 12755 func (fpaiv *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_ProxyConfigStatus) (interface{}, bool) { 12756 return nil, false 12757 } 12758 12759 func (fpaiv *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 12760 return fpaiv.GetSingle(source.(*Device_Status_ProxyConfigStatus)) 12761 } 12762 12763 // Contains returns a boolean indicating if value that is being held is present in given 'ProxyConfigStatus' 12764 func (fpaiv *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_ProxyConfigStatus) bool { 12765 slice := fpaiv.DeviceStatusProxyConfigStatus_FieldTerminalPath.Get(source) 12766 for _, v := range slice { 12767 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 12768 if proto.Equal(asProtoMsg, v.(proto.Message)) { 12769 return true 12770 } 12771 } else if reflect.DeepEqual(v, fpaiv.value) { 12772 return true 12773 } 12774 } 12775 return false 12776 } 12777 12778 type DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue struct { 12779 DeviceStatusProxyConfigStatus_FieldPath 12780 subPathItemValue gotenobject.FieldPathArrayItemValue 12781 } 12782 12783 // GetRawValue returns stored array item value 12784 func (fpaivs *DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 12785 return fpaivs.subPathItemValue.GetRawItemValue() 12786 } 12787 func (fpaivs *DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue) AsDefaultConfigPathItemValue() (DeviceSpecProxyConfig_FieldPathArrayItemValue, bool) { 12788 res, ok := fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue) 12789 return res, ok 12790 } 12791 func (fpaivs *DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue) AsActiveConfigPathItemValue() (DeviceSpecProxyConfig_FieldPathArrayItemValue, bool) { 12792 res, ok := fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue) 12793 return res, ok 12794 } 12795 func (fpaivs *DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue) AsApiConfigPathItemValue() (DeviceSpecProxyConfig_FieldPathArrayItemValue, bool) { 12796 res, ok := fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue) 12797 return res, ok 12798 } 12799 12800 // Contains returns a boolean indicating if value that is being held is present in given 'ProxyConfigStatus' 12801 func (fpaivs *DeviceStatusProxyConfigStatus_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_ProxyConfigStatus) bool { 12802 switch fpaivs.Selector() { 12803 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12804 return fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue).ContainsValue(source.GetDefaultConfig()) 12805 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12806 return fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue).ContainsValue(source.GetActiveConfig()) 12807 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12808 return fpaivs.subPathItemValue.(DeviceSpecProxyConfig_FieldPathArrayItemValue).ContainsValue(source.GetApiConfig()) 12809 default: 12810 panic(fmt.Sprintf("Invalid selector for Device_Status_ProxyConfigStatus: %d", fpaivs.Selector())) 12811 } 12812 } 12813 12814 // DeviceStatusProxyConfigStatus_FieldPathArrayOfValues allows storing slice of values for ProxyConfigStatus fields according to their type 12815 type DeviceStatusProxyConfigStatus_FieldPathArrayOfValues interface { 12816 gotenobject.FieldPathArrayOfValues 12817 DeviceStatusProxyConfigStatus_FieldPath 12818 } 12819 12820 func ParseDeviceStatusProxyConfigStatus_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusProxyConfigStatus_FieldPathArrayOfValues, error) { 12821 fp, err := ParseDeviceStatusProxyConfigStatus_FieldPath(pathStr) 12822 if err != nil { 12823 return nil, err 12824 } 12825 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 12826 if err != nil { 12827 return nil, status.Errorf(codes.InvalidArgument, "error parsing ProxyConfigStatus field path array of values from %s: %v", valuesStr, err) 12828 } 12829 return fpaov.(DeviceStatusProxyConfigStatus_FieldPathArrayOfValues), nil 12830 } 12831 12832 func MustParseDeviceStatusProxyConfigStatus_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusProxyConfigStatus_FieldPathArrayOfValues { 12833 fpaov, err := ParseDeviceStatusProxyConfigStatus_FieldPathArrayOfValues(pathStr, valuesStr) 12834 if err != nil { 12835 panic(err) 12836 } 12837 return fpaov 12838 } 12839 12840 type DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues struct { 12841 DeviceStatusProxyConfigStatus_FieldTerminalPath 12842 values interface{} 12843 } 12844 12845 var _ DeviceStatusProxyConfigStatus_FieldPathArrayOfValues = (*DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues)(nil) 12846 12847 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 12848 switch fpaov.selector { 12849 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfigSource: 12850 for _, v := range fpaov.values.([]Device_Status_ProxyConfigStatus_ProxyConfigSource) { 12851 values = append(values, v) 12852 } 12853 case DeviceStatusProxyConfigStatus_FieldPathSelectorDesiredConfigSource: 12854 for _, v := range fpaov.values.([]Device_Status_ProxyConfigStatus_ProxyConfigSource) { 12855 values = append(values, v) 12856 } 12857 case DeviceStatusProxyConfigStatus_FieldPathSelectorProxyConfigError: 12858 for _, v := range fpaov.values.([]string) { 12859 values = append(values, v) 12860 } 12861 case DeviceStatusProxyConfigStatus_FieldPathSelectorDefaultConfig: 12862 for _, v := range fpaov.values.([]*Device_Spec_ProxyConfig) { 12863 values = append(values, v) 12864 } 12865 case DeviceStatusProxyConfigStatus_FieldPathSelectorActiveConfig: 12866 for _, v := range fpaov.values.([]*Device_Spec_ProxyConfig) { 12867 values = append(values, v) 12868 } 12869 case DeviceStatusProxyConfigStatus_FieldPathSelectorApiConfig: 12870 for _, v := range fpaov.values.([]*Device_Spec_ProxyConfig) { 12871 values = append(values, v) 12872 } 12873 } 12874 return 12875 } 12876 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) AsActiveConfigSourceArrayOfValues() ([]Device_Status_ProxyConfigStatus_ProxyConfigSource, bool) { 12877 res, ok := fpaov.values.([]Device_Status_ProxyConfigStatus_ProxyConfigSource) 12878 return res, ok 12879 } 12880 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) AsDesiredConfigSourceArrayOfValues() ([]Device_Status_ProxyConfigStatus_ProxyConfigSource, bool) { 12881 res, ok := fpaov.values.([]Device_Status_ProxyConfigStatus_ProxyConfigSource) 12882 return res, ok 12883 } 12884 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) AsProxyConfigErrorArrayOfValues() ([]string, bool) { 12885 res, ok := fpaov.values.([]string) 12886 return res, ok 12887 } 12888 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) AsDefaultConfigArrayOfValues() ([]*Device_Spec_ProxyConfig, bool) { 12889 res, ok := fpaov.values.([]*Device_Spec_ProxyConfig) 12890 return res, ok 12891 } 12892 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) AsActiveConfigArrayOfValues() ([]*Device_Spec_ProxyConfig, bool) { 12893 res, ok := fpaov.values.([]*Device_Spec_ProxyConfig) 12894 return res, ok 12895 } 12896 func (fpaov *DeviceStatusProxyConfigStatus_FieldTerminalPathArrayOfValues) AsApiConfigArrayOfValues() ([]*Device_Spec_ProxyConfig, bool) { 12897 res, ok := fpaov.values.([]*Device_Spec_ProxyConfig) 12898 return res, ok 12899 } 12900 12901 type DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues struct { 12902 DeviceStatusProxyConfigStatus_FieldPath 12903 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 12904 } 12905 12906 var _ DeviceStatusProxyConfigStatus_FieldPathArrayOfValues = (*DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues)(nil) 12907 12908 func (fpsaov *DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 12909 return fpsaov.subPathArrayOfValues.GetRawValues() 12910 } 12911 func (fpsaov *DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues) AsDefaultConfigPathArrayOfValues() (DeviceSpecProxyConfig_FieldPathArrayOfValues, bool) { 12912 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecProxyConfig_FieldPathArrayOfValues) 12913 return res, ok 12914 } 12915 func (fpsaov *DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues) AsActiveConfigPathArrayOfValues() (DeviceSpecProxyConfig_FieldPathArrayOfValues, bool) { 12916 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecProxyConfig_FieldPathArrayOfValues) 12917 return res, ok 12918 } 12919 func (fpsaov *DeviceStatusProxyConfigStatus_FieldSubPathArrayOfValues) AsApiConfigPathArrayOfValues() (DeviceSpecProxyConfig_FieldPathArrayOfValues, bool) { 12920 res, ok := fpsaov.subPathArrayOfValues.(DeviceSpecProxyConfig_FieldPathArrayOfValues) 12921 return res, ok 12922 } 12923 12924 // FieldPath provides implementation to handle 12925 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 12926 type DeviceStatusDeviceInfo_FieldPath interface { 12927 gotenobject.FieldPath 12928 Selector() DeviceStatusDeviceInfo_FieldPathSelector 12929 Get(source *Device_Status_DeviceInfo) []interface{} 12930 GetSingle(source *Device_Status_DeviceInfo) (interface{}, bool) 12931 ClearValue(item *Device_Status_DeviceInfo) 12932 12933 // Those methods build corresponding DeviceStatusDeviceInfo_FieldPathValue 12934 // (or array of values) and holds passed value. Panics if injected type is incorrect. 12935 WithIValue(value interface{}) DeviceStatusDeviceInfo_FieldPathValue 12936 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfo_FieldPathArrayOfValues 12937 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfo_FieldPathArrayItemValue 12938 } 12939 12940 type DeviceStatusDeviceInfo_FieldPathSelector int32 12941 12942 const ( 12943 DeviceStatusDeviceInfo_FieldPathSelectorArchitecture DeviceStatusDeviceInfo_FieldPathSelector = 0 12944 DeviceStatusDeviceInfo_FieldPathSelectorHardware DeviceStatusDeviceInfo_FieldPathSelector = 1 12945 DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem DeviceStatusDeviceInfo_FieldPathSelector = 2 12946 DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion DeviceStatusDeviceInfo_FieldPathSelector = 3 12947 DeviceStatusDeviceInfo_FieldPathSelectorOsImage DeviceStatusDeviceInfo_FieldPathSelector = 4 12948 DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion DeviceStatusDeviceInfo_FieldPathSelector = 5 12949 DeviceStatusDeviceInfo_FieldPathSelectorOsVersion DeviceStatusDeviceInfo_FieldPathSelector = 6 12950 DeviceStatusDeviceInfo_FieldPathSelectorDriver DeviceStatusDeviceInfo_FieldPathSelector = 7 12951 DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation DeviceStatusDeviceInfo_FieldPathSelector = 8 12952 DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces DeviceStatusDeviceInfo_FieldPathSelector = 9 12953 DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo DeviceStatusDeviceInfo_FieldPathSelector = 10 12954 ) 12955 12956 func (s DeviceStatusDeviceInfo_FieldPathSelector) String() string { 12957 switch s { 12958 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 12959 return "architecture" 12960 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 12961 return "hardware" 12962 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 12963 return "operating_system" 12964 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 12965 return "kernel_version" 12966 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 12967 return "os_image" 12968 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 12969 return "container_runtime_version" 12970 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 12971 return "os_version" 12972 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 12973 return "driver" 12974 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 12975 return "hardware_information" 12976 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 12977 return "network_interfaces" 12978 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 12979 return "control_plane_interface_info" 12980 default: 12981 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", s)) 12982 } 12983 } 12984 12985 func BuildDeviceStatusDeviceInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfo_FieldPath, error) { 12986 if len(fp) == 0 { 12987 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo") 12988 } 12989 if len(fp) == 1 { 12990 switch fp[0] { 12991 case "architecture": 12992 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorArchitecture}, nil 12993 case "hardware": 12994 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorHardware}, nil 12995 case "operating_system", "operatingSystem", "operating-system": 12996 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem}, nil 12997 case "kernel_version", "kernelVersion", "kernel-version": 12998 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion}, nil 12999 case "os_image", "osImage", "os-image": 13000 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorOsImage}, nil 13001 case "container_runtime_version", "containerRuntimeVersion", "container-runtime-version": 13002 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion}, nil 13003 case "os_version", "osVersion", "os-version": 13004 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorOsVersion}, nil 13005 case "driver": 13006 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorDriver}, nil 13007 case "hardware_information", "hardwareInformation", "hardware-information": 13008 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation}, nil 13009 case "network_interfaces", "networkInterfaces", "network-interfaces": 13010 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces}, nil 13011 case "control_plane_interface_info", "controlPlaneInterfaceInfo", "control-plane-interface-info": 13012 return &DeviceStatusDeviceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo}, nil 13013 } 13014 } else { 13015 switch fp[0] { 13016 case "hardware_information", "hardwareInformation", "hardware-information": 13017 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformation_FieldPath(fp[1:]); err != nil { 13018 return nil, err 13019 } else { 13020 return &DeviceStatusDeviceInfo_FieldSubPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation, subPath: subpath}, nil 13021 } 13022 case "control_plane_interface_info", "controlPlaneInterfaceInfo", "control-plane-interface-info": 13023 if subpath, err := BuildDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(fp[1:]); err != nil { 13024 return nil, err 13025 } else { 13026 return &DeviceStatusDeviceInfo_FieldSubPath{selector: DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo, subPath: subpath}, nil 13027 } 13028 case "network_interfaces", "networkInterfaces", "network-interfaces": 13029 if len(fp) > 2 { 13030 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object Device_Status_DeviceInfo)", fp) 13031 } 13032 return &DeviceStatusDeviceInfo_FieldPathMap{selector: DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces, key: fp[1]}, nil 13033 } 13034 } 13035 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo", fp) 13036 } 13037 13038 func ParseDeviceStatusDeviceInfo_FieldPath(rawField string) (DeviceStatusDeviceInfo_FieldPath, error) { 13039 fp, err := gotenobject.ParseRawFieldPath(rawField) 13040 if err != nil { 13041 return nil, err 13042 } 13043 return BuildDeviceStatusDeviceInfo_FieldPath(fp) 13044 } 13045 13046 func MustParseDeviceStatusDeviceInfo_FieldPath(rawField string) DeviceStatusDeviceInfo_FieldPath { 13047 fp, err := ParseDeviceStatusDeviceInfo_FieldPath(rawField) 13048 if err != nil { 13049 panic(err) 13050 } 13051 return fp 13052 } 13053 13054 type DeviceStatusDeviceInfo_FieldTerminalPath struct { 13055 selector DeviceStatusDeviceInfo_FieldPathSelector 13056 } 13057 13058 var _ DeviceStatusDeviceInfo_FieldPath = (*DeviceStatusDeviceInfo_FieldTerminalPath)(nil) 13059 13060 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfo_FieldPathSelector { 13061 return fp.selector 13062 } 13063 13064 // String returns path representation in proto convention 13065 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) String() string { 13066 return fp.selector.String() 13067 } 13068 13069 // JSONString returns path representation is JSON convention 13070 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) JSONString() string { 13071 return strcase.ToLowerCamel(fp.String()) 13072 } 13073 13074 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo 13075 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo) (values []interface{}) { 13076 if source != nil { 13077 switch fp.selector { 13078 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13079 values = append(values, source.Architecture) 13080 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13081 values = append(values, source.Hardware) 13082 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13083 values = append(values, source.OperatingSystem) 13084 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13085 values = append(values, source.KernelVersion) 13086 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13087 values = append(values, source.OsImage) 13088 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13089 values = append(values, source.ContainerRuntimeVersion) 13090 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13091 values = append(values, source.OsVersion) 13092 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13093 values = append(values, source.Driver) 13094 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13095 if source.HardwareInformation != nil { 13096 values = append(values, source.HardwareInformation) 13097 } 13098 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13099 if source.NetworkInterfaces != nil { 13100 values = append(values, source.NetworkInterfaces) 13101 } 13102 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13103 if source.ControlPlaneInterfaceInfo != nil { 13104 values = append(values, source.ControlPlaneInterfaceInfo) 13105 } 13106 default: 13107 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13108 } 13109 } 13110 return 13111 } 13112 13113 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 13114 return fp.Get(source.(*Device_Status_DeviceInfo)) 13115 } 13116 13117 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo 13118 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo) (interface{}, bool) { 13119 switch fp.selector { 13120 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13121 return source.GetArchitecture(), source != nil 13122 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13123 return source.GetHardware(), source != nil 13124 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13125 return source.GetOperatingSystem(), source != nil 13126 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13127 return source.GetKernelVersion(), source != nil 13128 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13129 return source.GetOsImage(), source != nil 13130 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13131 return source.GetContainerRuntimeVersion(), source != nil 13132 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13133 return source.GetOsVersion(), source != nil 13134 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13135 return source.GetDriver(), source != nil 13136 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13137 res := source.GetHardwareInformation() 13138 return res, res != nil 13139 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13140 res := source.GetNetworkInterfaces() 13141 return res, res != nil 13142 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13143 res := source.GetControlPlaneInterfaceInfo() 13144 return res, res != nil 13145 default: 13146 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13147 } 13148 } 13149 13150 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 13151 return fp.GetSingle(source.(*Device_Status_DeviceInfo)) 13152 } 13153 13154 // GetDefault returns a default value of the field type 13155 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) GetDefault() interface{} { 13156 switch fp.selector { 13157 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13158 return "" 13159 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13160 return "" 13161 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13162 return "" 13163 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13164 return "" 13165 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13166 return "" 13167 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13168 return "" 13169 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13170 return "" 13171 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13172 return "" 13173 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13174 return (*Device_Status_DeviceInfo_HardwareInformation)(nil) 13175 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13176 return (map[string]*Device_Status_DeviceInfo_NetworkInterface)(nil) 13177 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13178 return (*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)(nil) 13179 default: 13180 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13181 } 13182 } 13183 13184 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo) { 13185 if item != nil { 13186 switch fp.selector { 13187 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13188 item.Architecture = "" 13189 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13190 item.Hardware = "" 13191 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13192 item.OperatingSystem = "" 13193 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13194 item.KernelVersion = "" 13195 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13196 item.OsImage = "" 13197 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13198 item.ContainerRuntimeVersion = "" 13199 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13200 item.OsVersion = "" 13201 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13202 item.Driver = "" 13203 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13204 item.HardwareInformation = nil 13205 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13206 item.NetworkInterfaces = nil 13207 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13208 item.ControlPlaneInterfaceInfo = nil 13209 default: 13210 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13211 } 13212 } 13213 } 13214 13215 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 13216 fp.ClearValue(item.(*Device_Status_DeviceInfo)) 13217 } 13218 13219 // IsLeaf - whether field path is holds simple value 13220 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) IsLeaf() bool { 13221 return fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorArchitecture || 13222 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorHardware || 13223 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem || 13224 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion || 13225 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorOsImage || 13226 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion || 13227 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorOsVersion || 13228 fp.selector == DeviceStatusDeviceInfo_FieldPathSelectorDriver 13229 } 13230 13231 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 13232 return []gotenobject.FieldPath{fp} 13233 } 13234 13235 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfo_FieldPathValue { 13236 switch fp.selector { 13237 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13238 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13239 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13240 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13241 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13242 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13243 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13244 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13245 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13246 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13247 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13248 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13249 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13250 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13251 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13252 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(string)} 13253 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13254 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation)} 13255 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13256 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(map[string]*Device_Status_DeviceInfo_NetworkInterface)} 13257 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13258 return &DeviceStatusDeviceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)} 13259 default: 13260 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13261 } 13262 } 13263 13264 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 13265 return fp.WithIValue(value) 13266 } 13267 13268 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfo_FieldPathArrayOfValues { 13269 fpaov := &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp} 13270 switch fp.selector { 13271 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13272 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13273 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13274 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13275 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13276 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13277 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13278 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13279 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13280 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13281 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13282 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13283 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13284 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13285 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13286 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]string)} 13287 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13288 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation)} 13289 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13290 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]map[string]*Device_Status_DeviceInfo_NetworkInterface)} 13291 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13292 return &DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfo_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)} 13293 default: 13294 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13295 } 13296 return fpaov 13297 } 13298 13299 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 13300 return fp.WithIArrayOfValues(values) 13301 } 13302 13303 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfo_FieldPathArrayItemValue { 13304 switch fp.selector { 13305 default: 13306 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fp.selector)) 13307 } 13308 } 13309 13310 func (fp *DeviceStatusDeviceInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 13311 return fp.WithIArrayItemValue(value) 13312 } 13313 13314 // FieldPath for map type with additional Key information 13315 type DeviceStatusDeviceInfo_FieldPathMap struct { 13316 key string 13317 selector DeviceStatusDeviceInfo_FieldPathSelector 13318 } 13319 13320 var _ DeviceStatusDeviceInfo_FieldPath = (*DeviceStatusDeviceInfo_FieldPathMap)(nil) 13321 13322 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) Selector() DeviceStatusDeviceInfo_FieldPathSelector { 13323 return fpm.selector 13324 } 13325 13326 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) Key() string { 13327 return fpm.key 13328 } 13329 13330 // String returns path representation in proto convention 13331 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) String() string { 13332 return fpm.selector.String() + "." + fpm.key 13333 } 13334 13335 // JSONString returns path representation is JSON convention. Note that map keys are not transformed 13336 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) JSONString() string { 13337 return strcase.ToLowerCamel(fpm.selector.String()) + "." + fpm.key 13338 } 13339 13340 // Get returns all values pointed by selected field map key from source Device_Status_DeviceInfo 13341 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) Get(source *Device_Status_DeviceInfo) (values []interface{}) { 13342 switch fpm.selector { 13343 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13344 if value, ok := source.GetNetworkInterfaces()[fpm.key]; ok { 13345 values = append(values, value) 13346 } 13347 default: 13348 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13349 } 13350 return 13351 } 13352 13353 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) GetRaw(source proto.Message) []interface{} { 13354 return fpm.Get(source.(*Device_Status_DeviceInfo)) 13355 } 13356 13357 // GetSingle returns value by selected field map key from source Device_Status_DeviceInfo 13358 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) GetSingle(source *Device_Status_DeviceInfo) (interface{}, bool) { 13359 switch fpm.selector { 13360 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13361 res, ok := source.GetNetworkInterfaces()[fpm.key] 13362 return res, ok 13363 default: 13364 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13365 } 13366 } 13367 13368 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) GetSingleRaw(source proto.Message) (interface{}, bool) { 13369 return fpm.GetSingle(source.(*Device_Status_DeviceInfo)) 13370 } 13371 13372 // GetDefault returns a default value of the field type 13373 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) GetDefault() interface{} { 13374 switch fpm.selector { 13375 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13376 var v *Device_Status_DeviceInfo_NetworkInterface 13377 return v 13378 default: 13379 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13380 } 13381 } 13382 13383 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) ClearValue(item *Device_Status_DeviceInfo) { 13384 if item != nil { 13385 switch fpm.selector { 13386 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13387 delete(item.NetworkInterfaces, fpm.key) 13388 default: 13389 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13390 } 13391 } 13392 } 13393 13394 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) ClearValueRaw(item proto.Message) { 13395 fpm.ClearValue(item.(*Device_Status_DeviceInfo)) 13396 } 13397 13398 // IsLeaf - whether field path is holds simple value 13399 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) IsLeaf() bool { 13400 switch fpm.selector { 13401 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13402 return false 13403 default: 13404 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13405 } 13406 } 13407 13408 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 13409 return []gotenobject.FieldPath{fpm} 13410 } 13411 13412 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) WithIValue(value interface{}) DeviceStatusDeviceInfo_FieldPathValue { 13413 switch fpm.selector { 13414 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13415 return &DeviceStatusDeviceInfo_FieldPathMapValue{DeviceStatusDeviceInfo_FieldPathMap: *fpm, value: value.(*Device_Status_DeviceInfo_NetworkInterface)} 13416 default: 13417 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13418 } 13419 } 13420 13421 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 13422 return fpm.WithIValue(value) 13423 } 13424 13425 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfo_FieldPathArrayOfValues { 13426 switch fpm.selector { 13427 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13428 return &DeviceStatusDeviceInfo_FieldPathMapArrayOfValues{DeviceStatusDeviceInfo_FieldPathMap: *fpm, values: values.([]*Device_Status_DeviceInfo_NetworkInterface)} 13429 default: 13430 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpm.selector)) 13431 } 13432 } 13433 13434 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 13435 return fpm.WithIArrayOfValues(values) 13436 } 13437 13438 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfo_FieldPathArrayItemValue { 13439 panic("Cannot create array item value from map fieldpath") 13440 } 13441 13442 func (fpm *DeviceStatusDeviceInfo_FieldPathMap) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 13443 return fpm.WithIArrayItemValue(value) 13444 } 13445 13446 type DeviceStatusDeviceInfo_FieldSubPath struct { 13447 selector DeviceStatusDeviceInfo_FieldPathSelector 13448 subPath gotenobject.FieldPath 13449 } 13450 13451 var _ DeviceStatusDeviceInfo_FieldPath = (*DeviceStatusDeviceInfo_FieldSubPath)(nil) 13452 13453 func (fps *DeviceStatusDeviceInfo_FieldSubPath) Selector() DeviceStatusDeviceInfo_FieldPathSelector { 13454 return fps.selector 13455 } 13456 func (fps *DeviceStatusDeviceInfo_FieldSubPath) AsHardwareInformationSubPath() (DeviceStatusDeviceInfoHardwareInformation_FieldPath, bool) { 13457 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformation_FieldPath) 13458 return res, ok 13459 } 13460 func (fps *DeviceStatusDeviceInfo_FieldSubPath) AsControlPlaneInterfaceInfoSubPath() (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath, bool) { 13461 res, ok := fps.subPath.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath) 13462 return res, ok 13463 } 13464 13465 // String returns path representation in proto convention 13466 func (fps *DeviceStatusDeviceInfo_FieldSubPath) String() string { 13467 return fps.selector.String() + "." + fps.subPath.String() 13468 } 13469 13470 // JSONString returns path representation is JSON convention 13471 func (fps *DeviceStatusDeviceInfo_FieldSubPath) JSONString() string { 13472 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 13473 } 13474 13475 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo 13476 func (fps *DeviceStatusDeviceInfo_FieldSubPath) Get(source *Device_Status_DeviceInfo) (values []interface{}) { 13477 switch fps.selector { 13478 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13479 values = append(values, fps.subPath.GetRaw(source.GetHardwareInformation())...) 13480 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13481 values = append(values, fps.subPath.GetRaw(source.GetControlPlaneInterfaceInfo())...) 13482 default: 13483 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fps.selector)) 13484 } 13485 return 13486 } 13487 13488 func (fps *DeviceStatusDeviceInfo_FieldSubPath) GetRaw(source proto.Message) []interface{} { 13489 return fps.Get(source.(*Device_Status_DeviceInfo)) 13490 } 13491 13492 // GetSingle returns value of selected field from source Device_Status_DeviceInfo 13493 func (fps *DeviceStatusDeviceInfo_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo) (interface{}, bool) { 13494 switch fps.selector { 13495 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13496 if source.GetHardwareInformation() == nil { 13497 return nil, false 13498 } 13499 return fps.subPath.GetSingleRaw(source.GetHardwareInformation()) 13500 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13501 if source.GetControlPlaneInterfaceInfo() == nil { 13502 return nil, false 13503 } 13504 return fps.subPath.GetSingleRaw(source.GetControlPlaneInterfaceInfo()) 13505 default: 13506 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fps.selector)) 13507 } 13508 } 13509 13510 func (fps *DeviceStatusDeviceInfo_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 13511 return fps.GetSingle(source.(*Device_Status_DeviceInfo)) 13512 } 13513 13514 // GetDefault returns a default value of the field type 13515 func (fps *DeviceStatusDeviceInfo_FieldSubPath) GetDefault() interface{} { 13516 return fps.subPath.GetDefault() 13517 } 13518 13519 func (fps *DeviceStatusDeviceInfo_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo) { 13520 if item != nil { 13521 switch fps.selector { 13522 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13523 fps.subPath.ClearValueRaw(item.HardwareInformation) 13524 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13525 fps.subPath.ClearValueRaw(item.ControlPlaneInterfaceInfo) 13526 default: 13527 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fps.selector)) 13528 } 13529 } 13530 } 13531 13532 func (fps *DeviceStatusDeviceInfo_FieldSubPath) ClearValueRaw(item proto.Message) { 13533 fps.ClearValue(item.(*Device_Status_DeviceInfo)) 13534 } 13535 13536 // IsLeaf - whether field path is holds simple value 13537 func (fps *DeviceStatusDeviceInfo_FieldSubPath) IsLeaf() bool { 13538 return fps.subPath.IsLeaf() 13539 } 13540 13541 func (fps *DeviceStatusDeviceInfo_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 13542 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfo_FieldTerminalPath{selector: fps.selector}} 13543 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 13544 return iPaths 13545 } 13546 13547 func (fps *DeviceStatusDeviceInfo_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfo_FieldPathValue { 13548 return &DeviceStatusDeviceInfo_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 13549 } 13550 13551 func (fps *DeviceStatusDeviceInfo_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 13552 return fps.WithIValue(value) 13553 } 13554 13555 func (fps *DeviceStatusDeviceInfo_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfo_FieldPathArrayOfValues { 13556 return &DeviceStatusDeviceInfo_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 13557 } 13558 13559 func (fps *DeviceStatusDeviceInfo_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 13560 return fps.WithIArrayOfValues(values) 13561 } 13562 13563 func (fps *DeviceStatusDeviceInfo_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfo_FieldPathArrayItemValue { 13564 return &DeviceStatusDeviceInfo_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 13565 } 13566 13567 func (fps *DeviceStatusDeviceInfo_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 13568 return fps.WithIArrayItemValue(value) 13569 } 13570 13571 // DeviceStatusDeviceInfo_FieldPathValue allows storing values for DeviceInfo fields according to their type 13572 type DeviceStatusDeviceInfo_FieldPathValue interface { 13573 DeviceStatusDeviceInfo_FieldPath 13574 gotenobject.FieldPathValue 13575 SetTo(target **Device_Status_DeviceInfo) 13576 CompareWith(*Device_Status_DeviceInfo) (cmp int, comparable bool) 13577 } 13578 13579 func ParseDeviceStatusDeviceInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfo_FieldPathValue, error) { 13580 fp, err := ParseDeviceStatusDeviceInfo_FieldPath(pathStr) 13581 if err != nil { 13582 return nil, err 13583 } 13584 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 13585 if err != nil { 13586 return nil, status.Errorf(codes.InvalidArgument, "error parsing DeviceInfo field path value from %s: %v", valueStr, err) 13587 } 13588 return fpv.(DeviceStatusDeviceInfo_FieldPathValue), nil 13589 } 13590 13591 func MustParseDeviceStatusDeviceInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfo_FieldPathValue { 13592 fpv, err := ParseDeviceStatusDeviceInfo_FieldPathValue(pathStr, valueStr) 13593 if err != nil { 13594 panic(err) 13595 } 13596 return fpv 13597 } 13598 13599 type DeviceStatusDeviceInfo_FieldTerminalPathValue struct { 13600 DeviceStatusDeviceInfo_FieldTerminalPath 13601 value interface{} 13602 } 13603 13604 var _ DeviceStatusDeviceInfo_FieldPathValue = (*DeviceStatusDeviceInfo_FieldTerminalPathValue)(nil) 13605 13606 // GetRawValue returns raw value stored under selected path for 'DeviceInfo' as interface{} 13607 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) GetRawValue() interface{} { 13608 return fpv.value 13609 } 13610 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsArchitectureValue() (string, bool) { 13611 res, ok := fpv.value.(string) 13612 return res, ok 13613 } 13614 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsHardwareValue() (string, bool) { 13615 res, ok := fpv.value.(string) 13616 return res, ok 13617 } 13618 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsOperatingSystemValue() (string, bool) { 13619 res, ok := fpv.value.(string) 13620 return res, ok 13621 } 13622 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsKernelVersionValue() (string, bool) { 13623 res, ok := fpv.value.(string) 13624 return res, ok 13625 } 13626 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsOsImageValue() (string, bool) { 13627 res, ok := fpv.value.(string) 13628 return res, ok 13629 } 13630 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsContainerRuntimeVersionValue() (string, bool) { 13631 res, ok := fpv.value.(string) 13632 return res, ok 13633 } 13634 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsOsVersionValue() (string, bool) { 13635 res, ok := fpv.value.(string) 13636 return res, ok 13637 } 13638 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsDriverValue() (string, bool) { 13639 res, ok := fpv.value.(string) 13640 return res, ok 13641 } 13642 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsHardwareInformationValue() (*Device_Status_DeviceInfo_HardwareInformation, bool) { 13643 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation) 13644 return res, ok 13645 } 13646 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsNetworkInterfacesValue() (map[string]*Device_Status_DeviceInfo_NetworkInterface, bool) { 13647 res, ok := fpv.value.(map[string]*Device_Status_DeviceInfo_NetworkInterface) 13648 return res, ok 13649 } 13650 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) AsControlPlaneInterfaceInfoValue() (*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo, bool) { 13651 res, ok := fpv.value.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 13652 return res, ok 13653 } 13654 13655 // SetTo stores value for selected field for object DeviceInfo 13656 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo) { 13657 if *target == nil { 13658 *target = new(Device_Status_DeviceInfo) 13659 } 13660 switch fpv.selector { 13661 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13662 (*target).Architecture = fpv.value.(string) 13663 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13664 (*target).Hardware = fpv.value.(string) 13665 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13666 (*target).OperatingSystem = fpv.value.(string) 13667 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13668 (*target).KernelVersion = fpv.value.(string) 13669 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13670 (*target).OsImage = fpv.value.(string) 13671 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13672 (*target).ContainerRuntimeVersion = fpv.value.(string) 13673 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13674 (*target).OsVersion = fpv.value.(string) 13675 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13676 (*target).Driver = fpv.value.(string) 13677 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13678 (*target).HardwareInformation = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation) 13679 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13680 (*target).NetworkInterfaces = fpv.value.(map[string]*Device_Status_DeviceInfo_NetworkInterface) 13681 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13682 (*target).ControlPlaneInterfaceInfo = fpv.value.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 13683 default: 13684 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpv.selector)) 13685 } 13686 } 13687 13688 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 13689 typedObject := target.(*Device_Status_DeviceInfo) 13690 fpv.SetTo(&typedObject) 13691 } 13692 13693 // CompareWith compares value in the 'DeviceStatusDeviceInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo'. 13694 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo) (int, bool) { 13695 switch fpv.selector { 13696 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 13697 leftValue := fpv.value.(string) 13698 rightValue := source.GetArchitecture() 13699 if (leftValue) == (rightValue) { 13700 return 0, true 13701 } else if (leftValue) < (rightValue) { 13702 return -1, true 13703 } else { 13704 return 1, true 13705 } 13706 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 13707 leftValue := fpv.value.(string) 13708 rightValue := source.GetHardware() 13709 if (leftValue) == (rightValue) { 13710 return 0, true 13711 } else if (leftValue) < (rightValue) { 13712 return -1, true 13713 } else { 13714 return 1, true 13715 } 13716 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 13717 leftValue := fpv.value.(string) 13718 rightValue := source.GetOperatingSystem() 13719 if (leftValue) == (rightValue) { 13720 return 0, true 13721 } else if (leftValue) < (rightValue) { 13722 return -1, true 13723 } else { 13724 return 1, true 13725 } 13726 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 13727 leftValue := fpv.value.(string) 13728 rightValue := source.GetKernelVersion() 13729 if (leftValue) == (rightValue) { 13730 return 0, true 13731 } else if (leftValue) < (rightValue) { 13732 return -1, true 13733 } else { 13734 return 1, true 13735 } 13736 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 13737 leftValue := fpv.value.(string) 13738 rightValue := source.GetOsImage() 13739 if (leftValue) == (rightValue) { 13740 return 0, true 13741 } else if (leftValue) < (rightValue) { 13742 return -1, true 13743 } else { 13744 return 1, true 13745 } 13746 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 13747 leftValue := fpv.value.(string) 13748 rightValue := source.GetContainerRuntimeVersion() 13749 if (leftValue) == (rightValue) { 13750 return 0, true 13751 } else if (leftValue) < (rightValue) { 13752 return -1, true 13753 } else { 13754 return 1, true 13755 } 13756 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 13757 leftValue := fpv.value.(string) 13758 rightValue := source.GetOsVersion() 13759 if (leftValue) == (rightValue) { 13760 return 0, true 13761 } else if (leftValue) < (rightValue) { 13762 return -1, true 13763 } else { 13764 return 1, true 13765 } 13766 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 13767 leftValue := fpv.value.(string) 13768 rightValue := source.GetDriver() 13769 if (leftValue) == (rightValue) { 13770 return 0, true 13771 } else if (leftValue) < (rightValue) { 13772 return -1, true 13773 } else { 13774 return 1, true 13775 } 13776 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13777 return 0, false 13778 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13779 return 0, false 13780 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13781 return 0, false 13782 default: 13783 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpv.selector)) 13784 } 13785 } 13786 13787 func (fpv *DeviceStatusDeviceInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 13788 return fpv.CompareWith(source.(*Device_Status_DeviceInfo)) 13789 } 13790 13791 type DeviceStatusDeviceInfo_FieldPathMapValue struct { 13792 DeviceStatusDeviceInfo_FieldPathMap 13793 value interface{} 13794 } 13795 13796 var _ DeviceStatusDeviceInfo_FieldPathValue = (*DeviceStatusDeviceInfo_FieldPathMapValue)(nil) 13797 13798 // GetValue returns value stored under selected field in DeviceInfo as interface{} 13799 func (fpmv *DeviceStatusDeviceInfo_FieldPathMapValue) GetRawValue() interface{} { 13800 return fpmv.value 13801 } 13802 func (fpmv *DeviceStatusDeviceInfo_FieldPathMapValue) AsNetworkInterfacesElementValue() (*Device_Status_DeviceInfo_NetworkInterface, bool) { 13803 res, ok := fpmv.value.(*Device_Status_DeviceInfo_NetworkInterface) 13804 return res, ok 13805 } 13806 13807 // SetTo stores value for selected field in DeviceInfo 13808 func (fpmv *DeviceStatusDeviceInfo_FieldPathMapValue) SetTo(target **Device_Status_DeviceInfo) { 13809 if *target == nil { 13810 *target = new(Device_Status_DeviceInfo) 13811 } 13812 switch fpmv.selector { 13813 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13814 if (*target).NetworkInterfaces == nil { 13815 (*target).NetworkInterfaces = make(map[string]*Device_Status_DeviceInfo_NetworkInterface) 13816 } 13817 (*target).NetworkInterfaces[fpmv.key] = fpmv.value.(*Device_Status_DeviceInfo_NetworkInterface) 13818 default: 13819 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpmv.selector)) 13820 } 13821 } 13822 13823 func (fpmv *DeviceStatusDeviceInfo_FieldPathMapValue) SetToRaw(target proto.Message) { 13824 typedObject := target.(*Device_Status_DeviceInfo) 13825 fpmv.SetTo(&typedObject) 13826 } 13827 13828 // CompareWith compares value in the 'DeviceStatusDeviceInfo_FieldPathMapValue' with the value under path in 'Device_Status_DeviceInfo'. 13829 func (fpmv *DeviceStatusDeviceInfo_FieldPathMapValue) CompareWith(source *Device_Status_DeviceInfo) (int, bool) { 13830 switch fpmv.selector { 13831 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 13832 return 0, false 13833 default: 13834 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpmv.selector)) 13835 } 13836 } 13837 13838 func (fpmv *DeviceStatusDeviceInfo_FieldPathMapValue) CompareWithRaw(source proto.Message) (int, bool) { 13839 return fpmv.CompareWith(source.(*Device_Status_DeviceInfo)) 13840 } 13841 13842 type DeviceStatusDeviceInfo_FieldSubPathValue struct { 13843 DeviceStatusDeviceInfo_FieldPath 13844 subPathValue gotenobject.FieldPathValue 13845 } 13846 13847 var _ DeviceStatusDeviceInfo_FieldPathValue = (*DeviceStatusDeviceInfo_FieldSubPathValue)(nil) 13848 13849 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) AsHardwareInformationPathValue() (DeviceStatusDeviceInfoHardwareInformation_FieldPathValue, bool) { 13850 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformation_FieldPathValue) 13851 return res, ok 13852 } 13853 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) AsControlPlaneInterfaceInfoPathValue() (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue, bool) { 13854 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue) 13855 return res, ok 13856 } 13857 13858 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo) { 13859 if *target == nil { 13860 *target = new(Device_Status_DeviceInfo) 13861 } 13862 switch fpvs.Selector() { 13863 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13864 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformation_FieldPathValue).SetTo(&(*target).HardwareInformation) 13865 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13866 fpvs.subPathValue.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue).SetTo(&(*target).ControlPlaneInterfaceInfo) 13867 default: 13868 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpvs.Selector())) 13869 } 13870 } 13871 13872 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) SetToRaw(target proto.Message) { 13873 typedObject := target.(*Device_Status_DeviceInfo) 13874 fpvs.SetTo(&typedObject) 13875 } 13876 13877 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) GetRawValue() interface{} { 13878 return fpvs.subPathValue.GetRawValue() 13879 } 13880 13881 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo) (int, bool) { 13882 switch fpvs.Selector() { 13883 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13884 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformation_FieldPathValue).CompareWith(source.GetHardwareInformation()) 13885 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13886 return fpvs.subPathValue.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue).CompareWith(source.GetControlPlaneInterfaceInfo()) 13887 default: 13888 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpvs.Selector())) 13889 } 13890 } 13891 13892 func (fpvs *DeviceStatusDeviceInfo_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 13893 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo)) 13894 } 13895 13896 // DeviceStatusDeviceInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for DeviceInfo according to their type 13897 // Present only for array (repeated) types. 13898 type DeviceStatusDeviceInfo_FieldPathArrayItemValue interface { 13899 gotenobject.FieldPathArrayItemValue 13900 DeviceStatusDeviceInfo_FieldPath 13901 ContainsValue(*Device_Status_DeviceInfo) bool 13902 } 13903 13904 // ParseDeviceStatusDeviceInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 13905 func ParseDeviceStatusDeviceInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfo_FieldPathArrayItemValue, error) { 13906 fp, err := ParseDeviceStatusDeviceInfo_FieldPath(pathStr) 13907 if err != nil { 13908 return nil, err 13909 } 13910 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 13911 if err != nil { 13912 return nil, status.Errorf(codes.InvalidArgument, "error parsing DeviceInfo field path array item value from %s: %v", valueStr, err) 13913 } 13914 return fpaiv.(DeviceStatusDeviceInfo_FieldPathArrayItemValue), nil 13915 } 13916 13917 func MustParseDeviceStatusDeviceInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfo_FieldPathArrayItemValue { 13918 fpaiv, err := ParseDeviceStatusDeviceInfo_FieldPathArrayItemValue(pathStr, valueStr) 13919 if err != nil { 13920 panic(err) 13921 } 13922 return fpaiv 13923 } 13924 13925 type DeviceStatusDeviceInfo_FieldTerminalPathArrayItemValue struct { 13926 DeviceStatusDeviceInfo_FieldTerminalPath 13927 value interface{} 13928 } 13929 13930 var _ DeviceStatusDeviceInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfo_FieldTerminalPathArrayItemValue)(nil) 13931 13932 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo as interface{} 13933 func (fpaiv *DeviceStatusDeviceInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 13934 return fpaiv.value 13935 } 13936 13937 func (fpaiv *DeviceStatusDeviceInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo) (interface{}, bool) { 13938 return nil, false 13939 } 13940 13941 func (fpaiv *DeviceStatusDeviceInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 13942 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo)) 13943 } 13944 13945 // Contains returns a boolean indicating if value that is being held is present in given 'DeviceInfo' 13946 func (fpaiv *DeviceStatusDeviceInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo) bool { 13947 slice := fpaiv.DeviceStatusDeviceInfo_FieldTerminalPath.Get(source) 13948 for _, v := range slice { 13949 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 13950 if proto.Equal(asProtoMsg, v.(proto.Message)) { 13951 return true 13952 } 13953 } else if reflect.DeepEqual(v, fpaiv.value) { 13954 return true 13955 } 13956 } 13957 return false 13958 } 13959 13960 type DeviceStatusDeviceInfo_FieldSubPathArrayItemValue struct { 13961 DeviceStatusDeviceInfo_FieldPath 13962 subPathItemValue gotenobject.FieldPathArrayItemValue 13963 } 13964 13965 // GetRawValue returns stored array item value 13966 func (fpaivs *DeviceStatusDeviceInfo_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 13967 return fpaivs.subPathItemValue.GetRawItemValue() 13968 } 13969 func (fpaivs *DeviceStatusDeviceInfo_FieldSubPathArrayItemValue) AsHardwareInformationPathItemValue() (DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue, bool) { 13970 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue) 13971 return res, ok 13972 } 13973 func (fpaivs *DeviceStatusDeviceInfo_FieldSubPathArrayItemValue) AsControlPlaneInterfaceInfoPathItemValue() (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue, bool) { 13974 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue) 13975 return res, ok 13976 } 13977 13978 // Contains returns a boolean indicating if value that is being held is present in given 'DeviceInfo' 13979 func (fpaivs *DeviceStatusDeviceInfo_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo) bool { 13980 switch fpaivs.Selector() { 13981 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 13982 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue).ContainsValue(source.GetHardwareInformation()) 13983 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 13984 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue).ContainsValue(source.GetControlPlaneInterfaceInfo()) 13985 default: 13986 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo: %d", fpaivs.Selector())) 13987 } 13988 } 13989 13990 // DeviceStatusDeviceInfo_FieldPathArrayOfValues allows storing slice of values for DeviceInfo fields according to their type 13991 type DeviceStatusDeviceInfo_FieldPathArrayOfValues interface { 13992 gotenobject.FieldPathArrayOfValues 13993 DeviceStatusDeviceInfo_FieldPath 13994 } 13995 13996 func ParseDeviceStatusDeviceInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfo_FieldPathArrayOfValues, error) { 13997 fp, err := ParseDeviceStatusDeviceInfo_FieldPath(pathStr) 13998 if err != nil { 13999 return nil, err 14000 } 14001 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 14002 if err != nil { 14003 return nil, status.Errorf(codes.InvalidArgument, "error parsing DeviceInfo field path array of values from %s: %v", valuesStr, err) 14004 } 14005 return fpaov.(DeviceStatusDeviceInfo_FieldPathArrayOfValues), nil 14006 } 14007 14008 func MustParseDeviceStatusDeviceInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfo_FieldPathArrayOfValues { 14009 fpaov, err := ParseDeviceStatusDeviceInfo_FieldPathArrayOfValues(pathStr, valuesStr) 14010 if err != nil { 14011 panic(err) 14012 } 14013 return fpaov 14014 } 14015 14016 type DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues struct { 14017 DeviceStatusDeviceInfo_FieldTerminalPath 14018 values interface{} 14019 } 14020 14021 var _ DeviceStatusDeviceInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues)(nil) 14022 14023 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 14024 switch fpaov.selector { 14025 case DeviceStatusDeviceInfo_FieldPathSelectorArchitecture: 14026 for _, v := range fpaov.values.([]string) { 14027 values = append(values, v) 14028 } 14029 case DeviceStatusDeviceInfo_FieldPathSelectorHardware: 14030 for _, v := range fpaov.values.([]string) { 14031 values = append(values, v) 14032 } 14033 case DeviceStatusDeviceInfo_FieldPathSelectorOperatingSystem: 14034 for _, v := range fpaov.values.([]string) { 14035 values = append(values, v) 14036 } 14037 case DeviceStatusDeviceInfo_FieldPathSelectorKernelVersion: 14038 for _, v := range fpaov.values.([]string) { 14039 values = append(values, v) 14040 } 14041 case DeviceStatusDeviceInfo_FieldPathSelectorOsImage: 14042 for _, v := range fpaov.values.([]string) { 14043 values = append(values, v) 14044 } 14045 case DeviceStatusDeviceInfo_FieldPathSelectorContainerRuntimeVersion: 14046 for _, v := range fpaov.values.([]string) { 14047 values = append(values, v) 14048 } 14049 case DeviceStatusDeviceInfo_FieldPathSelectorOsVersion: 14050 for _, v := range fpaov.values.([]string) { 14051 values = append(values, v) 14052 } 14053 case DeviceStatusDeviceInfo_FieldPathSelectorDriver: 14054 for _, v := range fpaov.values.([]string) { 14055 values = append(values, v) 14056 } 14057 case DeviceStatusDeviceInfo_FieldPathSelectorHardwareInformation: 14058 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation) { 14059 values = append(values, v) 14060 } 14061 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 14062 for _, v := range fpaov.values.([]map[string]*Device_Status_DeviceInfo_NetworkInterface) { 14063 values = append(values, v) 14064 } 14065 case DeviceStatusDeviceInfo_FieldPathSelectorControlPlaneInterfaceInfo: 14066 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) { 14067 values = append(values, v) 14068 } 14069 } 14070 return 14071 } 14072 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsArchitectureArrayOfValues() ([]string, bool) { 14073 res, ok := fpaov.values.([]string) 14074 return res, ok 14075 } 14076 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsHardwareArrayOfValues() ([]string, bool) { 14077 res, ok := fpaov.values.([]string) 14078 return res, ok 14079 } 14080 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsOperatingSystemArrayOfValues() ([]string, bool) { 14081 res, ok := fpaov.values.([]string) 14082 return res, ok 14083 } 14084 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsKernelVersionArrayOfValues() ([]string, bool) { 14085 res, ok := fpaov.values.([]string) 14086 return res, ok 14087 } 14088 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsOsImageArrayOfValues() ([]string, bool) { 14089 res, ok := fpaov.values.([]string) 14090 return res, ok 14091 } 14092 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsContainerRuntimeVersionArrayOfValues() ([]string, bool) { 14093 res, ok := fpaov.values.([]string) 14094 return res, ok 14095 } 14096 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsOsVersionArrayOfValues() ([]string, bool) { 14097 res, ok := fpaov.values.([]string) 14098 return res, ok 14099 } 14100 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsDriverArrayOfValues() ([]string, bool) { 14101 res, ok := fpaov.values.([]string) 14102 return res, ok 14103 } 14104 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsHardwareInformationArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation, bool) { 14105 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation) 14106 return res, ok 14107 } 14108 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsNetworkInterfacesArrayOfValues() ([]map[string]*Device_Status_DeviceInfo_NetworkInterface, bool) { 14109 res, ok := fpaov.values.([]map[string]*Device_Status_DeviceInfo_NetworkInterface) 14110 return res, ok 14111 } 14112 func (fpaov *DeviceStatusDeviceInfo_FieldTerminalPathArrayOfValues) AsControlPlaneInterfaceInfoArrayOfValues() ([]*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo, bool) { 14113 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 14114 return res, ok 14115 } 14116 14117 type DeviceStatusDeviceInfo_FieldPathMapArrayOfValues struct { 14118 DeviceStatusDeviceInfo_FieldPathMap 14119 values interface{} 14120 } 14121 14122 var _ DeviceStatusDeviceInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfo_FieldPathMapArrayOfValues)(nil) 14123 14124 func (fpmaov *DeviceStatusDeviceInfo_FieldPathMapArrayOfValues) GetRawValues() (values []interface{}) { 14125 switch fpmaov.selector { 14126 case DeviceStatusDeviceInfo_FieldPathSelectorNetworkInterfaces: 14127 for _, v := range fpmaov.values.([]*Device_Status_DeviceInfo_NetworkInterface) { 14128 values = append(values, v) 14129 } 14130 } 14131 return 14132 } 14133 func (fpmaov *DeviceStatusDeviceInfo_FieldPathMapArrayOfValues) AsNetworkInterfacesArrayOfElementValues() ([]*Device_Status_DeviceInfo_NetworkInterface, bool) { 14134 res, ok := fpmaov.values.([]*Device_Status_DeviceInfo_NetworkInterface) 14135 return res, ok 14136 } 14137 14138 type DeviceStatusDeviceInfo_FieldSubPathArrayOfValues struct { 14139 DeviceStatusDeviceInfo_FieldPath 14140 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 14141 } 14142 14143 var _ DeviceStatusDeviceInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfo_FieldSubPathArrayOfValues)(nil) 14144 14145 func (fpsaov *DeviceStatusDeviceInfo_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 14146 return fpsaov.subPathArrayOfValues.GetRawValues() 14147 } 14148 func (fpsaov *DeviceStatusDeviceInfo_FieldSubPathArrayOfValues) AsHardwareInformationPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues, bool) { 14149 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues) 14150 return res, ok 14151 } 14152 func (fpsaov *DeviceStatusDeviceInfo_FieldSubPathArrayOfValues) AsControlPlaneInterfaceInfoPathArrayOfValues() (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues, bool) { 14153 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues) 14154 return res, ok 14155 } 14156 14157 // FieldPath provides implementation to handle 14158 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 14159 type DeviceStatusNormalizedAddress_FieldPath interface { 14160 gotenobject.FieldPath 14161 Selector() DeviceStatusNormalizedAddress_FieldPathSelector 14162 Get(source *Device_Status_NormalizedAddress) []interface{} 14163 GetSingle(source *Device_Status_NormalizedAddress) (interface{}, bool) 14164 ClearValue(item *Device_Status_NormalizedAddress) 14165 14166 // Those methods build corresponding DeviceStatusNormalizedAddress_FieldPathValue 14167 // (or array of values) and holds passed value. Panics if injected type is incorrect. 14168 WithIValue(value interface{}) DeviceStatusNormalizedAddress_FieldPathValue 14169 WithIArrayOfValues(values interface{}) DeviceStatusNormalizedAddress_FieldPathArrayOfValues 14170 WithIArrayItemValue(value interface{}) DeviceStatusNormalizedAddress_FieldPathArrayItemValue 14171 } 14172 14173 type DeviceStatusNormalizedAddress_FieldPathSelector int32 14174 14175 const ( 14176 DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode DeviceStatusNormalizedAddress_FieldPathSelector = 0 14177 DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode DeviceStatusNormalizedAddress_FieldPathSelector = 1 14178 DeviceStatusNormalizedAddress_FieldPathSelectorContinent DeviceStatusNormalizedAddress_FieldPathSelector = 2 14179 DeviceStatusNormalizedAddress_FieldPathSelectorContinentId DeviceStatusNormalizedAddress_FieldPathSelector = 3 14180 DeviceStatusNormalizedAddress_FieldPathSelectorCountry DeviceStatusNormalizedAddress_FieldPathSelector = 4 14181 DeviceStatusNormalizedAddress_FieldPathSelectorCountryId DeviceStatusNormalizedAddress_FieldPathSelector = 5 14182 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1 DeviceStatusNormalizedAddress_FieldPathSelector = 6 14183 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id DeviceStatusNormalizedAddress_FieldPathSelector = 7 14184 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2 DeviceStatusNormalizedAddress_FieldPathSelector = 8 14185 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id DeviceStatusNormalizedAddress_FieldPathSelector = 9 14186 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3 DeviceStatusNormalizedAddress_FieldPathSelector = 10 14187 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id DeviceStatusNormalizedAddress_FieldPathSelector = 11 14188 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4 DeviceStatusNormalizedAddress_FieldPathSelector = 12 14189 DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id DeviceStatusNormalizedAddress_FieldPathSelector = 13 14190 DeviceStatusNormalizedAddress_FieldPathSelectorAddress DeviceStatusNormalizedAddress_FieldPathSelector = 14 14191 DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates DeviceStatusNormalizedAddress_FieldPathSelector = 15 14192 DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy DeviceStatusNormalizedAddress_FieldPathSelector = 16 14193 ) 14194 14195 func (s DeviceStatusNormalizedAddress_FieldPathSelector) String() string { 14196 switch s { 14197 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14198 return "postal_code" 14199 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14200 return "country_code" 14201 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14202 return "continent" 14203 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14204 return "continent_id" 14205 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14206 return "country" 14207 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14208 return "country_id" 14209 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14210 return "admin_area1" 14211 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14212 return "admin_area1_id" 14213 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14214 return "admin_area2" 14215 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14216 return "admin_area2_id" 14217 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14218 return "admin_area3" 14219 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14220 return "admin_area3_id" 14221 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14222 return "admin_area4" 14223 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14224 return "admin_area4_id" 14225 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14226 return "address" 14227 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14228 return "coordinates" 14229 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14230 return "accuracy" 14231 default: 14232 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", s)) 14233 } 14234 } 14235 14236 func BuildDeviceStatusNormalizedAddress_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusNormalizedAddress_FieldPath, error) { 14237 if len(fp) == 0 { 14238 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_NormalizedAddress") 14239 } 14240 if len(fp) == 1 { 14241 switch fp[0] { 14242 case "postal_code", "postalCode", "postal-code": 14243 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode}, nil 14244 case "country_code", "countryCode", "country-code": 14245 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode}, nil 14246 case "continent": 14247 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorContinent}, nil 14248 case "continent_id", "continentId", "continent-id": 14249 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorContinentId}, nil 14250 case "country": 14251 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCountry}, nil 14252 case "country_id", "countryId", "country-id": 14253 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCountryId}, nil 14254 case "admin_area1", "adminArea1", "admin-area1": 14255 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1}, nil 14256 case "admin_area1_id", "adminArea1Id", "admin-area1-id": 14257 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id}, nil 14258 case "admin_area2", "adminArea2", "admin-area2": 14259 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2}, nil 14260 case "admin_area2_id", "adminArea2Id", "admin-area2-id": 14261 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id}, nil 14262 case "admin_area3", "adminArea3", "admin-area3": 14263 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3}, nil 14264 case "admin_area3_id", "adminArea3Id", "admin-area3-id": 14265 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id}, nil 14266 case "admin_area4", "adminArea4", "admin-area4": 14267 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4}, nil 14268 case "admin_area4_id", "adminArea4Id", "admin-area4-id": 14269 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id}, nil 14270 case "address": 14271 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAddress}, nil 14272 case "coordinates": 14273 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates}, nil 14274 case "accuracy": 14275 return &DeviceStatusNormalizedAddress_FieldTerminalPath{selector: DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy}, nil 14276 } 14277 } 14278 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_NormalizedAddress", fp) 14279 } 14280 14281 func ParseDeviceStatusNormalizedAddress_FieldPath(rawField string) (DeviceStatusNormalizedAddress_FieldPath, error) { 14282 fp, err := gotenobject.ParseRawFieldPath(rawField) 14283 if err != nil { 14284 return nil, err 14285 } 14286 return BuildDeviceStatusNormalizedAddress_FieldPath(fp) 14287 } 14288 14289 func MustParseDeviceStatusNormalizedAddress_FieldPath(rawField string) DeviceStatusNormalizedAddress_FieldPath { 14290 fp, err := ParseDeviceStatusNormalizedAddress_FieldPath(rawField) 14291 if err != nil { 14292 panic(err) 14293 } 14294 return fp 14295 } 14296 14297 type DeviceStatusNormalizedAddress_FieldTerminalPath struct { 14298 selector DeviceStatusNormalizedAddress_FieldPathSelector 14299 } 14300 14301 var _ DeviceStatusNormalizedAddress_FieldPath = (*DeviceStatusNormalizedAddress_FieldTerminalPath)(nil) 14302 14303 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) Selector() DeviceStatusNormalizedAddress_FieldPathSelector { 14304 return fp.selector 14305 } 14306 14307 // String returns path representation in proto convention 14308 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) String() string { 14309 return fp.selector.String() 14310 } 14311 14312 // JSONString returns path representation is JSON convention 14313 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) JSONString() string { 14314 return strcase.ToLowerCamel(fp.String()) 14315 } 14316 14317 // Get returns all values pointed by specific field from source Device_Status_NormalizedAddress 14318 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) Get(source *Device_Status_NormalizedAddress) (values []interface{}) { 14319 if source != nil { 14320 switch fp.selector { 14321 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14322 values = append(values, source.PostalCode) 14323 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14324 values = append(values, source.CountryCode) 14325 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14326 values = append(values, source.Continent) 14327 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14328 values = append(values, source.ContinentId) 14329 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14330 values = append(values, source.Country) 14331 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14332 values = append(values, source.CountryId) 14333 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14334 values = append(values, source.AdminArea1) 14335 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14336 values = append(values, source.AdminArea1Id) 14337 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14338 values = append(values, source.AdminArea2) 14339 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14340 values = append(values, source.AdminArea2Id) 14341 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14342 values = append(values, source.AdminArea3) 14343 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14344 values = append(values, source.AdminArea3Id) 14345 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14346 values = append(values, source.AdminArea4) 14347 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14348 values = append(values, source.AdminArea4Id) 14349 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14350 values = append(values, source.Address) 14351 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14352 if source.Coordinates != nil { 14353 values = append(values, source.Coordinates) 14354 } 14355 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14356 values = append(values, source.Accuracy) 14357 default: 14358 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14359 } 14360 } 14361 return 14362 } 14363 14364 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 14365 return fp.Get(source.(*Device_Status_NormalizedAddress)) 14366 } 14367 14368 // GetSingle returns value pointed by specific field of from source Device_Status_NormalizedAddress 14369 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) GetSingle(source *Device_Status_NormalizedAddress) (interface{}, bool) { 14370 switch fp.selector { 14371 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14372 return source.GetPostalCode(), source != nil 14373 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14374 return source.GetCountryCode(), source != nil 14375 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14376 return source.GetContinent(), source != nil 14377 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14378 return source.GetContinentId(), source != nil 14379 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14380 return source.GetCountry(), source != nil 14381 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14382 return source.GetCountryId(), source != nil 14383 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14384 return source.GetAdminArea1(), source != nil 14385 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14386 return source.GetAdminArea1Id(), source != nil 14387 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14388 return source.GetAdminArea2(), source != nil 14389 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14390 return source.GetAdminArea2Id(), source != nil 14391 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14392 return source.GetAdminArea3(), source != nil 14393 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14394 return source.GetAdminArea3Id(), source != nil 14395 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14396 return source.GetAdminArea4(), source != nil 14397 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14398 return source.GetAdminArea4Id(), source != nil 14399 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14400 return source.GetAddress(), source != nil 14401 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14402 res := source.GetCoordinates() 14403 return res, res != nil 14404 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14405 return source.GetAccuracy(), source != nil 14406 default: 14407 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14408 } 14409 } 14410 14411 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 14412 return fp.GetSingle(source.(*Device_Status_NormalizedAddress)) 14413 } 14414 14415 // GetDefault returns a default value of the field type 14416 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) GetDefault() interface{} { 14417 switch fp.selector { 14418 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14419 return "" 14420 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14421 return "" 14422 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14423 return "" 14424 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14425 return "" 14426 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14427 return "" 14428 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14429 return "" 14430 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14431 return "" 14432 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14433 return "" 14434 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14435 return "" 14436 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14437 return "" 14438 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14439 return "" 14440 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14441 return "" 14442 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14443 return "" 14444 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14445 return "" 14446 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14447 return "" 14448 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14449 return (*latlng.LatLng)(nil) 14450 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14451 return float64(0) 14452 default: 14453 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14454 } 14455 } 14456 14457 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) ClearValue(item *Device_Status_NormalizedAddress) { 14458 if item != nil { 14459 switch fp.selector { 14460 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14461 item.PostalCode = "" 14462 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14463 item.CountryCode = "" 14464 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14465 item.Continent = "" 14466 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14467 item.ContinentId = "" 14468 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14469 item.Country = "" 14470 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14471 item.CountryId = "" 14472 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14473 item.AdminArea1 = "" 14474 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14475 item.AdminArea1Id = "" 14476 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14477 item.AdminArea2 = "" 14478 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14479 item.AdminArea2Id = "" 14480 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14481 item.AdminArea3 = "" 14482 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14483 item.AdminArea3Id = "" 14484 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14485 item.AdminArea4 = "" 14486 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14487 item.AdminArea4Id = "" 14488 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14489 item.Address = "" 14490 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14491 item.Coordinates = nil 14492 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14493 item.Accuracy = float64(0) 14494 default: 14495 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14496 } 14497 } 14498 } 14499 14500 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) ClearValueRaw(item proto.Message) { 14501 fp.ClearValue(item.(*Device_Status_NormalizedAddress)) 14502 } 14503 14504 // IsLeaf - whether field path is holds simple value 14505 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) IsLeaf() bool { 14506 return fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode || 14507 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode || 14508 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorContinent || 14509 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorContinentId || 14510 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorCountry || 14511 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorCountryId || 14512 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1 || 14513 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id || 14514 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2 || 14515 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id || 14516 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3 || 14517 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id || 14518 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4 || 14519 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id || 14520 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAddress || 14521 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates || 14522 fp.selector == DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy 14523 } 14524 14525 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 14526 return []gotenobject.FieldPath{fp} 14527 } 14528 14529 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusNormalizedAddress_FieldPathValue { 14530 switch fp.selector { 14531 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14532 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14533 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14534 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14535 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14536 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14537 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14538 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14539 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14540 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14541 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14542 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14543 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14544 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14545 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14546 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14547 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14548 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14549 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14550 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14551 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14552 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14553 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14554 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14555 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14556 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14557 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14558 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14559 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14560 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(string)} 14561 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14562 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(*latlng.LatLng)} 14563 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14564 return &DeviceStatusNormalizedAddress_FieldTerminalPathValue{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, value: value.(float64)} 14565 default: 14566 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14567 } 14568 } 14569 14570 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 14571 return fp.WithIValue(value) 14572 } 14573 14574 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusNormalizedAddress_FieldPathArrayOfValues { 14575 fpaov := &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp} 14576 switch fp.selector { 14577 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14578 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14579 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14580 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14581 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14582 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14583 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14584 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14585 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14586 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14587 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14588 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14589 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14590 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14591 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14592 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14593 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14594 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14595 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14596 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14597 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14598 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14599 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14600 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14601 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14602 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14603 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14604 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14605 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14606 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]string)} 14607 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14608 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]*latlng.LatLng)} 14609 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14610 return &DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues{DeviceStatusNormalizedAddress_FieldTerminalPath: *fp, values: values.([]float64)} 14611 default: 14612 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14613 } 14614 return fpaov 14615 } 14616 14617 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 14618 return fp.WithIArrayOfValues(values) 14619 } 14620 14621 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusNormalizedAddress_FieldPathArrayItemValue { 14622 switch fp.selector { 14623 default: 14624 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fp.selector)) 14625 } 14626 } 14627 14628 func (fp *DeviceStatusNormalizedAddress_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 14629 return fp.WithIArrayItemValue(value) 14630 } 14631 14632 // DeviceStatusNormalizedAddress_FieldPathValue allows storing values for NormalizedAddress fields according to their type 14633 type DeviceStatusNormalizedAddress_FieldPathValue interface { 14634 DeviceStatusNormalizedAddress_FieldPath 14635 gotenobject.FieldPathValue 14636 SetTo(target **Device_Status_NormalizedAddress) 14637 CompareWith(*Device_Status_NormalizedAddress) (cmp int, comparable bool) 14638 } 14639 14640 func ParseDeviceStatusNormalizedAddress_FieldPathValue(pathStr, valueStr string) (DeviceStatusNormalizedAddress_FieldPathValue, error) { 14641 fp, err := ParseDeviceStatusNormalizedAddress_FieldPath(pathStr) 14642 if err != nil { 14643 return nil, err 14644 } 14645 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 14646 if err != nil { 14647 return nil, status.Errorf(codes.InvalidArgument, "error parsing NormalizedAddress field path value from %s: %v", valueStr, err) 14648 } 14649 return fpv.(DeviceStatusNormalizedAddress_FieldPathValue), nil 14650 } 14651 14652 func MustParseDeviceStatusNormalizedAddress_FieldPathValue(pathStr, valueStr string) DeviceStatusNormalizedAddress_FieldPathValue { 14653 fpv, err := ParseDeviceStatusNormalizedAddress_FieldPathValue(pathStr, valueStr) 14654 if err != nil { 14655 panic(err) 14656 } 14657 return fpv 14658 } 14659 14660 type DeviceStatusNormalizedAddress_FieldTerminalPathValue struct { 14661 DeviceStatusNormalizedAddress_FieldTerminalPath 14662 value interface{} 14663 } 14664 14665 var _ DeviceStatusNormalizedAddress_FieldPathValue = (*DeviceStatusNormalizedAddress_FieldTerminalPathValue)(nil) 14666 14667 // GetRawValue returns raw value stored under selected path for 'NormalizedAddress' as interface{} 14668 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) GetRawValue() interface{} { 14669 return fpv.value 14670 } 14671 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsPostalCodeValue() (string, bool) { 14672 res, ok := fpv.value.(string) 14673 return res, ok 14674 } 14675 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsCountryCodeValue() (string, bool) { 14676 res, ok := fpv.value.(string) 14677 return res, ok 14678 } 14679 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsContinentValue() (string, bool) { 14680 res, ok := fpv.value.(string) 14681 return res, ok 14682 } 14683 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsContinentIdValue() (string, bool) { 14684 res, ok := fpv.value.(string) 14685 return res, ok 14686 } 14687 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsCountryValue() (string, bool) { 14688 res, ok := fpv.value.(string) 14689 return res, ok 14690 } 14691 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsCountryIdValue() (string, bool) { 14692 res, ok := fpv.value.(string) 14693 return res, ok 14694 } 14695 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea1Value() (string, bool) { 14696 res, ok := fpv.value.(string) 14697 return res, ok 14698 } 14699 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea1IdValue() (string, bool) { 14700 res, ok := fpv.value.(string) 14701 return res, ok 14702 } 14703 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea2Value() (string, bool) { 14704 res, ok := fpv.value.(string) 14705 return res, ok 14706 } 14707 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea2IdValue() (string, bool) { 14708 res, ok := fpv.value.(string) 14709 return res, ok 14710 } 14711 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea3Value() (string, bool) { 14712 res, ok := fpv.value.(string) 14713 return res, ok 14714 } 14715 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea3IdValue() (string, bool) { 14716 res, ok := fpv.value.(string) 14717 return res, ok 14718 } 14719 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea4Value() (string, bool) { 14720 res, ok := fpv.value.(string) 14721 return res, ok 14722 } 14723 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAdminArea4IdValue() (string, bool) { 14724 res, ok := fpv.value.(string) 14725 return res, ok 14726 } 14727 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAddressValue() (string, bool) { 14728 res, ok := fpv.value.(string) 14729 return res, ok 14730 } 14731 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsCoordinatesValue() (*latlng.LatLng, bool) { 14732 res, ok := fpv.value.(*latlng.LatLng) 14733 return res, ok 14734 } 14735 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) AsAccuracyValue() (float64, bool) { 14736 res, ok := fpv.value.(float64) 14737 return res, ok 14738 } 14739 14740 // SetTo stores value for selected field for object NormalizedAddress 14741 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) SetTo(target **Device_Status_NormalizedAddress) { 14742 if *target == nil { 14743 *target = new(Device_Status_NormalizedAddress) 14744 } 14745 switch fpv.selector { 14746 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14747 (*target).PostalCode = fpv.value.(string) 14748 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14749 (*target).CountryCode = fpv.value.(string) 14750 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14751 (*target).Continent = fpv.value.(string) 14752 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14753 (*target).ContinentId = fpv.value.(string) 14754 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14755 (*target).Country = fpv.value.(string) 14756 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14757 (*target).CountryId = fpv.value.(string) 14758 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14759 (*target).AdminArea1 = fpv.value.(string) 14760 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14761 (*target).AdminArea1Id = fpv.value.(string) 14762 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14763 (*target).AdminArea2 = fpv.value.(string) 14764 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14765 (*target).AdminArea2Id = fpv.value.(string) 14766 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14767 (*target).AdminArea3 = fpv.value.(string) 14768 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14769 (*target).AdminArea3Id = fpv.value.(string) 14770 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14771 (*target).AdminArea4 = fpv.value.(string) 14772 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14773 (*target).AdminArea4Id = fpv.value.(string) 14774 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14775 (*target).Address = fpv.value.(string) 14776 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14777 (*target).Coordinates = fpv.value.(*latlng.LatLng) 14778 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14779 (*target).Accuracy = fpv.value.(float64) 14780 default: 14781 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fpv.selector)) 14782 } 14783 } 14784 14785 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) SetToRaw(target proto.Message) { 14786 typedObject := target.(*Device_Status_NormalizedAddress) 14787 fpv.SetTo(&typedObject) 14788 } 14789 14790 // CompareWith compares value in the 'DeviceStatusNormalizedAddress_FieldTerminalPathValue' with the value under path in 'Device_Status_NormalizedAddress'. 14791 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) CompareWith(source *Device_Status_NormalizedAddress) (int, bool) { 14792 switch fpv.selector { 14793 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 14794 leftValue := fpv.value.(string) 14795 rightValue := source.GetPostalCode() 14796 if (leftValue) == (rightValue) { 14797 return 0, true 14798 } else if (leftValue) < (rightValue) { 14799 return -1, true 14800 } else { 14801 return 1, true 14802 } 14803 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 14804 leftValue := fpv.value.(string) 14805 rightValue := source.GetCountryCode() 14806 if (leftValue) == (rightValue) { 14807 return 0, true 14808 } else if (leftValue) < (rightValue) { 14809 return -1, true 14810 } else { 14811 return 1, true 14812 } 14813 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 14814 leftValue := fpv.value.(string) 14815 rightValue := source.GetContinent() 14816 if (leftValue) == (rightValue) { 14817 return 0, true 14818 } else if (leftValue) < (rightValue) { 14819 return -1, true 14820 } else { 14821 return 1, true 14822 } 14823 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 14824 leftValue := fpv.value.(string) 14825 rightValue := source.GetContinentId() 14826 if (leftValue) == (rightValue) { 14827 return 0, true 14828 } else if (leftValue) < (rightValue) { 14829 return -1, true 14830 } else { 14831 return 1, true 14832 } 14833 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 14834 leftValue := fpv.value.(string) 14835 rightValue := source.GetCountry() 14836 if (leftValue) == (rightValue) { 14837 return 0, true 14838 } else if (leftValue) < (rightValue) { 14839 return -1, true 14840 } else { 14841 return 1, true 14842 } 14843 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 14844 leftValue := fpv.value.(string) 14845 rightValue := source.GetCountryId() 14846 if (leftValue) == (rightValue) { 14847 return 0, true 14848 } else if (leftValue) < (rightValue) { 14849 return -1, true 14850 } else { 14851 return 1, true 14852 } 14853 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 14854 leftValue := fpv.value.(string) 14855 rightValue := source.GetAdminArea1() 14856 if (leftValue) == (rightValue) { 14857 return 0, true 14858 } else if (leftValue) < (rightValue) { 14859 return -1, true 14860 } else { 14861 return 1, true 14862 } 14863 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 14864 leftValue := fpv.value.(string) 14865 rightValue := source.GetAdminArea1Id() 14866 if (leftValue) == (rightValue) { 14867 return 0, true 14868 } else if (leftValue) < (rightValue) { 14869 return -1, true 14870 } else { 14871 return 1, true 14872 } 14873 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 14874 leftValue := fpv.value.(string) 14875 rightValue := source.GetAdminArea2() 14876 if (leftValue) == (rightValue) { 14877 return 0, true 14878 } else if (leftValue) < (rightValue) { 14879 return -1, true 14880 } else { 14881 return 1, true 14882 } 14883 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 14884 leftValue := fpv.value.(string) 14885 rightValue := source.GetAdminArea2Id() 14886 if (leftValue) == (rightValue) { 14887 return 0, true 14888 } else if (leftValue) < (rightValue) { 14889 return -1, true 14890 } else { 14891 return 1, true 14892 } 14893 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 14894 leftValue := fpv.value.(string) 14895 rightValue := source.GetAdminArea3() 14896 if (leftValue) == (rightValue) { 14897 return 0, true 14898 } else if (leftValue) < (rightValue) { 14899 return -1, true 14900 } else { 14901 return 1, true 14902 } 14903 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 14904 leftValue := fpv.value.(string) 14905 rightValue := source.GetAdminArea3Id() 14906 if (leftValue) == (rightValue) { 14907 return 0, true 14908 } else if (leftValue) < (rightValue) { 14909 return -1, true 14910 } else { 14911 return 1, true 14912 } 14913 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 14914 leftValue := fpv.value.(string) 14915 rightValue := source.GetAdminArea4() 14916 if (leftValue) == (rightValue) { 14917 return 0, true 14918 } else if (leftValue) < (rightValue) { 14919 return -1, true 14920 } else { 14921 return 1, true 14922 } 14923 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 14924 leftValue := fpv.value.(string) 14925 rightValue := source.GetAdminArea4Id() 14926 if (leftValue) == (rightValue) { 14927 return 0, true 14928 } else if (leftValue) < (rightValue) { 14929 return -1, true 14930 } else { 14931 return 1, true 14932 } 14933 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 14934 leftValue := fpv.value.(string) 14935 rightValue := source.GetAddress() 14936 if (leftValue) == (rightValue) { 14937 return 0, true 14938 } else if (leftValue) < (rightValue) { 14939 return -1, true 14940 } else { 14941 return 1, true 14942 } 14943 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 14944 return 0, false 14945 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 14946 leftValue := fpv.value.(float64) 14947 rightValue := source.GetAccuracy() 14948 if (leftValue) == (rightValue) { 14949 return 0, true 14950 } else if (leftValue) < (rightValue) { 14951 return -1, true 14952 } else { 14953 return 1, true 14954 } 14955 default: 14956 panic(fmt.Sprintf("Invalid selector for Device_Status_NormalizedAddress: %d", fpv.selector)) 14957 } 14958 } 14959 14960 func (fpv *DeviceStatusNormalizedAddress_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 14961 return fpv.CompareWith(source.(*Device_Status_NormalizedAddress)) 14962 } 14963 14964 // DeviceStatusNormalizedAddress_FieldPathArrayItemValue allows storing single item in Path-specific values for NormalizedAddress according to their type 14965 // Present only for array (repeated) types. 14966 type DeviceStatusNormalizedAddress_FieldPathArrayItemValue interface { 14967 gotenobject.FieldPathArrayItemValue 14968 DeviceStatusNormalizedAddress_FieldPath 14969 ContainsValue(*Device_Status_NormalizedAddress) bool 14970 } 14971 14972 // ParseDeviceStatusNormalizedAddress_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 14973 func ParseDeviceStatusNormalizedAddress_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusNormalizedAddress_FieldPathArrayItemValue, error) { 14974 fp, err := ParseDeviceStatusNormalizedAddress_FieldPath(pathStr) 14975 if err != nil { 14976 return nil, err 14977 } 14978 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 14979 if err != nil { 14980 return nil, status.Errorf(codes.InvalidArgument, "error parsing NormalizedAddress field path array item value from %s: %v", valueStr, err) 14981 } 14982 return fpaiv.(DeviceStatusNormalizedAddress_FieldPathArrayItemValue), nil 14983 } 14984 14985 func MustParseDeviceStatusNormalizedAddress_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusNormalizedAddress_FieldPathArrayItemValue { 14986 fpaiv, err := ParseDeviceStatusNormalizedAddress_FieldPathArrayItemValue(pathStr, valueStr) 14987 if err != nil { 14988 panic(err) 14989 } 14990 return fpaiv 14991 } 14992 14993 type DeviceStatusNormalizedAddress_FieldTerminalPathArrayItemValue struct { 14994 DeviceStatusNormalizedAddress_FieldTerminalPath 14995 value interface{} 14996 } 14997 14998 var _ DeviceStatusNormalizedAddress_FieldPathArrayItemValue = (*DeviceStatusNormalizedAddress_FieldTerminalPathArrayItemValue)(nil) 14999 15000 // GetRawValue returns stored element value for array in object Device_Status_NormalizedAddress as interface{} 15001 func (fpaiv *DeviceStatusNormalizedAddress_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 15002 return fpaiv.value 15003 } 15004 15005 func (fpaiv *DeviceStatusNormalizedAddress_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_NormalizedAddress) (interface{}, bool) { 15006 return nil, false 15007 } 15008 15009 func (fpaiv *DeviceStatusNormalizedAddress_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 15010 return fpaiv.GetSingle(source.(*Device_Status_NormalizedAddress)) 15011 } 15012 15013 // Contains returns a boolean indicating if value that is being held is present in given 'NormalizedAddress' 15014 func (fpaiv *DeviceStatusNormalizedAddress_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_NormalizedAddress) bool { 15015 slice := fpaiv.DeviceStatusNormalizedAddress_FieldTerminalPath.Get(source) 15016 for _, v := range slice { 15017 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 15018 if proto.Equal(asProtoMsg, v.(proto.Message)) { 15019 return true 15020 } 15021 } else if reflect.DeepEqual(v, fpaiv.value) { 15022 return true 15023 } 15024 } 15025 return false 15026 } 15027 15028 // DeviceStatusNormalizedAddress_FieldPathArrayOfValues allows storing slice of values for NormalizedAddress fields according to their type 15029 type DeviceStatusNormalizedAddress_FieldPathArrayOfValues interface { 15030 gotenobject.FieldPathArrayOfValues 15031 DeviceStatusNormalizedAddress_FieldPath 15032 } 15033 15034 func ParseDeviceStatusNormalizedAddress_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusNormalizedAddress_FieldPathArrayOfValues, error) { 15035 fp, err := ParseDeviceStatusNormalizedAddress_FieldPath(pathStr) 15036 if err != nil { 15037 return nil, err 15038 } 15039 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 15040 if err != nil { 15041 return nil, status.Errorf(codes.InvalidArgument, "error parsing NormalizedAddress field path array of values from %s: %v", valuesStr, err) 15042 } 15043 return fpaov.(DeviceStatusNormalizedAddress_FieldPathArrayOfValues), nil 15044 } 15045 15046 func MustParseDeviceStatusNormalizedAddress_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusNormalizedAddress_FieldPathArrayOfValues { 15047 fpaov, err := ParseDeviceStatusNormalizedAddress_FieldPathArrayOfValues(pathStr, valuesStr) 15048 if err != nil { 15049 panic(err) 15050 } 15051 return fpaov 15052 } 15053 15054 type DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues struct { 15055 DeviceStatusNormalizedAddress_FieldTerminalPath 15056 values interface{} 15057 } 15058 15059 var _ DeviceStatusNormalizedAddress_FieldPathArrayOfValues = (*DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues)(nil) 15060 15061 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 15062 switch fpaov.selector { 15063 case DeviceStatusNormalizedAddress_FieldPathSelectorPostalCode: 15064 for _, v := range fpaov.values.([]string) { 15065 values = append(values, v) 15066 } 15067 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryCode: 15068 for _, v := range fpaov.values.([]string) { 15069 values = append(values, v) 15070 } 15071 case DeviceStatusNormalizedAddress_FieldPathSelectorContinent: 15072 for _, v := range fpaov.values.([]string) { 15073 values = append(values, v) 15074 } 15075 case DeviceStatusNormalizedAddress_FieldPathSelectorContinentId: 15076 for _, v := range fpaov.values.([]string) { 15077 values = append(values, v) 15078 } 15079 case DeviceStatusNormalizedAddress_FieldPathSelectorCountry: 15080 for _, v := range fpaov.values.([]string) { 15081 values = append(values, v) 15082 } 15083 case DeviceStatusNormalizedAddress_FieldPathSelectorCountryId: 15084 for _, v := range fpaov.values.([]string) { 15085 values = append(values, v) 15086 } 15087 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1: 15088 for _, v := range fpaov.values.([]string) { 15089 values = append(values, v) 15090 } 15091 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea1Id: 15092 for _, v := range fpaov.values.([]string) { 15093 values = append(values, v) 15094 } 15095 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2: 15096 for _, v := range fpaov.values.([]string) { 15097 values = append(values, v) 15098 } 15099 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea2Id: 15100 for _, v := range fpaov.values.([]string) { 15101 values = append(values, v) 15102 } 15103 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3: 15104 for _, v := range fpaov.values.([]string) { 15105 values = append(values, v) 15106 } 15107 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea3Id: 15108 for _, v := range fpaov.values.([]string) { 15109 values = append(values, v) 15110 } 15111 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4: 15112 for _, v := range fpaov.values.([]string) { 15113 values = append(values, v) 15114 } 15115 case DeviceStatusNormalizedAddress_FieldPathSelectorAdminArea4Id: 15116 for _, v := range fpaov.values.([]string) { 15117 values = append(values, v) 15118 } 15119 case DeviceStatusNormalizedAddress_FieldPathSelectorAddress: 15120 for _, v := range fpaov.values.([]string) { 15121 values = append(values, v) 15122 } 15123 case DeviceStatusNormalizedAddress_FieldPathSelectorCoordinates: 15124 for _, v := range fpaov.values.([]*latlng.LatLng) { 15125 values = append(values, v) 15126 } 15127 case DeviceStatusNormalizedAddress_FieldPathSelectorAccuracy: 15128 for _, v := range fpaov.values.([]float64) { 15129 values = append(values, v) 15130 } 15131 } 15132 return 15133 } 15134 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsPostalCodeArrayOfValues() ([]string, bool) { 15135 res, ok := fpaov.values.([]string) 15136 return res, ok 15137 } 15138 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsCountryCodeArrayOfValues() ([]string, bool) { 15139 res, ok := fpaov.values.([]string) 15140 return res, ok 15141 } 15142 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsContinentArrayOfValues() ([]string, bool) { 15143 res, ok := fpaov.values.([]string) 15144 return res, ok 15145 } 15146 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsContinentIdArrayOfValues() ([]string, bool) { 15147 res, ok := fpaov.values.([]string) 15148 return res, ok 15149 } 15150 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsCountryArrayOfValues() ([]string, bool) { 15151 res, ok := fpaov.values.([]string) 15152 return res, ok 15153 } 15154 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsCountryIdArrayOfValues() ([]string, bool) { 15155 res, ok := fpaov.values.([]string) 15156 return res, ok 15157 } 15158 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea1ArrayOfValues() ([]string, bool) { 15159 res, ok := fpaov.values.([]string) 15160 return res, ok 15161 } 15162 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea1IdArrayOfValues() ([]string, bool) { 15163 res, ok := fpaov.values.([]string) 15164 return res, ok 15165 } 15166 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea2ArrayOfValues() ([]string, bool) { 15167 res, ok := fpaov.values.([]string) 15168 return res, ok 15169 } 15170 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea2IdArrayOfValues() ([]string, bool) { 15171 res, ok := fpaov.values.([]string) 15172 return res, ok 15173 } 15174 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea3ArrayOfValues() ([]string, bool) { 15175 res, ok := fpaov.values.([]string) 15176 return res, ok 15177 } 15178 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea3IdArrayOfValues() ([]string, bool) { 15179 res, ok := fpaov.values.([]string) 15180 return res, ok 15181 } 15182 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea4ArrayOfValues() ([]string, bool) { 15183 res, ok := fpaov.values.([]string) 15184 return res, ok 15185 } 15186 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAdminArea4IdArrayOfValues() ([]string, bool) { 15187 res, ok := fpaov.values.([]string) 15188 return res, ok 15189 } 15190 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAddressArrayOfValues() ([]string, bool) { 15191 res, ok := fpaov.values.([]string) 15192 return res, ok 15193 } 15194 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsCoordinatesArrayOfValues() ([]*latlng.LatLng, bool) { 15195 res, ok := fpaov.values.([]*latlng.LatLng) 15196 return res, ok 15197 } 15198 func (fpaov *DeviceStatusNormalizedAddress_FieldTerminalPathArrayOfValues) AsAccuracyArrayOfValues() ([]float64, bool) { 15199 res, ok := fpaov.values.([]float64) 15200 return res, ok 15201 } 15202 15203 // FieldPath provides implementation to handle 15204 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 15205 type DeviceStatusDeviceInfoHardwareInformation_FieldPath interface { 15206 gotenobject.FieldPath 15207 Selector() DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector 15208 Get(source *Device_Status_DeviceInfo_HardwareInformation) []interface{} 15209 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation) (interface{}, bool) 15210 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation) 15211 15212 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformation_FieldPathValue 15213 // (or array of values) and holds passed value. Panics if injected type is incorrect. 15214 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathValue 15215 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues 15216 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue 15217 } 15218 15219 type DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector int32 15220 15221 const ( 15222 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 0 15223 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 1 15224 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 2 15225 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 3 15226 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 4 15227 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 5 15228 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 6 15229 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 7 15230 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 8 15231 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 9 15232 DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector = 10 15233 ) 15234 15235 func (s DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector) String() string { 15236 switch s { 15237 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15238 return "os" 15239 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15240 return "bios" 15241 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15242 return "system" 15243 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15244 return "cpu" 15245 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15246 return "block" 15247 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15248 return "network" 15249 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15250 return "gpu" 15251 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15252 return "memory_info" 15253 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15254 return "hailo_info" 15255 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15256 return "nvidia_info" 15257 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15258 return "modem_status" 15259 default: 15260 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", s)) 15261 } 15262 } 15263 15264 func BuildDeviceStatusDeviceInfoHardwareInformation_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformation_FieldPath, error) { 15265 if len(fp) == 0 { 15266 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation") 15267 } 15268 if len(fp) == 1 { 15269 switch fp[0] { 15270 case "os": 15271 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs}, nil 15272 case "bios": 15273 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios}, nil 15274 case "system": 15275 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem}, nil 15276 case "cpu": 15277 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu}, nil 15278 case "block": 15279 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock}, nil 15280 case "network": 15281 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork}, nil 15282 case "gpu": 15283 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu}, nil 15284 case "memory_info", "memoryInfo", "memory-info": 15285 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo}, nil 15286 case "hailo_info", "hailoInfo", "hailo-info": 15287 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo}, nil 15288 case "nvidia_info", "nvidiaInfo", "nvidia-info": 15289 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo}, nil 15290 case "modem_status", "modemStatus", "modem-status": 15291 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus}, nil 15292 } 15293 } else { 15294 switch fp[0] { 15295 case "os": 15296 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(fp[1:]); err != nil { 15297 return nil, err 15298 } else { 15299 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs, subPath: subpath}, nil 15300 } 15301 case "bios": 15302 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(fp[1:]); err != nil { 15303 return nil, err 15304 } else { 15305 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios, subPath: subpath}, nil 15306 } 15307 case "system": 15308 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(fp[1:]); err != nil { 15309 return nil, err 15310 } else { 15311 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem, subPath: subpath}, nil 15312 } 15313 case "cpu": 15314 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(fp[1:]); err != nil { 15315 return nil, err 15316 } else { 15317 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu, subPath: subpath}, nil 15318 } 15319 case "block": 15320 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(fp[1:]); err != nil { 15321 return nil, err 15322 } else { 15323 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock, subPath: subpath}, nil 15324 } 15325 case "network": 15326 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(fp[1:]); err != nil { 15327 return nil, err 15328 } else { 15329 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork, subPath: subpath}, nil 15330 } 15331 case "gpu": 15332 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(fp[1:]); err != nil { 15333 return nil, err 15334 } else { 15335 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu, subPath: subpath}, nil 15336 } 15337 case "memory_info", "memoryInfo", "memory-info": 15338 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(fp[1:]); err != nil { 15339 return nil, err 15340 } else { 15341 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo, subPath: subpath}, nil 15342 } 15343 case "hailo_info", "hailoInfo", "hailo-info": 15344 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(fp[1:]); err != nil { 15345 return nil, err 15346 } else { 15347 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo, subPath: subpath}, nil 15348 } 15349 case "nvidia_info", "nvidiaInfo", "nvidia-info": 15350 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(fp[1:]); err != nil { 15351 return nil, err 15352 } else { 15353 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo, subPath: subpath}, nil 15354 } 15355 case "modem_status", "modemStatus", "modem-status": 15356 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(fp[1:]); err != nil { 15357 return nil, err 15358 } else { 15359 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus, subPath: subpath}, nil 15360 } 15361 } 15362 } 15363 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation", fp) 15364 } 15365 15366 func ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformation_FieldPath, error) { 15367 fp, err := gotenobject.ParseRawFieldPath(rawField) 15368 if err != nil { 15369 return nil, err 15370 } 15371 return BuildDeviceStatusDeviceInfoHardwareInformation_FieldPath(fp) 15372 } 15373 15374 func MustParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformation_FieldPath { 15375 fp, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(rawField) 15376 if err != nil { 15377 panic(err) 15378 } 15379 return fp 15380 } 15381 15382 type DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath struct { 15383 selector DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector 15384 } 15385 15386 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPath = (*DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath)(nil) 15387 15388 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector { 15389 return fp.selector 15390 } 15391 15392 // String returns path representation in proto convention 15393 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) String() string { 15394 return fp.selector.String() 15395 } 15396 15397 // JSONString returns path representation is JSON convention 15398 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) JSONString() string { 15399 return strcase.ToLowerCamel(fp.String()) 15400 } 15401 15402 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation 15403 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation) (values []interface{}) { 15404 if source != nil { 15405 switch fp.selector { 15406 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15407 if source.Os != nil { 15408 values = append(values, source.Os) 15409 } 15410 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15411 if source.Bios != nil { 15412 values = append(values, source.Bios) 15413 } 15414 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15415 if source.System != nil { 15416 values = append(values, source.System) 15417 } 15418 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15419 if source.Cpu != nil { 15420 values = append(values, source.Cpu) 15421 } 15422 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15423 if source.Block != nil { 15424 values = append(values, source.Block) 15425 } 15426 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15427 if source.Network != nil { 15428 values = append(values, source.Network) 15429 } 15430 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15431 if source.Gpu != nil { 15432 values = append(values, source.Gpu) 15433 } 15434 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15435 if source.MemoryInfo != nil { 15436 values = append(values, source.MemoryInfo) 15437 } 15438 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15439 if source.HailoInfo != nil { 15440 values = append(values, source.HailoInfo) 15441 } 15442 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15443 if source.NvidiaInfo != nil { 15444 values = append(values, source.NvidiaInfo) 15445 } 15446 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15447 for _, value := range source.GetModemStatus() { 15448 values = append(values, value) 15449 } 15450 default: 15451 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15452 } 15453 } 15454 return 15455 } 15456 15457 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 15458 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation)) 15459 } 15460 15461 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation 15462 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation) (interface{}, bool) { 15463 switch fp.selector { 15464 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15465 res := source.GetOs() 15466 return res, res != nil 15467 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15468 res := source.GetBios() 15469 return res, res != nil 15470 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15471 res := source.GetSystem() 15472 return res, res != nil 15473 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15474 res := source.GetCpu() 15475 return res, res != nil 15476 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15477 res := source.GetBlock() 15478 return res, res != nil 15479 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15480 res := source.GetNetwork() 15481 return res, res != nil 15482 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15483 res := source.GetGpu() 15484 return res, res != nil 15485 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15486 res := source.GetMemoryInfo() 15487 return res, res != nil 15488 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15489 res := source.GetHailoInfo() 15490 return res, res != nil 15491 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15492 res := source.GetNvidiaInfo() 15493 return res, res != nil 15494 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15495 res := source.GetModemStatus() 15496 return res, res != nil 15497 default: 15498 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15499 } 15500 } 15501 15502 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 15503 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation)) 15504 } 15505 15506 // GetDefault returns a default value of the field type 15507 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) GetDefault() interface{} { 15508 switch fp.selector { 15509 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15510 return (*Device_Status_DeviceInfo_HardwareInformation_OS)(nil) 15511 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15512 return (*Device_Status_DeviceInfo_HardwareInformation_BIOS)(nil) 15513 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15514 return (*Device_Status_DeviceInfo_HardwareInformation_System)(nil) 15515 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15516 return (*Device_Status_DeviceInfo_HardwareInformation_CPU)(nil) 15517 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15518 return (*Device_Status_DeviceInfo_HardwareInformation_Block)(nil) 15519 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15520 return (*Device_Status_DeviceInfo_HardwareInformation_Network)(nil) 15521 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15522 return (*Device_Status_DeviceInfo_HardwareInformation_GPU)(nil) 15523 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15524 return (*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)(nil) 15525 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15526 return (*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)(nil) 15527 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15528 return (*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)(nil) 15529 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15530 return ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)(nil) 15531 default: 15532 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15533 } 15534 } 15535 15536 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation) { 15537 if item != nil { 15538 switch fp.selector { 15539 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15540 item.Os = nil 15541 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15542 item.Bios = nil 15543 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15544 item.System = nil 15545 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15546 item.Cpu = nil 15547 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15548 item.Block = nil 15549 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15550 item.Network = nil 15551 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15552 item.Gpu = nil 15553 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15554 item.MemoryInfo = nil 15555 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15556 item.HailoInfo = nil 15557 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15558 item.NvidiaInfo = nil 15559 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15560 item.ModemStatus = nil 15561 default: 15562 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15563 } 15564 } 15565 } 15566 15567 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) ClearValueRaw(item proto.Message) { 15568 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation)) 15569 } 15570 15571 // IsLeaf - whether field path is holds simple value 15572 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) IsLeaf() bool { 15573 return false 15574 } 15575 15576 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 15577 return []gotenobject.FieldPath{fp} 15578 } 15579 15580 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathValue { 15581 switch fp.selector { 15582 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15583 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_OS)} 15584 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15585 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)} 15586 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15587 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_System)} 15588 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15589 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_CPU)} 15590 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15591 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_Block)} 15592 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15593 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_Network)} 15594 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15595 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_GPU)} 15596 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15597 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)} 15598 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15599 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)} 15600 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15601 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)} 15602 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15603 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)} 15604 default: 15605 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15606 } 15607 } 15608 15609 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 15610 return fp.WithIValue(value) 15611 } 15612 15613 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues { 15614 fpaov := &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp} 15615 switch fp.selector { 15616 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15617 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_OS)} 15618 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15619 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_BIOS)} 15620 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15621 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_System)} 15622 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15623 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_CPU)} 15624 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15625 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_Block)} 15626 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15627 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_Network)} 15628 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15629 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_GPU)} 15630 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15631 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)} 15632 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15633 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)} 15634 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15635 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)} 15636 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15637 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)} 15638 default: 15639 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15640 } 15641 return fpaov 15642 } 15643 15644 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 15645 return fp.WithIArrayOfValues(values) 15646 } 15647 15648 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue { 15649 switch fp.selector { 15650 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15651 return &DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)} 15652 default: 15653 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fp.selector)) 15654 } 15655 } 15656 15657 func (fp *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 15658 return fp.WithIArrayItemValue(value) 15659 } 15660 15661 type DeviceStatusDeviceInfoHardwareInformation_FieldSubPath struct { 15662 selector DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector 15663 subPath gotenobject.FieldPath 15664 } 15665 15666 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPath = (*DeviceStatusDeviceInfoHardwareInformation_FieldSubPath)(nil) 15667 15668 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformation_FieldPathSelector { 15669 return fps.selector 15670 } 15671 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsOsSubPath() (DeviceStatusDeviceInfoHardwareInformationOS_FieldPath, bool) { 15672 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPath) 15673 return res, ok 15674 } 15675 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsBiosSubPath() (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath, bool) { 15676 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath) 15677 return res, ok 15678 } 15679 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsSystemSubPath() (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath, bool) { 15680 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath) 15681 return res, ok 15682 } 15683 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsCpuSubPath() (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath, bool) { 15684 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath) 15685 return res, ok 15686 } 15687 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsBlockSubPath() (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath, bool) { 15688 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath) 15689 return res, ok 15690 } 15691 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsNetworkSubPath() (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath, bool) { 15692 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath) 15693 return res, ok 15694 } 15695 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsGpuSubPath() (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath, bool) { 15696 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath) 15697 return res, ok 15698 } 15699 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsMemoryInfoSubPath() (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath, bool) { 15700 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath) 15701 return res, ok 15702 } 15703 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsHailoInfoSubPath() (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath, bool) { 15704 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath) 15705 return res, ok 15706 } 15707 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsNvidiaInfoSubPath() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath, bool) { 15708 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath) 15709 return res, ok 15710 } 15711 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) AsModemStatusSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath, bool) { 15712 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath) 15713 return res, ok 15714 } 15715 15716 // String returns path representation in proto convention 15717 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) String() string { 15718 return fps.selector.String() + "." + fps.subPath.String() 15719 } 15720 15721 // JSONString returns path representation is JSON convention 15722 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) JSONString() string { 15723 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 15724 } 15725 15726 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation 15727 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation) (values []interface{}) { 15728 switch fps.selector { 15729 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15730 values = append(values, fps.subPath.GetRaw(source.GetOs())...) 15731 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15732 values = append(values, fps.subPath.GetRaw(source.GetBios())...) 15733 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15734 values = append(values, fps.subPath.GetRaw(source.GetSystem())...) 15735 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15736 values = append(values, fps.subPath.GetRaw(source.GetCpu())...) 15737 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15738 values = append(values, fps.subPath.GetRaw(source.GetBlock())...) 15739 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15740 values = append(values, fps.subPath.GetRaw(source.GetNetwork())...) 15741 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15742 values = append(values, fps.subPath.GetRaw(source.GetGpu())...) 15743 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15744 values = append(values, fps.subPath.GetRaw(source.GetMemoryInfo())...) 15745 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15746 values = append(values, fps.subPath.GetRaw(source.GetHailoInfo())...) 15747 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15748 values = append(values, fps.subPath.GetRaw(source.GetNvidiaInfo())...) 15749 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15750 for _, item := range source.GetModemStatus() { 15751 values = append(values, fps.subPath.GetRaw(item)...) 15752 } 15753 default: 15754 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fps.selector)) 15755 } 15756 return 15757 } 15758 15759 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) GetRaw(source proto.Message) []interface{} { 15760 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation)) 15761 } 15762 15763 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation 15764 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation) (interface{}, bool) { 15765 switch fps.selector { 15766 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15767 if source.GetOs() == nil { 15768 return nil, false 15769 } 15770 return fps.subPath.GetSingleRaw(source.GetOs()) 15771 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15772 if source.GetBios() == nil { 15773 return nil, false 15774 } 15775 return fps.subPath.GetSingleRaw(source.GetBios()) 15776 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15777 if source.GetSystem() == nil { 15778 return nil, false 15779 } 15780 return fps.subPath.GetSingleRaw(source.GetSystem()) 15781 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15782 if source.GetCpu() == nil { 15783 return nil, false 15784 } 15785 return fps.subPath.GetSingleRaw(source.GetCpu()) 15786 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15787 if source.GetBlock() == nil { 15788 return nil, false 15789 } 15790 return fps.subPath.GetSingleRaw(source.GetBlock()) 15791 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15792 if source.GetNetwork() == nil { 15793 return nil, false 15794 } 15795 return fps.subPath.GetSingleRaw(source.GetNetwork()) 15796 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15797 if source.GetGpu() == nil { 15798 return nil, false 15799 } 15800 return fps.subPath.GetSingleRaw(source.GetGpu()) 15801 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15802 if source.GetMemoryInfo() == nil { 15803 return nil, false 15804 } 15805 return fps.subPath.GetSingleRaw(source.GetMemoryInfo()) 15806 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15807 if source.GetHailoInfo() == nil { 15808 return nil, false 15809 } 15810 return fps.subPath.GetSingleRaw(source.GetHailoInfo()) 15811 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15812 if source.GetNvidiaInfo() == nil { 15813 return nil, false 15814 } 15815 return fps.subPath.GetSingleRaw(source.GetNvidiaInfo()) 15816 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15817 if len(source.GetModemStatus()) == 0 { 15818 return nil, false 15819 } 15820 return fps.subPath.GetSingleRaw(source.GetModemStatus()[0]) 15821 default: 15822 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fps.selector)) 15823 } 15824 } 15825 15826 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 15827 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation)) 15828 } 15829 15830 // GetDefault returns a default value of the field type 15831 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) GetDefault() interface{} { 15832 return fps.subPath.GetDefault() 15833 } 15834 15835 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation) { 15836 if item != nil { 15837 switch fps.selector { 15838 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15839 fps.subPath.ClearValueRaw(item.Os) 15840 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 15841 fps.subPath.ClearValueRaw(item.Bios) 15842 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 15843 fps.subPath.ClearValueRaw(item.System) 15844 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 15845 fps.subPath.ClearValueRaw(item.Cpu) 15846 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 15847 fps.subPath.ClearValueRaw(item.Block) 15848 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 15849 fps.subPath.ClearValueRaw(item.Network) 15850 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 15851 fps.subPath.ClearValueRaw(item.Gpu) 15852 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 15853 fps.subPath.ClearValueRaw(item.MemoryInfo) 15854 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 15855 fps.subPath.ClearValueRaw(item.HailoInfo) 15856 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 15857 fps.subPath.ClearValueRaw(item.NvidiaInfo) 15858 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 15859 for _, subItem := range item.ModemStatus { 15860 fps.subPath.ClearValueRaw(subItem) 15861 } 15862 default: 15863 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fps.selector)) 15864 } 15865 } 15866 } 15867 15868 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) ClearValueRaw(item proto.Message) { 15869 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation)) 15870 } 15871 15872 // IsLeaf - whether field path is holds simple value 15873 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) IsLeaf() bool { 15874 return fps.subPath.IsLeaf() 15875 } 15876 15877 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 15878 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath{selector: fps.selector}} 15879 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 15880 return iPaths 15881 } 15882 15883 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathValue { 15884 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 15885 } 15886 15887 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 15888 return fps.WithIValue(value) 15889 } 15890 15891 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues { 15892 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 15893 } 15894 15895 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 15896 return fps.WithIArrayOfValues(values) 15897 } 15898 15899 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue { 15900 return &DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 15901 } 15902 15903 func (fps *DeviceStatusDeviceInfoHardwareInformation_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 15904 return fps.WithIArrayItemValue(value) 15905 } 15906 15907 // DeviceStatusDeviceInfoHardwareInformation_FieldPathValue allows storing values for HardwareInformation fields according to their type 15908 type DeviceStatusDeviceInfoHardwareInformation_FieldPathValue interface { 15909 DeviceStatusDeviceInfoHardwareInformation_FieldPath 15910 gotenobject.FieldPathValue 15911 SetTo(target **Device_Status_DeviceInfo_HardwareInformation) 15912 CompareWith(*Device_Status_DeviceInfo_HardwareInformation) (cmp int, comparable bool) 15913 } 15914 15915 func ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformation_FieldPathValue, error) { 15916 fp, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(pathStr) 15917 if err != nil { 15918 return nil, err 15919 } 15920 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 15921 if err != nil { 15922 return nil, status.Errorf(codes.InvalidArgument, "error parsing HardwareInformation field path value from %s: %v", valueStr, err) 15923 } 15924 return fpv.(DeviceStatusDeviceInfoHardwareInformation_FieldPathValue), nil 15925 } 15926 15927 func MustParseDeviceStatusDeviceInfoHardwareInformation_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformation_FieldPathValue { 15928 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathValue(pathStr, valueStr) 15929 if err != nil { 15930 panic(err) 15931 } 15932 return fpv 15933 } 15934 15935 type DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue struct { 15936 DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath 15937 value interface{} 15938 } 15939 15940 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue)(nil) 15941 15942 // GetRawValue returns raw value stored under selected path for 'HardwareInformation' as interface{} 15943 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) GetRawValue() interface{} { 15944 return fpv.value 15945 } 15946 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsOsValue() (*Device_Status_DeviceInfo_HardwareInformation_OS, bool) { 15947 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_OS) 15948 return res, ok 15949 } 15950 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsBiosValue() (*Device_Status_DeviceInfo_HardwareInformation_BIOS, bool) { 15951 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_BIOS) 15952 return res, ok 15953 } 15954 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsSystemValue() (*Device_Status_DeviceInfo_HardwareInformation_System, bool) { 15955 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_System) 15956 return res, ok 15957 } 15958 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsCpuValue() (*Device_Status_DeviceInfo_HardwareInformation_CPU, bool) { 15959 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_CPU) 15960 return res, ok 15961 } 15962 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsBlockValue() (*Device_Status_DeviceInfo_HardwareInformation_Block, bool) { 15963 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_Block) 15964 return res, ok 15965 } 15966 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsNetworkValue() (*Device_Status_DeviceInfo_HardwareInformation_Network, bool) { 15967 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_Network) 15968 return res, ok 15969 } 15970 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsGpuValue() (*Device_Status_DeviceInfo_HardwareInformation_GPU, bool) { 15971 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_GPU) 15972 return res, ok 15973 } 15974 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsMemoryInfoValue() (*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo, bool) { 15975 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 15976 return res, ok 15977 } 15978 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsHailoInfoValue() (*Device_Status_DeviceInfo_HardwareInformation_HailoInfo, bool) { 15979 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 15980 return res, ok 15981 } 15982 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsNvidiaInfoValue() (*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo, bool) { 15983 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 15984 return res, ok 15985 } 15986 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) AsModemStatusValue() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus, bool) { 15987 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 15988 return res, ok 15989 } 15990 15991 // SetTo stores value for selected field for object HardwareInformation 15992 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation) { 15993 if *target == nil { 15994 *target = new(Device_Status_DeviceInfo_HardwareInformation) 15995 } 15996 switch fpv.selector { 15997 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 15998 (*target).Os = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_OS) 15999 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 16000 (*target).Bios = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_BIOS) 16001 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 16002 (*target).System = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_System) 16003 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 16004 (*target).Cpu = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_CPU) 16005 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 16006 (*target).Block = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_Block) 16007 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 16008 (*target).Network = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_Network) 16009 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 16010 (*target).Gpu = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_GPU) 16011 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 16012 (*target).MemoryInfo = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 16013 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 16014 (*target).HailoInfo = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 16015 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 16016 (*target).NvidiaInfo = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 16017 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 16018 (*target).ModemStatus = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 16019 default: 16020 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fpv.selector)) 16021 } 16022 } 16023 16024 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) SetToRaw(target proto.Message) { 16025 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation) 16026 fpv.SetTo(&typedObject) 16027 } 16028 16029 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation'. 16030 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation) (int, bool) { 16031 switch fpv.selector { 16032 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 16033 return 0, false 16034 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 16035 return 0, false 16036 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 16037 return 0, false 16038 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 16039 return 0, false 16040 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 16041 return 0, false 16042 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 16043 return 0, false 16044 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 16045 return 0, false 16046 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 16047 return 0, false 16048 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 16049 return 0, false 16050 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 16051 return 0, false 16052 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 16053 return 0, false 16054 default: 16055 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fpv.selector)) 16056 } 16057 } 16058 16059 func (fpv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 16060 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation)) 16061 } 16062 16063 type DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue struct { 16064 DeviceStatusDeviceInfoHardwareInformation_FieldPath 16065 subPathValue gotenobject.FieldPathValue 16066 } 16067 16068 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue)(nil) 16069 16070 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsOsPathValue() (DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue, bool) { 16071 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue) 16072 return res, ok 16073 } 16074 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsBiosPathValue() (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue, bool) { 16075 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue) 16076 return res, ok 16077 } 16078 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsSystemPathValue() (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue, bool) { 16079 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue) 16080 return res, ok 16081 } 16082 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsCpuPathValue() (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue, bool) { 16083 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue) 16084 return res, ok 16085 } 16086 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsBlockPathValue() (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue, bool) { 16087 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue) 16088 return res, ok 16089 } 16090 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsNetworkPathValue() (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue, bool) { 16091 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue) 16092 return res, ok 16093 } 16094 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsGpuPathValue() (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue, bool) { 16095 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue) 16096 return res, ok 16097 } 16098 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsMemoryInfoPathValue() (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue, bool) { 16099 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue) 16100 return res, ok 16101 } 16102 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsHailoInfoPathValue() (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue, bool) { 16103 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue) 16104 return res, ok 16105 } 16106 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsNvidiaInfoPathValue() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue, bool) { 16107 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue) 16108 return res, ok 16109 } 16110 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) AsModemStatusPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue, bool) { 16111 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue) 16112 return res, ok 16113 } 16114 16115 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation) { 16116 if *target == nil { 16117 *target = new(Device_Status_DeviceInfo_HardwareInformation) 16118 } 16119 switch fpvs.Selector() { 16120 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 16121 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue).SetTo(&(*target).Os) 16122 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 16123 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue).SetTo(&(*target).Bios) 16124 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 16125 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue).SetTo(&(*target).System) 16126 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 16127 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue).SetTo(&(*target).Cpu) 16128 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 16129 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue).SetTo(&(*target).Block) 16130 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 16131 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue).SetTo(&(*target).Network) 16132 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 16133 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue).SetTo(&(*target).Gpu) 16134 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 16135 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue).SetTo(&(*target).MemoryInfo) 16136 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 16137 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue).SetTo(&(*target).HailoInfo) 16138 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 16139 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue).SetTo(&(*target).NvidiaInfo) 16140 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 16141 panic("FieldPath setter is unsupported for array subpaths") 16142 default: 16143 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fpvs.Selector())) 16144 } 16145 } 16146 16147 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) SetToRaw(target proto.Message) { 16148 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation) 16149 fpvs.SetTo(&typedObject) 16150 } 16151 16152 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) GetRawValue() interface{} { 16153 return fpvs.subPathValue.GetRawValue() 16154 } 16155 16156 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation) (int, bool) { 16157 switch fpvs.Selector() { 16158 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 16159 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue).CompareWith(source.GetOs()) 16160 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 16161 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue).CompareWith(source.GetBios()) 16162 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 16163 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue).CompareWith(source.GetSystem()) 16164 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 16165 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue).CompareWith(source.GetCpu()) 16166 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 16167 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue).CompareWith(source.GetBlock()) 16168 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 16169 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue).CompareWith(source.GetNetwork()) 16170 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 16171 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue).CompareWith(source.GetGpu()) 16172 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 16173 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue).CompareWith(source.GetMemoryInfo()) 16174 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 16175 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue).CompareWith(source.GetHailoInfo()) 16176 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 16177 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue).CompareWith(source.GetNvidiaInfo()) 16178 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 16179 return 0, false // repeated field 16180 default: 16181 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fpvs.Selector())) 16182 } 16183 } 16184 16185 func (fpvs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 16186 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation)) 16187 } 16188 16189 // DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue allows storing single item in Path-specific values for HardwareInformation according to their type 16190 // Present only for array (repeated) types. 16191 type DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue interface { 16192 gotenobject.FieldPathArrayItemValue 16193 DeviceStatusDeviceInfoHardwareInformation_FieldPath 16194 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation) bool 16195 } 16196 16197 // ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 16198 func ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue, error) { 16199 fp, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(pathStr) 16200 if err != nil { 16201 return nil, err 16202 } 16203 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 16204 if err != nil { 16205 return nil, status.Errorf(codes.InvalidArgument, "error parsing HardwareInformation field path array item value from %s: %v", valueStr, err) 16206 } 16207 return fpaiv.(DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue), nil 16208 } 16209 16210 func MustParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue { 16211 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue(pathStr, valueStr) 16212 if err != nil { 16213 panic(err) 16214 } 16215 return fpaiv 16216 } 16217 16218 type DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue struct { 16219 DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath 16220 value interface{} 16221 } 16222 16223 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue)(nil) 16224 16225 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation as interface{} 16226 func (fpaiv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 16227 return fpaiv.value 16228 } 16229 func (fpaiv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue) AsModemStatusItemValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus, bool) { 16230 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 16231 return res, ok 16232 } 16233 16234 func (fpaiv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation) (interface{}, bool) { 16235 return nil, false 16236 } 16237 16238 func (fpaiv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 16239 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation)) 16240 } 16241 16242 // Contains returns a boolean indicating if value that is being held is present in given 'HardwareInformation' 16243 func (fpaiv *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation) bool { 16244 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath.Get(source) 16245 for _, v := range slice { 16246 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 16247 if proto.Equal(asProtoMsg, v.(proto.Message)) { 16248 return true 16249 } 16250 } else if reflect.DeepEqual(v, fpaiv.value) { 16251 return true 16252 } 16253 } 16254 return false 16255 } 16256 16257 type DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue struct { 16258 DeviceStatusDeviceInfoHardwareInformation_FieldPath 16259 subPathItemValue gotenobject.FieldPathArrayItemValue 16260 } 16261 16262 // GetRawValue returns stored array item value 16263 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 16264 return fpaivs.subPathItemValue.GetRawItemValue() 16265 } 16266 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsOsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue, bool) { 16267 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue) 16268 return res, ok 16269 } 16270 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsBiosPathItemValue() (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue, bool) { 16271 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue) 16272 return res, ok 16273 } 16274 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsSystemPathItemValue() (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue, bool) { 16275 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue) 16276 return res, ok 16277 } 16278 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsCpuPathItemValue() (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue, bool) { 16279 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue) 16280 return res, ok 16281 } 16282 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsBlockPathItemValue() (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue, bool) { 16283 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue) 16284 return res, ok 16285 } 16286 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsNetworkPathItemValue() (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue, bool) { 16287 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue) 16288 return res, ok 16289 } 16290 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsGpuPathItemValue() (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue, bool) { 16291 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue) 16292 return res, ok 16293 } 16294 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsMemoryInfoPathItemValue() (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue, bool) { 16295 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue) 16296 return res, ok 16297 } 16298 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsHailoInfoPathItemValue() (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue, bool) { 16299 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue) 16300 return res, ok 16301 } 16302 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsNvidiaInfoPathItemValue() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue, bool) { 16303 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue) 16304 return res, ok 16305 } 16306 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) AsModemStatusPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue, bool) { 16307 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue) 16308 return res, ok 16309 } 16310 16311 // Contains returns a boolean indicating if value that is being held is present in given 'HardwareInformation' 16312 func (fpaivs *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation) bool { 16313 switch fpaivs.Selector() { 16314 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 16315 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue).ContainsValue(source.GetOs()) 16316 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 16317 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue).ContainsValue(source.GetBios()) 16318 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 16319 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue).ContainsValue(source.GetSystem()) 16320 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 16321 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue).ContainsValue(source.GetCpu()) 16322 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 16323 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue).ContainsValue(source.GetBlock()) 16324 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 16325 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue).ContainsValue(source.GetNetwork()) 16326 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 16327 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue).ContainsValue(source.GetGpu()) 16328 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 16329 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue).ContainsValue(source.GetMemoryInfo()) 16330 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 16331 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue).ContainsValue(source.GetHailoInfo()) 16332 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 16333 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue).ContainsValue(source.GetNvidiaInfo()) 16334 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 16335 return false // repeated/map field 16336 default: 16337 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation: %d", fpaivs.Selector())) 16338 } 16339 } 16340 16341 // DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues allows storing slice of values for HardwareInformation fields according to their type 16342 type DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues interface { 16343 gotenobject.FieldPathArrayOfValues 16344 DeviceStatusDeviceInfoHardwareInformation_FieldPath 16345 } 16346 16347 func ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues, error) { 16348 fp, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPath(pathStr) 16349 if err != nil { 16350 return nil, err 16351 } 16352 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 16353 if err != nil { 16354 return nil, status.Errorf(codes.InvalidArgument, "error parsing HardwareInformation field path array of values from %s: %v", valuesStr, err) 16355 } 16356 return fpaov.(DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues), nil 16357 } 16358 16359 func MustParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues { 16360 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues(pathStr, valuesStr) 16361 if err != nil { 16362 panic(err) 16363 } 16364 return fpaov 16365 } 16366 16367 type DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues struct { 16368 DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPath 16369 values interface{} 16370 } 16371 16372 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues)(nil) 16373 16374 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 16375 switch fpaov.selector { 16376 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorOs: 16377 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_OS) { 16378 values = append(values, v) 16379 } 16380 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBios: 16381 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_BIOS) { 16382 values = append(values, v) 16383 } 16384 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorSystem: 16385 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_System) { 16386 values = append(values, v) 16387 } 16388 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorCpu: 16389 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_CPU) { 16390 values = append(values, v) 16391 } 16392 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorBlock: 16393 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_Block) { 16394 values = append(values, v) 16395 } 16396 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNetwork: 16397 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_Network) { 16398 values = append(values, v) 16399 } 16400 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorGpu: 16401 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_GPU) { 16402 values = append(values, v) 16403 } 16404 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorMemoryInfo: 16405 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) { 16406 values = append(values, v) 16407 } 16408 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorHailoInfo: 16409 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) { 16410 values = append(values, v) 16411 } 16412 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorNvidiaInfo: 16413 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) { 16414 values = append(values, v) 16415 } 16416 case DeviceStatusDeviceInfoHardwareInformation_FieldPathSelectorModemStatus: 16417 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) { 16418 values = append(values, v) 16419 } 16420 } 16421 return 16422 } 16423 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsOsArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_OS, bool) { 16424 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_OS) 16425 return res, ok 16426 } 16427 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsBiosArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_BIOS, bool) { 16428 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_BIOS) 16429 return res, ok 16430 } 16431 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsSystemArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_System, bool) { 16432 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_System) 16433 return res, ok 16434 } 16435 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsCpuArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_CPU, bool) { 16436 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_CPU) 16437 return res, ok 16438 } 16439 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsBlockArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_Block, bool) { 16440 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_Block) 16441 return res, ok 16442 } 16443 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsNetworkArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_Network, bool) { 16444 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_Network) 16445 return res, ok 16446 } 16447 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsGpuArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_GPU, bool) { 16448 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_GPU) 16449 return res, ok 16450 } 16451 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsMemoryInfoArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo, bool) { 16452 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 16453 return res, ok 16454 } 16455 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsHailoInfoArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo, bool) { 16456 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 16457 return res, ok 16458 } 16459 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsNvidiaInfoArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo, bool) { 16460 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 16461 return res, ok 16462 } 16463 func (fpaov *DeviceStatusDeviceInfoHardwareInformation_FieldTerminalPathArrayOfValues) AsModemStatusArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus, bool) { 16464 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 16465 return res, ok 16466 } 16467 16468 type DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues struct { 16469 DeviceStatusDeviceInfoHardwareInformation_FieldPath 16470 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 16471 } 16472 16473 var _ DeviceStatusDeviceInfoHardwareInformation_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues)(nil) 16474 16475 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 16476 return fpsaov.subPathArrayOfValues.GetRawValues() 16477 } 16478 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsOsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues, bool) { 16479 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues) 16480 return res, ok 16481 } 16482 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsBiosPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues, bool) { 16483 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues) 16484 return res, ok 16485 } 16486 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsSystemPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues, bool) { 16487 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues) 16488 return res, ok 16489 } 16490 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsCpuPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues, bool) { 16491 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues) 16492 return res, ok 16493 } 16494 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsBlockPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues, bool) { 16495 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues) 16496 return res, ok 16497 } 16498 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsNetworkPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues, bool) { 16499 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues) 16500 return res, ok 16501 } 16502 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsGpuPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues, bool) { 16503 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues) 16504 return res, ok 16505 } 16506 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsMemoryInfoPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues, bool) { 16507 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues) 16508 return res, ok 16509 } 16510 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsHailoInfoPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues, bool) { 16511 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues) 16512 return res, ok 16513 } 16514 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsNvidiaInfoPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues, bool) { 16515 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues) 16516 return res, ok 16517 } 16518 func (fpsaov *DeviceStatusDeviceInfoHardwareInformation_FieldSubPathArrayOfValues) AsModemStatusPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues, bool) { 16519 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues) 16520 return res, ok 16521 } 16522 16523 // FieldPath provides implementation to handle 16524 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 16525 type DeviceStatusDeviceInfoNetworkInterface_FieldPath interface { 16526 gotenobject.FieldPath 16527 Selector() DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector 16528 Get(source *Device_Status_DeviceInfo_NetworkInterface) []interface{} 16529 GetSingle(source *Device_Status_DeviceInfo_NetworkInterface) (interface{}, bool) 16530 ClearValue(item *Device_Status_DeviceInfo_NetworkInterface) 16531 16532 // Those methods build corresponding DeviceStatusDeviceInfoNetworkInterface_FieldPathValue 16533 // (or array of values) and holds passed value. Panics if injected type is incorrect. 16534 WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathValue 16535 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues 16536 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue 16537 } 16538 16539 type DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector int32 16540 16541 const ( 16542 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 0 16543 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 1 16544 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 2 16545 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 3 16546 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 4 16547 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 5 16548 DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector = 6 16549 ) 16550 16551 func (s DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector) String() string { 16552 switch s { 16553 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16554 return "interface_name" 16555 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16556 return "ip_address_v4" 16557 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16558 return "external_ip_address_v4" 16559 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16560 return "ip_address_v6" 16561 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16562 return "external_ip_address_v6" 16563 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16564 return "as_info" 16565 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16566 return "carrier" 16567 default: 16568 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", s)) 16569 } 16570 } 16571 16572 func BuildDeviceStatusDeviceInfoNetworkInterface_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoNetworkInterface_FieldPath, error) { 16573 if len(fp) == 0 { 16574 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_NetworkInterface") 16575 } 16576 if len(fp) == 1 { 16577 switch fp[0] { 16578 case "interface_name", "interfaceName", "interface-name": 16579 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName}, nil 16580 case "ip_address_v4", "ipAddressV4", "ip-address-v4": 16581 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4}, nil 16582 case "external_ip_address_v4", "externalIpAddressV4", "external-ip-address-v4": 16583 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4}, nil 16584 case "ip_address_v6", "ipAddressV6", "ip-address-v6": 16585 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6}, nil 16586 case "external_ip_address_v6", "externalIpAddressV6", "external-ip-address-v6": 16587 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6}, nil 16588 case "as_info", "asInfo", "as-info": 16589 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo}, nil 16590 case "carrier": 16591 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier}, nil 16592 } 16593 } else { 16594 switch fp[0] { 16595 case "as_info", "asInfo", "as-info": 16596 if subpath, err := BuildDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(fp[1:]); err != nil { 16597 return nil, err 16598 } else { 16599 return &DeviceStatusDeviceInfoNetworkInterface_FieldSubPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo, subPath: subpath}, nil 16600 } 16601 case "carrier": 16602 if subpath, err := BuildDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(fp[1:]); err != nil { 16603 return nil, err 16604 } else { 16605 return &DeviceStatusDeviceInfoNetworkInterface_FieldSubPath{selector: DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier, subPath: subpath}, nil 16606 } 16607 } 16608 } 16609 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_NetworkInterface", fp) 16610 } 16611 16612 func ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(rawField string) (DeviceStatusDeviceInfoNetworkInterface_FieldPath, error) { 16613 fp, err := gotenobject.ParseRawFieldPath(rawField) 16614 if err != nil { 16615 return nil, err 16616 } 16617 return BuildDeviceStatusDeviceInfoNetworkInterface_FieldPath(fp) 16618 } 16619 16620 func MustParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(rawField string) DeviceStatusDeviceInfoNetworkInterface_FieldPath { 16621 fp, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(rawField) 16622 if err != nil { 16623 panic(err) 16624 } 16625 return fp 16626 } 16627 16628 type DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath struct { 16629 selector DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector 16630 } 16631 16632 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPath = (*DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath)(nil) 16633 16634 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) Selector() DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector { 16635 return fp.selector 16636 } 16637 16638 // String returns path representation in proto convention 16639 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) String() string { 16640 return fp.selector.String() 16641 } 16642 16643 // JSONString returns path representation is JSON convention 16644 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) JSONString() string { 16645 return strcase.ToLowerCamel(fp.String()) 16646 } 16647 16648 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_NetworkInterface 16649 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_NetworkInterface) (values []interface{}) { 16650 if source != nil { 16651 switch fp.selector { 16652 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16653 values = append(values, source.InterfaceName) 16654 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16655 for _, value := range source.GetIpAddressV4() { 16656 values = append(values, value) 16657 } 16658 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16659 for _, value := range source.GetExternalIpAddressV4() { 16660 values = append(values, value) 16661 } 16662 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16663 for _, value := range source.GetIpAddressV6() { 16664 values = append(values, value) 16665 } 16666 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16667 for _, value := range source.GetExternalIpAddressV6() { 16668 values = append(values, value) 16669 } 16670 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16671 if source.AsInfo != nil { 16672 values = append(values, source.AsInfo) 16673 } 16674 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16675 if source.Carrier != nil { 16676 values = append(values, source.Carrier) 16677 } 16678 default: 16679 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16680 } 16681 } 16682 return 16683 } 16684 16685 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 16686 return fp.Get(source.(*Device_Status_DeviceInfo_NetworkInterface)) 16687 } 16688 16689 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_NetworkInterface 16690 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface) (interface{}, bool) { 16691 switch fp.selector { 16692 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16693 return source.GetInterfaceName(), source != nil 16694 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16695 res := source.GetIpAddressV4() 16696 return res, res != nil 16697 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16698 res := source.GetExternalIpAddressV4() 16699 return res, res != nil 16700 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16701 res := source.GetIpAddressV6() 16702 return res, res != nil 16703 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16704 res := source.GetExternalIpAddressV6() 16705 return res, res != nil 16706 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16707 res := source.GetAsInfo() 16708 return res, res != nil 16709 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16710 res := source.GetCarrier() 16711 return res, res != nil 16712 default: 16713 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16714 } 16715 } 16716 16717 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 16718 return fp.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface)) 16719 } 16720 16721 // GetDefault returns a default value of the field type 16722 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) GetDefault() interface{} { 16723 switch fp.selector { 16724 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16725 return "" 16726 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16727 return ([]string)(nil) 16728 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16729 return ([]string)(nil) 16730 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16731 return ([]string)(nil) 16732 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16733 return ([]string)(nil) 16734 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16735 return (*Device_Status_DeviceInfo_NetworkInterface_ASInfo)(nil) 16736 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16737 return (*Device_Status_DeviceInfo_NetworkInterface_Carrier)(nil) 16738 default: 16739 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16740 } 16741 } 16742 16743 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_NetworkInterface) { 16744 if item != nil { 16745 switch fp.selector { 16746 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16747 item.InterfaceName = "" 16748 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16749 item.IpAddressV4 = nil 16750 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16751 item.ExternalIpAddressV4 = nil 16752 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16753 item.IpAddressV6 = nil 16754 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16755 item.ExternalIpAddressV6 = nil 16756 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16757 item.AsInfo = nil 16758 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16759 item.Carrier = nil 16760 default: 16761 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16762 } 16763 } 16764 } 16765 16766 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) ClearValueRaw(item proto.Message) { 16767 fp.ClearValue(item.(*Device_Status_DeviceInfo_NetworkInterface)) 16768 } 16769 16770 // IsLeaf - whether field path is holds simple value 16771 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) IsLeaf() bool { 16772 return fp.selector == DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName || 16773 fp.selector == DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4 || 16774 fp.selector == DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4 || 16775 fp.selector == DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6 || 16776 fp.selector == DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6 16777 } 16778 16779 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 16780 return []gotenobject.FieldPath{fp} 16781 } 16782 16783 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathValue { 16784 switch fp.selector { 16785 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16786 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(string)} 16787 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16788 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.([]string)} 16789 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16790 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.([]string)} 16791 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16792 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.([]string)} 16793 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16794 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.([]string)} 16795 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16796 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)} 16797 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16798 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)} 16799 default: 16800 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16801 } 16802 } 16803 16804 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 16805 return fp.WithIValue(value) 16806 } 16807 16808 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues { 16809 fpaov := &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp} 16810 switch fp.selector { 16811 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 16812 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([]string)} 16813 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16814 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([][]string)} 16815 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16816 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([][]string)} 16817 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16818 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([][]string)} 16819 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16820 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([][]string)} 16821 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16822 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_NetworkInterface_ASInfo)} 16823 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16824 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_NetworkInterface_Carrier)} 16825 default: 16826 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16827 } 16828 return fpaov 16829 } 16830 16831 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 16832 return fp.WithIArrayOfValues(values) 16833 } 16834 16835 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue { 16836 switch fp.selector { 16837 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 16838 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(string)} 16839 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 16840 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(string)} 16841 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 16842 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(string)} 16843 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 16844 return &DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath: *fp, value: value.(string)} 16845 default: 16846 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fp.selector)) 16847 } 16848 } 16849 16850 func (fp *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 16851 return fp.WithIArrayItemValue(value) 16852 } 16853 16854 type DeviceStatusDeviceInfoNetworkInterface_FieldSubPath struct { 16855 selector DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector 16856 subPath gotenobject.FieldPath 16857 } 16858 16859 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPath = (*DeviceStatusDeviceInfoNetworkInterface_FieldSubPath)(nil) 16860 16861 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) Selector() DeviceStatusDeviceInfoNetworkInterface_FieldPathSelector { 16862 return fps.selector 16863 } 16864 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) AsAsInfoSubPath() (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath, bool) { 16865 res, ok := fps.subPath.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath) 16866 return res, ok 16867 } 16868 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) AsCarrierSubPath() (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath, bool) { 16869 res, ok := fps.subPath.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath) 16870 return res, ok 16871 } 16872 16873 // String returns path representation in proto convention 16874 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) String() string { 16875 return fps.selector.String() + "." + fps.subPath.String() 16876 } 16877 16878 // JSONString returns path representation is JSON convention 16879 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) JSONString() string { 16880 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 16881 } 16882 16883 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_NetworkInterface 16884 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) Get(source *Device_Status_DeviceInfo_NetworkInterface) (values []interface{}) { 16885 switch fps.selector { 16886 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16887 values = append(values, fps.subPath.GetRaw(source.GetAsInfo())...) 16888 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16889 values = append(values, fps.subPath.GetRaw(source.GetCarrier())...) 16890 default: 16891 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fps.selector)) 16892 } 16893 return 16894 } 16895 16896 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) GetRaw(source proto.Message) []interface{} { 16897 return fps.Get(source.(*Device_Status_DeviceInfo_NetworkInterface)) 16898 } 16899 16900 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_NetworkInterface 16901 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface) (interface{}, bool) { 16902 switch fps.selector { 16903 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16904 if source.GetAsInfo() == nil { 16905 return nil, false 16906 } 16907 return fps.subPath.GetSingleRaw(source.GetAsInfo()) 16908 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16909 if source.GetCarrier() == nil { 16910 return nil, false 16911 } 16912 return fps.subPath.GetSingleRaw(source.GetCarrier()) 16913 default: 16914 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fps.selector)) 16915 } 16916 } 16917 16918 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 16919 return fps.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface)) 16920 } 16921 16922 // GetDefault returns a default value of the field type 16923 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) GetDefault() interface{} { 16924 return fps.subPath.GetDefault() 16925 } 16926 16927 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_NetworkInterface) { 16928 if item != nil { 16929 switch fps.selector { 16930 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 16931 fps.subPath.ClearValueRaw(item.AsInfo) 16932 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 16933 fps.subPath.ClearValueRaw(item.Carrier) 16934 default: 16935 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fps.selector)) 16936 } 16937 } 16938 } 16939 16940 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) ClearValueRaw(item proto.Message) { 16941 fps.ClearValue(item.(*Device_Status_DeviceInfo_NetworkInterface)) 16942 } 16943 16944 // IsLeaf - whether field path is holds simple value 16945 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) IsLeaf() bool { 16946 return fps.subPath.IsLeaf() 16947 } 16948 16949 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 16950 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath{selector: fps.selector}} 16951 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 16952 return iPaths 16953 } 16954 16955 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathValue { 16956 return &DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 16957 } 16958 16959 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 16960 return fps.WithIValue(value) 16961 } 16962 16963 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues { 16964 return &DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 16965 } 16966 16967 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 16968 return fps.WithIArrayOfValues(values) 16969 } 16970 16971 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue { 16972 return &DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 16973 } 16974 16975 func (fps *DeviceStatusDeviceInfoNetworkInterface_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 16976 return fps.WithIArrayItemValue(value) 16977 } 16978 16979 // DeviceStatusDeviceInfoNetworkInterface_FieldPathValue allows storing values for NetworkInterface fields according to their type 16980 type DeviceStatusDeviceInfoNetworkInterface_FieldPathValue interface { 16981 DeviceStatusDeviceInfoNetworkInterface_FieldPath 16982 gotenobject.FieldPathValue 16983 SetTo(target **Device_Status_DeviceInfo_NetworkInterface) 16984 CompareWith(*Device_Status_DeviceInfo_NetworkInterface) (cmp int, comparable bool) 16985 } 16986 16987 func ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoNetworkInterface_FieldPathValue, error) { 16988 fp, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(pathStr) 16989 if err != nil { 16990 return nil, err 16991 } 16992 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 16993 if err != nil { 16994 return nil, status.Errorf(codes.InvalidArgument, "error parsing NetworkInterface field path value from %s: %v", valueStr, err) 16995 } 16996 return fpv.(DeviceStatusDeviceInfoNetworkInterface_FieldPathValue), nil 16997 } 16998 16999 func MustParseDeviceStatusDeviceInfoNetworkInterface_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoNetworkInterface_FieldPathValue { 17000 fpv, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathValue(pathStr, valueStr) 17001 if err != nil { 17002 panic(err) 17003 } 17004 return fpv 17005 } 17006 17007 type DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue struct { 17008 DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath 17009 value interface{} 17010 } 17011 17012 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPathValue = (*DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue)(nil) 17013 17014 // GetRawValue returns raw value stored under selected path for 'NetworkInterface' as interface{} 17015 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) GetRawValue() interface{} { 17016 return fpv.value 17017 } 17018 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsInterfaceNameValue() (string, bool) { 17019 res, ok := fpv.value.(string) 17020 return res, ok 17021 } 17022 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsIpAddressV4Value() ([]string, bool) { 17023 res, ok := fpv.value.([]string) 17024 return res, ok 17025 } 17026 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsExternalIpAddressV4Value() ([]string, bool) { 17027 res, ok := fpv.value.([]string) 17028 return res, ok 17029 } 17030 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsIpAddressV6Value() ([]string, bool) { 17031 res, ok := fpv.value.([]string) 17032 return res, ok 17033 } 17034 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsExternalIpAddressV6Value() ([]string, bool) { 17035 res, ok := fpv.value.([]string) 17036 return res, ok 17037 } 17038 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsAsInfoValue() (*Device_Status_DeviceInfo_NetworkInterface_ASInfo, bool) { 17039 res, ok := fpv.value.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo) 17040 return res, ok 17041 } 17042 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) AsCarrierValue() (*Device_Status_DeviceInfo_NetworkInterface_Carrier, bool) { 17043 res, ok := fpv.value.(*Device_Status_DeviceInfo_NetworkInterface_Carrier) 17044 return res, ok 17045 } 17046 17047 // SetTo stores value for selected field for object NetworkInterface 17048 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_NetworkInterface) { 17049 if *target == nil { 17050 *target = new(Device_Status_DeviceInfo_NetworkInterface) 17051 } 17052 switch fpv.selector { 17053 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 17054 (*target).InterfaceName = fpv.value.(string) 17055 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 17056 (*target).IpAddressV4 = fpv.value.([]string) 17057 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 17058 (*target).ExternalIpAddressV4 = fpv.value.([]string) 17059 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 17060 (*target).IpAddressV6 = fpv.value.([]string) 17061 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 17062 (*target).ExternalIpAddressV6 = fpv.value.([]string) 17063 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 17064 (*target).AsInfo = fpv.value.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo) 17065 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 17066 (*target).Carrier = fpv.value.(*Device_Status_DeviceInfo_NetworkInterface_Carrier) 17067 default: 17068 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fpv.selector)) 17069 } 17070 } 17071 17072 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) SetToRaw(target proto.Message) { 17073 typedObject := target.(*Device_Status_DeviceInfo_NetworkInterface) 17074 fpv.SetTo(&typedObject) 17075 } 17076 17077 // CompareWith compares value in the 'DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_NetworkInterface'. 17078 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_NetworkInterface) (int, bool) { 17079 switch fpv.selector { 17080 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 17081 leftValue := fpv.value.(string) 17082 rightValue := source.GetInterfaceName() 17083 if (leftValue) == (rightValue) { 17084 return 0, true 17085 } else if (leftValue) < (rightValue) { 17086 return -1, true 17087 } else { 17088 return 1, true 17089 } 17090 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 17091 return 0, false 17092 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 17093 return 0, false 17094 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 17095 return 0, false 17096 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 17097 return 0, false 17098 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 17099 return 0, false 17100 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 17101 return 0, false 17102 default: 17103 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fpv.selector)) 17104 } 17105 } 17106 17107 func (fpv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 17108 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_NetworkInterface)) 17109 } 17110 17111 type DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue struct { 17112 DeviceStatusDeviceInfoNetworkInterface_FieldPath 17113 subPathValue gotenobject.FieldPathValue 17114 } 17115 17116 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPathValue = (*DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue)(nil) 17117 17118 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) AsAsInfoPathValue() (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue, bool) { 17119 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue) 17120 return res, ok 17121 } 17122 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) AsCarrierPathValue() (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue, bool) { 17123 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue) 17124 return res, ok 17125 } 17126 17127 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_NetworkInterface) { 17128 if *target == nil { 17129 *target = new(Device_Status_DeviceInfo_NetworkInterface) 17130 } 17131 switch fpvs.Selector() { 17132 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 17133 fpvs.subPathValue.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue).SetTo(&(*target).AsInfo) 17134 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 17135 fpvs.subPathValue.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue).SetTo(&(*target).Carrier) 17136 default: 17137 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fpvs.Selector())) 17138 } 17139 } 17140 17141 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) SetToRaw(target proto.Message) { 17142 typedObject := target.(*Device_Status_DeviceInfo_NetworkInterface) 17143 fpvs.SetTo(&typedObject) 17144 } 17145 17146 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) GetRawValue() interface{} { 17147 return fpvs.subPathValue.GetRawValue() 17148 } 17149 17150 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_NetworkInterface) (int, bool) { 17151 switch fpvs.Selector() { 17152 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 17153 return fpvs.subPathValue.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue).CompareWith(source.GetAsInfo()) 17154 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 17155 return fpvs.subPathValue.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue).CompareWith(source.GetCarrier()) 17156 default: 17157 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fpvs.Selector())) 17158 } 17159 } 17160 17161 func (fpvs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 17162 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_NetworkInterface)) 17163 } 17164 17165 // DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue allows storing single item in Path-specific values for NetworkInterface according to their type 17166 // Present only for array (repeated) types. 17167 type DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue interface { 17168 gotenobject.FieldPathArrayItemValue 17169 DeviceStatusDeviceInfoNetworkInterface_FieldPath 17170 ContainsValue(*Device_Status_DeviceInfo_NetworkInterface) bool 17171 } 17172 17173 // ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 17174 func ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue, error) { 17175 fp, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(pathStr) 17176 if err != nil { 17177 return nil, err 17178 } 17179 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 17180 if err != nil { 17181 return nil, status.Errorf(codes.InvalidArgument, "error parsing NetworkInterface field path array item value from %s: %v", valueStr, err) 17182 } 17183 return fpaiv.(DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue), nil 17184 } 17185 17186 func MustParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue { 17187 fpaiv, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue(pathStr, valueStr) 17188 if err != nil { 17189 panic(err) 17190 } 17191 return fpaiv 17192 } 17193 17194 type DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue struct { 17195 DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath 17196 value interface{} 17197 } 17198 17199 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue)(nil) 17200 17201 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_NetworkInterface as interface{} 17202 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 17203 return fpaiv.value 17204 } 17205 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) AsIpAddressV4ItemValue() (string, bool) { 17206 res, ok := fpaiv.value.(string) 17207 return res, ok 17208 } 17209 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) AsExternalIpAddressV4ItemValue() (string, bool) { 17210 res, ok := fpaiv.value.(string) 17211 return res, ok 17212 } 17213 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) AsIpAddressV6ItemValue() (string, bool) { 17214 res, ok := fpaiv.value.(string) 17215 return res, ok 17216 } 17217 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) AsExternalIpAddressV6ItemValue() (string, bool) { 17218 res, ok := fpaiv.value.(string) 17219 return res, ok 17220 } 17221 17222 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface) (interface{}, bool) { 17223 return nil, false 17224 } 17225 17226 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 17227 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface)) 17228 } 17229 17230 // Contains returns a boolean indicating if value that is being held is present in given 'NetworkInterface' 17231 func (fpaiv *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_NetworkInterface) bool { 17232 slice := fpaiv.DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath.Get(source) 17233 for _, v := range slice { 17234 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 17235 if proto.Equal(asProtoMsg, v.(proto.Message)) { 17236 return true 17237 } 17238 } else if reflect.DeepEqual(v, fpaiv.value) { 17239 return true 17240 } 17241 } 17242 return false 17243 } 17244 17245 type DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayItemValue struct { 17246 DeviceStatusDeviceInfoNetworkInterface_FieldPath 17247 subPathItemValue gotenobject.FieldPathArrayItemValue 17248 } 17249 17250 // GetRawValue returns stored array item value 17251 func (fpaivs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 17252 return fpaivs.subPathItemValue.GetRawItemValue() 17253 } 17254 func (fpaivs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayItemValue) AsAsInfoPathItemValue() (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue, bool) { 17255 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue) 17256 return res, ok 17257 } 17258 func (fpaivs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayItemValue) AsCarrierPathItemValue() (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue, bool) { 17259 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue) 17260 return res, ok 17261 } 17262 17263 // Contains returns a boolean indicating if value that is being held is present in given 'NetworkInterface' 17264 func (fpaivs *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_NetworkInterface) bool { 17265 switch fpaivs.Selector() { 17266 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 17267 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue).ContainsValue(source.GetAsInfo()) 17268 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 17269 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue).ContainsValue(source.GetCarrier()) 17270 default: 17271 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface: %d", fpaivs.Selector())) 17272 } 17273 } 17274 17275 // DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues allows storing slice of values for NetworkInterface fields according to their type 17276 type DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues interface { 17277 gotenobject.FieldPathArrayOfValues 17278 DeviceStatusDeviceInfoNetworkInterface_FieldPath 17279 } 17280 17281 func ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues, error) { 17282 fp, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPath(pathStr) 17283 if err != nil { 17284 return nil, err 17285 } 17286 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 17287 if err != nil { 17288 return nil, status.Errorf(codes.InvalidArgument, "error parsing NetworkInterface field path array of values from %s: %v", valuesStr, err) 17289 } 17290 return fpaov.(DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues), nil 17291 } 17292 17293 func MustParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues { 17294 fpaov, err := ParseDeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues(pathStr, valuesStr) 17295 if err != nil { 17296 panic(err) 17297 } 17298 return fpaov 17299 } 17300 17301 type DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues struct { 17302 DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPath 17303 values interface{} 17304 } 17305 17306 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues)(nil) 17307 17308 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 17309 switch fpaov.selector { 17310 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorInterfaceName: 17311 for _, v := range fpaov.values.([]string) { 17312 values = append(values, v) 17313 } 17314 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV4: 17315 for _, v := range fpaov.values.([][]string) { 17316 values = append(values, v) 17317 } 17318 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV4: 17319 for _, v := range fpaov.values.([][]string) { 17320 values = append(values, v) 17321 } 17322 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorIpAddressV6: 17323 for _, v := range fpaov.values.([][]string) { 17324 values = append(values, v) 17325 } 17326 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorExternalIpAddressV6: 17327 for _, v := range fpaov.values.([][]string) { 17328 values = append(values, v) 17329 } 17330 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorAsInfo: 17331 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_NetworkInterface_ASInfo) { 17332 values = append(values, v) 17333 } 17334 case DeviceStatusDeviceInfoNetworkInterface_FieldPathSelectorCarrier: 17335 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_NetworkInterface_Carrier) { 17336 values = append(values, v) 17337 } 17338 } 17339 return 17340 } 17341 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsInterfaceNameArrayOfValues() ([]string, bool) { 17342 res, ok := fpaov.values.([]string) 17343 return res, ok 17344 } 17345 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsIpAddressV4ArrayOfValues() ([][]string, bool) { 17346 res, ok := fpaov.values.([][]string) 17347 return res, ok 17348 } 17349 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsExternalIpAddressV4ArrayOfValues() ([][]string, bool) { 17350 res, ok := fpaov.values.([][]string) 17351 return res, ok 17352 } 17353 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsIpAddressV6ArrayOfValues() ([][]string, bool) { 17354 res, ok := fpaov.values.([][]string) 17355 return res, ok 17356 } 17357 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsExternalIpAddressV6ArrayOfValues() ([][]string, bool) { 17358 res, ok := fpaov.values.([][]string) 17359 return res, ok 17360 } 17361 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsAsInfoArrayOfValues() ([]*Device_Status_DeviceInfo_NetworkInterface_ASInfo, bool) { 17362 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_NetworkInterface_ASInfo) 17363 return res, ok 17364 } 17365 func (fpaov *DeviceStatusDeviceInfoNetworkInterface_FieldTerminalPathArrayOfValues) AsCarrierArrayOfValues() ([]*Device_Status_DeviceInfo_NetworkInterface_Carrier, bool) { 17366 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_NetworkInterface_Carrier) 17367 return res, ok 17368 } 17369 17370 type DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayOfValues struct { 17371 DeviceStatusDeviceInfoNetworkInterface_FieldPath 17372 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 17373 } 17374 17375 var _ DeviceStatusDeviceInfoNetworkInterface_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayOfValues)(nil) 17376 17377 func (fpsaov *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 17378 return fpsaov.subPathArrayOfValues.GetRawValues() 17379 } 17380 func (fpsaov *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayOfValues) AsAsInfoPathArrayOfValues() (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues, bool) { 17381 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues) 17382 return res, ok 17383 } 17384 func (fpsaov *DeviceStatusDeviceInfoNetworkInterface_FieldSubPathArrayOfValues) AsCarrierPathArrayOfValues() (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues, bool) { 17385 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues) 17386 return res, ok 17387 } 17388 17389 // FieldPath provides implementation to handle 17390 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 17391 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath interface { 17392 gotenobject.FieldPath 17393 Selector() DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector 17394 Get(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) []interface{} 17395 GetSingle(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) (interface{}, bool) 17396 ClearValue(item *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 17397 17398 // Those methods build corresponding DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue 17399 // (or array of values) and holds passed value. Panics if injected type is incorrect. 17400 WithIValue(value interface{}) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue 17401 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues 17402 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue 17403 } 17404 17405 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector int32 17406 17407 const ( 17408 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector = 0 17409 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector = 1 17410 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector = 2 17411 ) 17412 17413 func (s DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector) String() string { 17414 switch s { 17415 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17416 return "active_control_plane_interface" 17417 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17418 return "uses_proxy" 17419 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17420 return "is_fallback" 17421 default: 17422 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", s)) 17423 } 17424 } 17425 17426 func BuildDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath, error) { 17427 if len(fp) == 0 { 17428 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_ControlPlaneInterfaceInfo") 17429 } 17430 if len(fp) == 1 { 17431 switch fp[0] { 17432 case "active_control_plane_interface", "activeControlPlaneInterface", "active-control-plane-interface": 17433 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface}, nil 17434 case "uses_proxy", "usesProxy", "uses-proxy": 17435 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy}, nil 17436 case "is_fallback", "isFallback", "is-fallback": 17437 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback}, nil 17438 } 17439 } 17440 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_ControlPlaneInterfaceInfo", fp) 17441 } 17442 17443 func ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath, error) { 17444 fp, err := gotenobject.ParseRawFieldPath(rawField) 17445 if err != nil { 17446 return nil, err 17447 } 17448 return BuildDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(fp) 17449 } 17450 17451 func MustParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(rawField string) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath { 17452 fp, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(rawField) 17453 if err != nil { 17454 panic(err) 17455 } 17456 return fp 17457 } 17458 17459 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath struct { 17460 selector DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector 17461 } 17462 17463 var _ DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath = (*DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath)(nil) 17464 17465 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelector { 17466 return fp.selector 17467 } 17468 17469 // String returns path representation in proto convention 17470 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) String() string { 17471 return fp.selector.String() 17472 } 17473 17474 // JSONString returns path representation is JSON convention 17475 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) JSONString() string { 17476 return strcase.ToLowerCamel(fp.String()) 17477 } 17478 17479 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_ControlPlaneInterfaceInfo 17480 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) (values []interface{}) { 17481 if source != nil { 17482 switch fp.selector { 17483 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17484 values = append(values, source.ActiveControlPlaneInterface) 17485 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17486 values = append(values, source.UsesProxy) 17487 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17488 values = append(values, source.IsFallback) 17489 default: 17490 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17491 } 17492 } 17493 return 17494 } 17495 17496 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 17497 return fp.Get(source.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 17498 } 17499 17500 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_ControlPlaneInterfaceInfo 17501 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) (interface{}, bool) { 17502 switch fp.selector { 17503 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17504 return source.GetActiveControlPlaneInterface(), source != nil 17505 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17506 return source.GetUsesProxy(), source != nil 17507 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17508 return source.GetIsFallback(), source != nil 17509 default: 17510 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17511 } 17512 } 17513 17514 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 17515 return fp.GetSingle(source.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 17516 } 17517 17518 // GetDefault returns a default value of the field type 17519 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) GetDefault() interface{} { 17520 switch fp.selector { 17521 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17522 return "" 17523 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17524 return false 17525 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17526 return false 17527 default: 17528 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17529 } 17530 } 17531 17532 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) { 17533 if item != nil { 17534 switch fp.selector { 17535 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17536 item.ActiveControlPlaneInterface = "" 17537 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17538 item.UsesProxy = false 17539 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17540 item.IsFallback = false 17541 default: 17542 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17543 } 17544 } 17545 } 17546 17547 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 17548 fp.ClearValue(item.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 17549 } 17550 17551 // IsLeaf - whether field path is holds simple value 17552 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) IsLeaf() bool { 17553 return fp.selector == DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface || 17554 fp.selector == DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy || 17555 fp.selector == DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback 17556 } 17557 17558 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 17559 return []gotenobject.FieldPath{fp} 17560 } 17561 17562 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue { 17563 switch fp.selector { 17564 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17565 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp, value: value.(string)} 17566 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17567 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp, value: value.(bool)} 17568 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17569 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp, value: value.(bool)} 17570 default: 17571 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17572 } 17573 } 17574 17575 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 17576 return fp.WithIValue(value) 17577 } 17578 17579 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues { 17580 fpaov := &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp} 17581 switch fp.selector { 17582 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17583 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp, values: values.([]string)} 17584 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17585 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp, values: values.([]bool)} 17586 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17587 return &DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath: *fp, values: values.([]bool)} 17588 default: 17589 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17590 } 17591 return fpaov 17592 } 17593 17594 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 17595 return fp.WithIArrayOfValues(values) 17596 } 17597 17598 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue { 17599 switch fp.selector { 17600 default: 17601 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fp.selector)) 17602 } 17603 } 17604 17605 func (fp *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 17606 return fp.WithIArrayItemValue(value) 17607 } 17608 17609 // DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue allows storing values for ControlPlaneInterfaceInfo fields according to their type 17610 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue interface { 17611 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath 17612 gotenobject.FieldPathValue 17613 SetTo(target **Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 17614 CompareWith(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) (cmp int, comparable bool) 17615 } 17616 17617 func ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue, error) { 17618 fp, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(pathStr) 17619 if err != nil { 17620 return nil, err 17621 } 17622 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 17623 if err != nil { 17624 return nil, status.Errorf(codes.InvalidArgument, "error parsing ControlPlaneInterfaceInfo field path value from %s: %v", valueStr, err) 17625 } 17626 return fpv.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue), nil 17627 } 17628 17629 func MustParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue { 17630 fpv, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue(pathStr, valueStr) 17631 if err != nil { 17632 panic(err) 17633 } 17634 return fpv 17635 } 17636 17637 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue struct { 17638 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath 17639 value interface{} 17640 } 17641 17642 var _ DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathValue = (*DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue)(nil) 17643 17644 // GetRawValue returns raw value stored under selected path for 'ControlPlaneInterfaceInfo' as interface{} 17645 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) GetRawValue() interface{} { 17646 return fpv.value 17647 } 17648 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) AsActiveControlPlaneInterfaceValue() (string, bool) { 17649 res, ok := fpv.value.(string) 17650 return res, ok 17651 } 17652 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) AsUsesProxyValue() (bool, bool) { 17653 res, ok := fpv.value.(bool) 17654 return res, ok 17655 } 17656 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) AsIsFallbackValue() (bool, bool) { 17657 res, ok := fpv.value.(bool) 17658 return res, ok 17659 } 17660 17661 // SetTo stores value for selected field for object ControlPlaneInterfaceInfo 17662 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) { 17663 if *target == nil { 17664 *target = new(Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 17665 } 17666 switch fpv.selector { 17667 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17668 (*target).ActiveControlPlaneInterface = fpv.value.(string) 17669 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17670 (*target).UsesProxy = fpv.value.(bool) 17671 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17672 (*target).IsFallback = fpv.value.(bool) 17673 default: 17674 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fpv.selector)) 17675 } 17676 } 17677 17678 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 17679 typedObject := target.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) 17680 fpv.SetTo(&typedObject) 17681 } 17682 17683 // CompareWith compares value in the 'DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_ControlPlaneInterfaceInfo'. 17684 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) (int, bool) { 17685 switch fpv.selector { 17686 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17687 leftValue := fpv.value.(string) 17688 rightValue := source.GetActiveControlPlaneInterface() 17689 if (leftValue) == (rightValue) { 17690 return 0, true 17691 } else if (leftValue) < (rightValue) { 17692 return -1, true 17693 } else { 17694 return 1, true 17695 } 17696 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17697 leftValue := fpv.value.(bool) 17698 rightValue := source.GetUsesProxy() 17699 if (leftValue) == (rightValue) { 17700 return 0, true 17701 } else if !(leftValue) && (rightValue) { 17702 return -1, true 17703 } else { 17704 return 1, true 17705 } 17706 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17707 leftValue := fpv.value.(bool) 17708 rightValue := source.GetIsFallback() 17709 if (leftValue) == (rightValue) { 17710 return 0, true 17711 } else if !(leftValue) && (rightValue) { 17712 return -1, true 17713 } else { 17714 return 1, true 17715 } 17716 default: 17717 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_ControlPlaneInterfaceInfo: %d", fpv.selector)) 17718 } 17719 } 17720 17721 func (fpv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 17722 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 17723 } 17724 17725 // DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for ControlPlaneInterfaceInfo according to their type 17726 // Present only for array (repeated) types. 17727 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue interface { 17728 gotenobject.FieldPathArrayItemValue 17729 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath 17730 ContainsValue(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) bool 17731 } 17732 17733 // ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 17734 func ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue, error) { 17735 fp, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(pathStr) 17736 if err != nil { 17737 return nil, err 17738 } 17739 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 17740 if err != nil { 17741 return nil, status.Errorf(codes.InvalidArgument, "error parsing ControlPlaneInterfaceInfo field path array item value from %s: %v", valueStr, err) 17742 } 17743 return fpaiv.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue), nil 17744 } 17745 17746 func MustParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue { 17747 fpaiv, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue(pathStr, valueStr) 17748 if err != nil { 17749 panic(err) 17750 } 17751 return fpaiv 17752 } 17753 17754 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayItemValue struct { 17755 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath 17756 value interface{} 17757 } 17758 17759 var _ DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayItemValue)(nil) 17760 17761 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_ControlPlaneInterfaceInfo as interface{} 17762 func (fpaiv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 17763 return fpaiv.value 17764 } 17765 17766 func (fpaiv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) (interface{}, bool) { 17767 return nil, false 17768 } 17769 17770 func (fpaiv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 17771 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_ControlPlaneInterfaceInfo)) 17772 } 17773 17774 // Contains returns a boolean indicating if value that is being held is present in given 'ControlPlaneInterfaceInfo' 17775 func (fpaiv *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_ControlPlaneInterfaceInfo) bool { 17776 slice := fpaiv.DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath.Get(source) 17777 for _, v := range slice { 17778 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 17779 if proto.Equal(asProtoMsg, v.(proto.Message)) { 17780 return true 17781 } 17782 } else if reflect.DeepEqual(v, fpaiv.value) { 17783 return true 17784 } 17785 } 17786 return false 17787 } 17788 17789 // DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues allows storing slice of values for ControlPlaneInterfaceInfo fields according to their type 17790 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues interface { 17791 gotenobject.FieldPathArrayOfValues 17792 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath 17793 } 17794 17795 func ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues, error) { 17796 fp, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPath(pathStr) 17797 if err != nil { 17798 return nil, err 17799 } 17800 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 17801 if err != nil { 17802 return nil, status.Errorf(codes.InvalidArgument, "error parsing ControlPlaneInterfaceInfo field path array of values from %s: %v", valuesStr, err) 17803 } 17804 return fpaov.(DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues), nil 17805 } 17806 17807 func MustParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues { 17808 fpaov, err := ParseDeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues(pathStr, valuesStr) 17809 if err != nil { 17810 panic(err) 17811 } 17812 return fpaov 17813 } 17814 17815 type DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues struct { 17816 DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPath 17817 values interface{} 17818 } 17819 17820 var _ DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues)(nil) 17821 17822 func (fpaov *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 17823 switch fpaov.selector { 17824 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorActiveControlPlaneInterface: 17825 for _, v := range fpaov.values.([]string) { 17826 values = append(values, v) 17827 } 17828 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorUsesProxy: 17829 for _, v := range fpaov.values.([]bool) { 17830 values = append(values, v) 17831 } 17832 case DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldPathSelectorIsFallback: 17833 for _, v := range fpaov.values.([]bool) { 17834 values = append(values, v) 17835 } 17836 } 17837 return 17838 } 17839 func (fpaov *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues) AsActiveControlPlaneInterfaceArrayOfValues() ([]string, bool) { 17840 res, ok := fpaov.values.([]string) 17841 return res, ok 17842 } 17843 func (fpaov *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues) AsUsesProxyArrayOfValues() ([]bool, bool) { 17844 res, ok := fpaov.values.([]bool) 17845 return res, ok 17846 } 17847 func (fpaov *DeviceStatusDeviceInfoControlPlaneInterfaceInfo_FieldTerminalPathArrayOfValues) AsIsFallbackArrayOfValues() ([]bool, bool) { 17848 res, ok := fpaov.values.([]bool) 17849 return res, ok 17850 } 17851 17852 // FieldPath provides implementation to handle 17853 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 17854 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath interface { 17855 gotenobject.FieldPath 17856 Selector() DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector 17857 Get(source *Device_Status_DeviceInfo_HardwareInformation_Capability) []interface{} 17858 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Capability) (interface{}, bool) 17859 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Capability) 17860 17861 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue 17862 // (or array of values) and holds passed value. Panics if injected type is incorrect. 17863 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue 17864 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues 17865 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue 17866 } 17867 17868 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector int32 17869 17870 const ( 17871 DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector = 0 17872 DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector = 1 17873 ) 17874 17875 func (s DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector) String() string { 17876 switch s { 17877 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 17878 return "name" 17879 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 17880 return "description" 17881 default: 17882 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", s)) 17883 } 17884 } 17885 17886 func BuildDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath, error) { 17887 if len(fp) == 0 { 17888 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_Capability") 17889 } 17890 if len(fp) == 1 { 17891 switch fp[0] { 17892 case "name": 17893 return &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName}, nil 17894 case "description": 17895 return &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription}, nil 17896 } 17897 } 17898 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_Capability", fp) 17899 } 17900 17901 func ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath, error) { 17902 fp, err := gotenobject.ParseRawFieldPath(rawField) 17903 if err != nil { 17904 return nil, err 17905 } 17906 return BuildDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(fp) 17907 } 17908 17909 func MustParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath { 17910 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(rawField) 17911 if err != nil { 17912 panic(err) 17913 } 17914 return fp 17915 } 17916 17917 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath struct { 17918 selector DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector 17919 } 17920 17921 var _ DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath)(nil) 17922 17923 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelector { 17924 return fp.selector 17925 } 17926 17927 // String returns path representation in proto convention 17928 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) String() string { 17929 return fp.selector.String() 17930 } 17931 17932 // JSONString returns path representation is JSON convention 17933 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) JSONString() string { 17934 return strcase.ToLowerCamel(fp.String()) 17935 } 17936 17937 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_Capability 17938 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Capability) (values []interface{}) { 17939 if source != nil { 17940 switch fp.selector { 17941 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 17942 values = append(values, source.Name) 17943 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 17944 values = append(values, source.Description) 17945 default: 17946 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 17947 } 17948 } 17949 return 17950 } 17951 17952 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 17953 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 17954 } 17955 17956 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_Capability 17957 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Capability) (interface{}, bool) { 17958 switch fp.selector { 17959 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 17960 return source.GetName(), source != nil 17961 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 17962 return source.GetDescription(), source != nil 17963 default: 17964 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 17965 } 17966 } 17967 17968 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 17969 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 17970 } 17971 17972 // GetDefault returns a default value of the field type 17973 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) GetDefault() interface{} { 17974 switch fp.selector { 17975 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 17976 return "" 17977 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 17978 return "" 17979 default: 17980 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 17981 } 17982 } 17983 17984 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Capability) { 17985 if item != nil { 17986 switch fp.selector { 17987 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 17988 item.Name = "" 17989 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 17990 item.Description = "" 17991 default: 17992 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 17993 } 17994 } 17995 } 17996 17997 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) ClearValueRaw(item proto.Message) { 17998 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 17999 } 18000 18001 // IsLeaf - whether field path is holds simple value 18002 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) IsLeaf() bool { 18003 return fp.selector == DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName || 18004 fp.selector == DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription 18005 } 18006 18007 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 18008 return []gotenobject.FieldPath{fp} 18009 } 18010 18011 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue { 18012 switch fp.selector { 18013 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 18014 return &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: *fp, value: value.(string)} 18015 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 18016 return &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: *fp, value: value.(string)} 18017 default: 18018 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 18019 } 18020 } 18021 18022 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 18023 return fp.WithIValue(value) 18024 } 18025 18026 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues { 18027 fpaov := &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: *fp} 18028 switch fp.selector { 18029 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 18030 return &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: *fp, values: values.([]string)} 18031 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 18032 return &DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath: *fp, values: values.([]string)} 18033 default: 18034 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 18035 } 18036 return fpaov 18037 } 18038 18039 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 18040 return fp.WithIArrayOfValues(values) 18041 } 18042 18043 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue { 18044 switch fp.selector { 18045 default: 18046 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fp.selector)) 18047 } 18048 } 18049 18050 func (fp *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 18051 return fp.WithIArrayItemValue(value) 18052 } 18053 18054 // DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue allows storing values for Capability fields according to their type 18055 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue interface { 18056 DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath 18057 gotenobject.FieldPathValue 18058 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Capability) 18059 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_Capability) (cmp int, comparable bool) 18060 } 18061 18062 func ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue, error) { 18063 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(pathStr) 18064 if err != nil { 18065 return nil, err 18066 } 18067 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 18068 if err != nil { 18069 return nil, status.Errorf(codes.InvalidArgument, "error parsing Capability field path value from %s: %v", valueStr, err) 18070 } 18071 return fpv.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue), nil 18072 } 18073 18074 func MustParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue { 18075 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue(pathStr, valueStr) 18076 if err != nil { 18077 panic(err) 18078 } 18079 return fpv 18080 } 18081 18082 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue struct { 18083 DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath 18084 value interface{} 18085 } 18086 18087 var _ DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue)(nil) 18088 18089 // GetRawValue returns raw value stored under selected path for 'Capability' as interface{} 18090 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) GetRawValue() interface{} { 18091 return fpv.value 18092 } 18093 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) AsNameValue() (string, bool) { 18094 res, ok := fpv.value.(string) 18095 return res, ok 18096 } 18097 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 18098 res, ok := fpv.value.(string) 18099 return res, ok 18100 } 18101 18102 // SetTo stores value for selected field for object Capability 18103 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Capability) { 18104 if *target == nil { 18105 *target = new(Device_Status_DeviceInfo_HardwareInformation_Capability) 18106 } 18107 switch fpv.selector { 18108 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 18109 (*target).Name = fpv.value.(string) 18110 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 18111 (*target).Description = fpv.value.(string) 18112 default: 18113 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fpv.selector)) 18114 } 18115 } 18116 18117 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) SetToRaw(target proto.Message) { 18118 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Capability) 18119 fpv.SetTo(&typedObject) 18120 } 18121 18122 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Capability'. 18123 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Capability) (int, bool) { 18124 switch fpv.selector { 18125 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 18126 leftValue := fpv.value.(string) 18127 rightValue := source.GetName() 18128 if (leftValue) == (rightValue) { 18129 return 0, true 18130 } else if (leftValue) < (rightValue) { 18131 return -1, true 18132 } else { 18133 return 1, true 18134 } 18135 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 18136 leftValue := fpv.value.(string) 18137 rightValue := source.GetDescription() 18138 if (leftValue) == (rightValue) { 18139 return 0, true 18140 } else if (leftValue) < (rightValue) { 18141 return -1, true 18142 } else { 18143 return 1, true 18144 } 18145 default: 18146 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Capability: %d", fpv.selector)) 18147 } 18148 } 18149 18150 func (fpv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 18151 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 18152 } 18153 18154 // DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue allows storing single item in Path-specific values for Capability according to their type 18155 // Present only for array (repeated) types. 18156 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue interface { 18157 gotenobject.FieldPathArrayItemValue 18158 DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath 18159 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_Capability) bool 18160 } 18161 18162 // ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 18163 func ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue, error) { 18164 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(pathStr) 18165 if err != nil { 18166 return nil, err 18167 } 18168 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 18169 if err != nil { 18170 return nil, status.Errorf(codes.InvalidArgument, "error parsing Capability field path array item value from %s: %v", valueStr, err) 18171 } 18172 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue), nil 18173 } 18174 18175 func MustParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue { 18176 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue(pathStr, valueStr) 18177 if err != nil { 18178 panic(err) 18179 } 18180 return fpaiv 18181 } 18182 18183 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayItemValue struct { 18184 DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath 18185 value interface{} 18186 } 18187 18188 var _ DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayItemValue)(nil) 18189 18190 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_Capability as interface{} 18191 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 18192 return fpaiv.value 18193 } 18194 18195 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Capability) (interface{}, bool) { 18196 return nil, false 18197 } 18198 18199 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 18200 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Capability)) 18201 } 18202 18203 // Contains returns a boolean indicating if value that is being held is present in given 'Capability' 18204 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Capability) bool { 18205 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath.Get(source) 18206 for _, v := range slice { 18207 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 18208 if proto.Equal(asProtoMsg, v.(proto.Message)) { 18209 return true 18210 } 18211 } else if reflect.DeepEqual(v, fpaiv.value) { 18212 return true 18213 } 18214 } 18215 return false 18216 } 18217 18218 // DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues allows storing slice of values for Capability fields according to their type 18219 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues interface { 18220 gotenobject.FieldPathArrayOfValues 18221 DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath 18222 } 18223 18224 func ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues, error) { 18225 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(pathStr) 18226 if err != nil { 18227 return nil, err 18228 } 18229 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 18230 if err != nil { 18231 return nil, status.Errorf(codes.InvalidArgument, "error parsing Capability field path array of values from %s: %v", valuesStr, err) 18232 } 18233 return fpaov.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues), nil 18234 } 18235 18236 func MustParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues { 18237 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues(pathStr, valuesStr) 18238 if err != nil { 18239 panic(err) 18240 } 18241 return fpaov 18242 } 18243 18244 type DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues struct { 18245 DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPath 18246 values interface{} 18247 } 18248 18249 var _ DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues)(nil) 18250 18251 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 18252 switch fpaov.selector { 18253 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorName: 18254 for _, v := range fpaov.values.([]string) { 18255 values = append(values, v) 18256 } 18257 case DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathSelectorDescription: 18258 for _, v := range fpaov.values.([]string) { 18259 values = append(values, v) 18260 } 18261 } 18262 return 18263 } 18264 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 18265 res, ok := fpaov.values.([]string) 18266 return res, ok 18267 } 18268 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCapability_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 18269 res, ok := fpaov.values.([]string) 18270 return res, ok 18271 } 18272 18273 // FieldPath provides implementation to handle 18274 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 18275 type DeviceStatusDeviceInfoHardwareInformationOS_FieldPath interface { 18276 gotenobject.FieldPath 18277 Selector() DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector 18278 Get(source *Device_Status_DeviceInfo_HardwareInformation_OS) []interface{} 18279 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_OS) (interface{}, bool) 18280 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_OS) 18281 18282 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue 18283 // (or array of values) and holds passed value. Panics if injected type is incorrect. 18284 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue 18285 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues 18286 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue 18287 } 18288 18289 type DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector int32 18290 18291 const ( 18292 DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector = 0 18293 DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector = 1 18294 DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector = 2 18295 DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector = 3 18296 ) 18297 18298 func (s DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector) String() string { 18299 switch s { 18300 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18301 return "operating_system" 18302 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18303 return "kernel_version" 18304 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18305 return "os_image" 18306 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18307 return "container_runtime_version" 18308 default: 18309 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", s)) 18310 } 18311 } 18312 18313 func BuildDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationOS_FieldPath, error) { 18314 if len(fp) == 0 { 18315 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_OS") 18316 } 18317 if len(fp) == 1 { 18318 switch fp[0] { 18319 case "operating_system", "operatingSystem", "operating-system": 18320 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem}, nil 18321 case "kernel_version", "kernelVersion", "kernel-version": 18322 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion}, nil 18323 case "os_image", "osImage", "os-image": 18324 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage}, nil 18325 case "container_runtime_version", "containerRuntimeVersion", "container-runtime-version": 18326 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion}, nil 18327 } 18328 } 18329 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_OS", fp) 18330 } 18331 18332 func ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationOS_FieldPath, error) { 18333 fp, err := gotenobject.ParseRawFieldPath(rawField) 18334 if err != nil { 18335 return nil, err 18336 } 18337 return BuildDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(fp) 18338 } 18339 18340 func MustParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationOS_FieldPath { 18341 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(rawField) 18342 if err != nil { 18343 panic(err) 18344 } 18345 return fp 18346 } 18347 18348 type DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath struct { 18349 selector DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector 18350 } 18351 18352 var _ DeviceStatusDeviceInfoHardwareInformationOS_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath)(nil) 18353 18354 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelector { 18355 return fp.selector 18356 } 18357 18358 // String returns path representation in proto convention 18359 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) String() string { 18360 return fp.selector.String() 18361 } 18362 18363 // JSONString returns path representation is JSON convention 18364 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) JSONString() string { 18365 return strcase.ToLowerCamel(fp.String()) 18366 } 18367 18368 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_OS 18369 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_OS) (values []interface{}) { 18370 if source != nil { 18371 switch fp.selector { 18372 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18373 values = append(values, source.OperatingSystem) 18374 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18375 values = append(values, source.KernelVersion) 18376 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18377 values = append(values, source.OsImage) 18378 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18379 values = append(values, source.ContainerRuntimeVersion) 18380 default: 18381 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18382 } 18383 } 18384 return 18385 } 18386 18387 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 18388 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 18389 } 18390 18391 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_OS 18392 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_OS) (interface{}, bool) { 18393 switch fp.selector { 18394 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18395 return source.GetOperatingSystem(), source != nil 18396 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18397 return source.GetKernelVersion(), source != nil 18398 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18399 return source.GetOsImage(), source != nil 18400 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18401 return source.GetContainerRuntimeVersion(), source != nil 18402 default: 18403 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18404 } 18405 } 18406 18407 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 18408 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 18409 } 18410 18411 // GetDefault returns a default value of the field type 18412 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) GetDefault() interface{} { 18413 switch fp.selector { 18414 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18415 return "" 18416 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18417 return "" 18418 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18419 return "" 18420 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18421 return "" 18422 default: 18423 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18424 } 18425 } 18426 18427 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_OS) { 18428 if item != nil { 18429 switch fp.selector { 18430 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18431 item.OperatingSystem = "" 18432 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18433 item.KernelVersion = "" 18434 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18435 item.OsImage = "" 18436 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18437 item.ContainerRuntimeVersion = "" 18438 default: 18439 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18440 } 18441 } 18442 } 18443 18444 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) ClearValueRaw(item proto.Message) { 18445 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 18446 } 18447 18448 // IsLeaf - whether field path is holds simple value 18449 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) IsLeaf() bool { 18450 return fp.selector == DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem || 18451 fp.selector == DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion || 18452 fp.selector == DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage || 18453 fp.selector == DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion 18454 } 18455 18456 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 18457 return []gotenobject.FieldPath{fp} 18458 } 18459 18460 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue { 18461 switch fp.selector { 18462 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18463 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, value: value.(string)} 18464 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18465 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, value: value.(string)} 18466 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18467 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, value: value.(string)} 18468 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18469 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, value: value.(string)} 18470 default: 18471 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18472 } 18473 } 18474 18475 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 18476 return fp.WithIValue(value) 18477 } 18478 18479 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues { 18480 fpaov := &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp} 18481 switch fp.selector { 18482 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18483 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, values: values.([]string)} 18484 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18485 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, values: values.([]string)} 18486 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18487 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, values: values.([]string)} 18488 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18489 return &DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath: *fp, values: values.([]string)} 18490 default: 18491 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18492 } 18493 return fpaov 18494 } 18495 18496 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 18497 return fp.WithIArrayOfValues(values) 18498 } 18499 18500 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue { 18501 switch fp.selector { 18502 default: 18503 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fp.selector)) 18504 } 18505 } 18506 18507 func (fp *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 18508 return fp.WithIArrayItemValue(value) 18509 } 18510 18511 // DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue allows storing values for OS fields according to their type 18512 type DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue interface { 18513 DeviceStatusDeviceInfoHardwareInformationOS_FieldPath 18514 gotenobject.FieldPathValue 18515 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_OS) 18516 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_OS) (cmp int, comparable bool) 18517 } 18518 18519 func ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue, error) { 18520 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(pathStr) 18521 if err != nil { 18522 return nil, err 18523 } 18524 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 18525 if err != nil { 18526 return nil, status.Errorf(codes.InvalidArgument, "error parsing OS field path value from %s: %v", valueStr, err) 18527 } 18528 return fpv.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue), nil 18529 } 18530 18531 func MustParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue { 18532 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue(pathStr, valueStr) 18533 if err != nil { 18534 panic(err) 18535 } 18536 return fpv 18537 } 18538 18539 type DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue struct { 18540 DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath 18541 value interface{} 18542 } 18543 18544 var _ DeviceStatusDeviceInfoHardwareInformationOS_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue)(nil) 18545 18546 // GetRawValue returns raw value stored under selected path for 'OS' as interface{} 18547 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) GetRawValue() interface{} { 18548 return fpv.value 18549 } 18550 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) AsOperatingSystemValue() (string, bool) { 18551 res, ok := fpv.value.(string) 18552 return res, ok 18553 } 18554 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) AsKernelVersionValue() (string, bool) { 18555 res, ok := fpv.value.(string) 18556 return res, ok 18557 } 18558 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) AsOsImageValue() (string, bool) { 18559 res, ok := fpv.value.(string) 18560 return res, ok 18561 } 18562 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) AsContainerRuntimeVersionValue() (string, bool) { 18563 res, ok := fpv.value.(string) 18564 return res, ok 18565 } 18566 18567 // SetTo stores value for selected field for object OS 18568 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_OS) { 18569 if *target == nil { 18570 *target = new(Device_Status_DeviceInfo_HardwareInformation_OS) 18571 } 18572 switch fpv.selector { 18573 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18574 (*target).OperatingSystem = fpv.value.(string) 18575 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18576 (*target).KernelVersion = fpv.value.(string) 18577 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18578 (*target).OsImage = fpv.value.(string) 18579 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18580 (*target).ContainerRuntimeVersion = fpv.value.(string) 18581 default: 18582 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fpv.selector)) 18583 } 18584 } 18585 18586 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) SetToRaw(target proto.Message) { 18587 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_OS) 18588 fpv.SetTo(&typedObject) 18589 } 18590 18591 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_OS'. 18592 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_OS) (int, bool) { 18593 switch fpv.selector { 18594 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18595 leftValue := fpv.value.(string) 18596 rightValue := source.GetOperatingSystem() 18597 if (leftValue) == (rightValue) { 18598 return 0, true 18599 } else if (leftValue) < (rightValue) { 18600 return -1, true 18601 } else { 18602 return 1, true 18603 } 18604 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18605 leftValue := fpv.value.(string) 18606 rightValue := source.GetKernelVersion() 18607 if (leftValue) == (rightValue) { 18608 return 0, true 18609 } else if (leftValue) < (rightValue) { 18610 return -1, true 18611 } else { 18612 return 1, true 18613 } 18614 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18615 leftValue := fpv.value.(string) 18616 rightValue := source.GetOsImage() 18617 if (leftValue) == (rightValue) { 18618 return 0, true 18619 } else if (leftValue) < (rightValue) { 18620 return -1, true 18621 } else { 18622 return 1, true 18623 } 18624 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18625 leftValue := fpv.value.(string) 18626 rightValue := source.GetContainerRuntimeVersion() 18627 if (leftValue) == (rightValue) { 18628 return 0, true 18629 } else if (leftValue) < (rightValue) { 18630 return -1, true 18631 } else { 18632 return 1, true 18633 } 18634 default: 18635 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_OS: %d", fpv.selector)) 18636 } 18637 } 18638 18639 func (fpv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 18640 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 18641 } 18642 18643 // DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue allows storing single item in Path-specific values for OS according to their type 18644 // Present only for array (repeated) types. 18645 type DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue interface { 18646 gotenobject.FieldPathArrayItemValue 18647 DeviceStatusDeviceInfoHardwareInformationOS_FieldPath 18648 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_OS) bool 18649 } 18650 18651 // ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 18652 func ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue, error) { 18653 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(pathStr) 18654 if err != nil { 18655 return nil, err 18656 } 18657 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 18658 if err != nil { 18659 return nil, status.Errorf(codes.InvalidArgument, "error parsing OS field path array item value from %s: %v", valueStr, err) 18660 } 18661 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue), nil 18662 } 18663 18664 func MustParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue { 18665 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue(pathStr, valueStr) 18666 if err != nil { 18667 panic(err) 18668 } 18669 return fpaiv 18670 } 18671 18672 type DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayItemValue struct { 18673 DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath 18674 value interface{} 18675 } 18676 18677 var _ DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayItemValue)(nil) 18678 18679 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_OS as interface{} 18680 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 18681 return fpaiv.value 18682 } 18683 18684 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_OS) (interface{}, bool) { 18685 return nil, false 18686 } 18687 18688 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 18689 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_OS)) 18690 } 18691 18692 // Contains returns a boolean indicating if value that is being held is present in given 'OS' 18693 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_OS) bool { 18694 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath.Get(source) 18695 for _, v := range slice { 18696 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 18697 if proto.Equal(asProtoMsg, v.(proto.Message)) { 18698 return true 18699 } 18700 } else if reflect.DeepEqual(v, fpaiv.value) { 18701 return true 18702 } 18703 } 18704 return false 18705 } 18706 18707 // DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues allows storing slice of values for OS fields according to their type 18708 type DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues interface { 18709 gotenobject.FieldPathArrayOfValues 18710 DeviceStatusDeviceInfoHardwareInformationOS_FieldPath 18711 } 18712 18713 func ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues, error) { 18714 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPath(pathStr) 18715 if err != nil { 18716 return nil, err 18717 } 18718 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 18719 if err != nil { 18720 return nil, status.Errorf(codes.InvalidArgument, "error parsing OS field path array of values from %s: %v", valuesStr, err) 18721 } 18722 return fpaov.(DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues), nil 18723 } 18724 18725 func MustParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues { 18726 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues(pathStr, valuesStr) 18727 if err != nil { 18728 panic(err) 18729 } 18730 return fpaov 18731 } 18732 18733 type DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues struct { 18734 DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPath 18735 values interface{} 18736 } 18737 18738 var _ DeviceStatusDeviceInfoHardwareInformationOS_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues)(nil) 18739 18740 func (fpaov *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 18741 switch fpaov.selector { 18742 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOperatingSystem: 18743 for _, v := range fpaov.values.([]string) { 18744 values = append(values, v) 18745 } 18746 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorKernelVersion: 18747 for _, v := range fpaov.values.([]string) { 18748 values = append(values, v) 18749 } 18750 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorOsImage: 18751 for _, v := range fpaov.values.([]string) { 18752 values = append(values, v) 18753 } 18754 case DeviceStatusDeviceInfoHardwareInformationOS_FieldPathSelectorContainerRuntimeVersion: 18755 for _, v := range fpaov.values.([]string) { 18756 values = append(values, v) 18757 } 18758 } 18759 return 18760 } 18761 func (fpaov *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues) AsOperatingSystemArrayOfValues() ([]string, bool) { 18762 res, ok := fpaov.values.([]string) 18763 return res, ok 18764 } 18765 func (fpaov *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues) AsKernelVersionArrayOfValues() ([]string, bool) { 18766 res, ok := fpaov.values.([]string) 18767 return res, ok 18768 } 18769 func (fpaov *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues) AsOsImageArrayOfValues() ([]string, bool) { 18770 res, ok := fpaov.values.([]string) 18771 return res, ok 18772 } 18773 func (fpaov *DeviceStatusDeviceInfoHardwareInformationOS_FieldTerminalPathArrayOfValues) AsContainerRuntimeVersionArrayOfValues() ([]string, bool) { 18774 res, ok := fpaov.values.([]string) 18775 return res, ok 18776 } 18777 18778 // FieldPath provides implementation to handle 18779 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 18780 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath interface { 18781 gotenobject.FieldPath 18782 Selector() DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector 18783 Get(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) []interface{} 18784 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) (interface{}, bool) 18785 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_BIOS) 18786 18787 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue 18788 // (or array of values) and holds passed value. Panics if injected type is incorrect. 18789 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue 18790 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues 18791 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue 18792 } 18793 18794 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector int32 18795 18796 const ( 18797 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector = 0 18798 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector = 1 18799 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector = 2 18800 ) 18801 18802 func (s DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector) String() string { 18803 switch s { 18804 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18805 return "vendor" 18806 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18807 return "bios_version" 18808 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18809 return "release_date" 18810 default: 18811 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", s)) 18812 } 18813 } 18814 18815 func BuildDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath, error) { 18816 if len(fp) == 0 { 18817 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_BIOS") 18818 } 18819 if len(fp) == 1 { 18820 switch fp[0] { 18821 case "vendor": 18822 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor}, nil 18823 case "bios_version", "biosVersion", "bios-version": 18824 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion}, nil 18825 case "release_date", "releaseDate", "release-date": 18826 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate}, nil 18827 } 18828 } 18829 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_BIOS", fp) 18830 } 18831 18832 func ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath, error) { 18833 fp, err := gotenobject.ParseRawFieldPath(rawField) 18834 if err != nil { 18835 return nil, err 18836 } 18837 return BuildDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(fp) 18838 } 18839 18840 func MustParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath { 18841 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(rawField) 18842 if err != nil { 18843 panic(err) 18844 } 18845 return fp 18846 } 18847 18848 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath struct { 18849 selector DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector 18850 } 18851 18852 var _ DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath)(nil) 18853 18854 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelector { 18855 return fp.selector 18856 } 18857 18858 // String returns path representation in proto convention 18859 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) String() string { 18860 return fp.selector.String() 18861 } 18862 18863 // JSONString returns path representation is JSON convention 18864 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) JSONString() string { 18865 return strcase.ToLowerCamel(fp.String()) 18866 } 18867 18868 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_BIOS 18869 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) (values []interface{}) { 18870 if source != nil { 18871 switch fp.selector { 18872 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18873 values = append(values, source.Vendor) 18874 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18875 values = append(values, source.BiosVersion) 18876 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18877 values = append(values, source.ReleaseDate) 18878 default: 18879 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18880 } 18881 } 18882 return 18883 } 18884 18885 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 18886 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 18887 } 18888 18889 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_BIOS 18890 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) (interface{}, bool) { 18891 switch fp.selector { 18892 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18893 return source.GetVendor(), source != nil 18894 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18895 return source.GetBiosVersion(), source != nil 18896 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18897 return source.GetReleaseDate(), source != nil 18898 default: 18899 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18900 } 18901 } 18902 18903 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 18904 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 18905 } 18906 18907 // GetDefault returns a default value of the field type 18908 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) GetDefault() interface{} { 18909 switch fp.selector { 18910 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18911 return "" 18912 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18913 return "" 18914 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18915 return "" 18916 default: 18917 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18918 } 18919 } 18920 18921 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_BIOS) { 18922 if item != nil { 18923 switch fp.selector { 18924 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18925 item.Vendor = "" 18926 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18927 item.BiosVersion = "" 18928 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18929 item.ReleaseDate = "" 18930 default: 18931 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18932 } 18933 } 18934 } 18935 18936 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) ClearValueRaw(item proto.Message) { 18937 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 18938 } 18939 18940 // IsLeaf - whether field path is holds simple value 18941 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) IsLeaf() bool { 18942 return fp.selector == DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor || 18943 fp.selector == DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion || 18944 fp.selector == DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate 18945 } 18946 18947 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 18948 return []gotenobject.FieldPath{fp} 18949 } 18950 18951 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue { 18952 switch fp.selector { 18953 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18954 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp, value: value.(string)} 18955 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18956 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp, value: value.(string)} 18957 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18958 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp, value: value.(string)} 18959 default: 18960 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18961 } 18962 } 18963 18964 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 18965 return fp.WithIValue(value) 18966 } 18967 18968 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues { 18969 fpaov := &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp} 18970 switch fp.selector { 18971 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 18972 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp, values: values.([]string)} 18973 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 18974 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp, values: values.([]string)} 18975 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 18976 return &DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath: *fp, values: values.([]string)} 18977 default: 18978 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18979 } 18980 return fpaov 18981 } 18982 18983 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 18984 return fp.WithIArrayOfValues(values) 18985 } 18986 18987 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue { 18988 switch fp.selector { 18989 default: 18990 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fp.selector)) 18991 } 18992 } 18993 18994 func (fp *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 18995 return fp.WithIArrayItemValue(value) 18996 } 18997 18998 // DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue allows storing values for BIOS fields according to their type 18999 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue interface { 19000 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath 19001 gotenobject.FieldPathValue 19002 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_BIOS) 19003 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_BIOS) (cmp int, comparable bool) 19004 } 19005 19006 func ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue, error) { 19007 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(pathStr) 19008 if err != nil { 19009 return nil, err 19010 } 19011 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 19012 if err != nil { 19013 return nil, status.Errorf(codes.InvalidArgument, "error parsing BIOS field path value from %s: %v", valueStr, err) 19014 } 19015 return fpv.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue), nil 19016 } 19017 19018 func MustParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue { 19019 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue(pathStr, valueStr) 19020 if err != nil { 19021 panic(err) 19022 } 19023 return fpv 19024 } 19025 19026 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue struct { 19027 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath 19028 value interface{} 19029 } 19030 19031 var _ DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue)(nil) 19032 19033 // GetRawValue returns raw value stored under selected path for 'BIOS' as interface{} 19034 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) GetRawValue() interface{} { 19035 return fpv.value 19036 } 19037 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) AsVendorValue() (string, bool) { 19038 res, ok := fpv.value.(string) 19039 return res, ok 19040 } 19041 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) AsBiosVersionValue() (string, bool) { 19042 res, ok := fpv.value.(string) 19043 return res, ok 19044 } 19045 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) AsReleaseDateValue() (string, bool) { 19046 res, ok := fpv.value.(string) 19047 return res, ok 19048 } 19049 19050 // SetTo stores value for selected field for object BIOS 19051 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_BIOS) { 19052 if *target == nil { 19053 *target = new(Device_Status_DeviceInfo_HardwareInformation_BIOS) 19054 } 19055 switch fpv.selector { 19056 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 19057 (*target).Vendor = fpv.value.(string) 19058 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 19059 (*target).BiosVersion = fpv.value.(string) 19060 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 19061 (*target).ReleaseDate = fpv.value.(string) 19062 default: 19063 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fpv.selector)) 19064 } 19065 } 19066 19067 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) SetToRaw(target proto.Message) { 19068 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_BIOS) 19069 fpv.SetTo(&typedObject) 19070 } 19071 19072 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_BIOS'. 19073 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) (int, bool) { 19074 switch fpv.selector { 19075 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 19076 leftValue := fpv.value.(string) 19077 rightValue := source.GetVendor() 19078 if (leftValue) == (rightValue) { 19079 return 0, true 19080 } else if (leftValue) < (rightValue) { 19081 return -1, true 19082 } else { 19083 return 1, true 19084 } 19085 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 19086 leftValue := fpv.value.(string) 19087 rightValue := source.GetBiosVersion() 19088 if (leftValue) == (rightValue) { 19089 return 0, true 19090 } else if (leftValue) < (rightValue) { 19091 return -1, true 19092 } else { 19093 return 1, true 19094 } 19095 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 19096 leftValue := fpv.value.(string) 19097 rightValue := source.GetReleaseDate() 19098 if (leftValue) == (rightValue) { 19099 return 0, true 19100 } else if (leftValue) < (rightValue) { 19101 return -1, true 19102 } else { 19103 return 1, true 19104 } 19105 default: 19106 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_BIOS: %d", fpv.selector)) 19107 } 19108 } 19109 19110 func (fpv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 19111 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 19112 } 19113 19114 // DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue allows storing single item in Path-specific values for BIOS according to their type 19115 // Present only for array (repeated) types. 19116 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue interface { 19117 gotenobject.FieldPathArrayItemValue 19118 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath 19119 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_BIOS) bool 19120 } 19121 19122 // ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 19123 func ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue, error) { 19124 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(pathStr) 19125 if err != nil { 19126 return nil, err 19127 } 19128 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 19129 if err != nil { 19130 return nil, status.Errorf(codes.InvalidArgument, "error parsing BIOS field path array item value from %s: %v", valueStr, err) 19131 } 19132 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue), nil 19133 } 19134 19135 func MustParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue { 19136 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue(pathStr, valueStr) 19137 if err != nil { 19138 panic(err) 19139 } 19140 return fpaiv 19141 } 19142 19143 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayItemValue struct { 19144 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath 19145 value interface{} 19146 } 19147 19148 var _ DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayItemValue)(nil) 19149 19150 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_BIOS as interface{} 19151 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 19152 return fpaiv.value 19153 } 19154 19155 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) (interface{}, bool) { 19156 return nil, false 19157 } 19158 19159 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 19160 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_BIOS)) 19161 } 19162 19163 // Contains returns a boolean indicating if value that is being held is present in given 'BIOS' 19164 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_BIOS) bool { 19165 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath.Get(source) 19166 for _, v := range slice { 19167 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 19168 if proto.Equal(asProtoMsg, v.(proto.Message)) { 19169 return true 19170 } 19171 } else if reflect.DeepEqual(v, fpaiv.value) { 19172 return true 19173 } 19174 } 19175 return false 19176 } 19177 19178 // DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues allows storing slice of values for BIOS fields according to their type 19179 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues interface { 19180 gotenobject.FieldPathArrayOfValues 19181 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath 19182 } 19183 19184 func ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues, error) { 19185 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPath(pathStr) 19186 if err != nil { 19187 return nil, err 19188 } 19189 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 19190 if err != nil { 19191 return nil, status.Errorf(codes.InvalidArgument, "error parsing BIOS field path array of values from %s: %v", valuesStr, err) 19192 } 19193 return fpaov.(DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues), nil 19194 } 19195 19196 func MustParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues { 19197 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues(pathStr, valuesStr) 19198 if err != nil { 19199 panic(err) 19200 } 19201 return fpaov 19202 } 19203 19204 type DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues struct { 19205 DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPath 19206 values interface{} 19207 } 19208 19209 var _ DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues)(nil) 19210 19211 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 19212 switch fpaov.selector { 19213 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorVendor: 19214 for _, v := range fpaov.values.([]string) { 19215 values = append(values, v) 19216 } 19217 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorBiosVersion: 19218 for _, v := range fpaov.values.([]string) { 19219 values = append(values, v) 19220 } 19221 case DeviceStatusDeviceInfoHardwareInformationBIOS_FieldPathSelectorReleaseDate: 19222 for _, v := range fpaov.values.([]string) { 19223 values = append(values, v) 19224 } 19225 } 19226 return 19227 } 19228 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues) AsVendorArrayOfValues() ([]string, bool) { 19229 res, ok := fpaov.values.([]string) 19230 return res, ok 19231 } 19232 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues) AsBiosVersionArrayOfValues() ([]string, bool) { 19233 res, ok := fpaov.values.([]string) 19234 return res, ok 19235 } 19236 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBIOS_FieldTerminalPathArrayOfValues) AsReleaseDateArrayOfValues() ([]string, bool) { 19237 res, ok := fpaov.values.([]string) 19238 return res, ok 19239 } 19240 19241 // FieldPath provides implementation to handle 19242 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 19243 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath interface { 19244 gotenobject.FieldPath 19245 Selector() DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector 19246 Get(source *Device_Status_DeviceInfo_HardwareInformation_System) []interface{} 19247 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System) (interface{}, bool) 19248 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_System) 19249 19250 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue 19251 // (or array of values) and holds passed value. Panics if injected type is incorrect. 19252 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue 19253 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues 19254 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue 19255 } 19256 19257 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector int32 19258 19259 const ( 19260 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector = 0 19261 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector = 1 19262 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector = 2 19263 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector = 3 19264 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector = 4 19265 ) 19266 19267 func (s DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector) String() string { 19268 switch s { 19269 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19270 return "manufacturer" 19271 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19272 return "product_name" 19273 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19274 return "version" 19275 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19276 return "serial_number" 19277 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19278 return "configuration" 19279 default: 19280 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", s)) 19281 } 19282 } 19283 19284 func BuildDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath, error) { 19285 if len(fp) == 0 { 19286 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_System") 19287 } 19288 if len(fp) == 1 { 19289 switch fp[0] { 19290 case "manufacturer": 19291 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer}, nil 19292 case "product_name", "productName", "product-name": 19293 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName}, nil 19294 case "version": 19295 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion}, nil 19296 case "serial_number", "serialNumber", "serial-number": 19297 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber}, nil 19298 case "configuration": 19299 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration}, nil 19300 } 19301 } else { 19302 switch fp[0] { 19303 case "configuration": 19304 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(fp[1:]); err != nil { 19305 return nil, err 19306 } else { 19307 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration, subPath: subpath}, nil 19308 } 19309 } 19310 } 19311 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_System", fp) 19312 } 19313 19314 func ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath, error) { 19315 fp, err := gotenobject.ParseRawFieldPath(rawField) 19316 if err != nil { 19317 return nil, err 19318 } 19319 return BuildDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(fp) 19320 } 19321 19322 func MustParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath { 19323 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(rawField) 19324 if err != nil { 19325 panic(err) 19326 } 19327 return fp 19328 } 19329 19330 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath struct { 19331 selector DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector 19332 } 19333 19334 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath)(nil) 19335 19336 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector { 19337 return fp.selector 19338 } 19339 19340 // String returns path representation in proto convention 19341 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) String() string { 19342 return fp.selector.String() 19343 } 19344 19345 // JSONString returns path representation is JSON convention 19346 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) JSONString() string { 19347 return strcase.ToLowerCamel(fp.String()) 19348 } 19349 19350 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_System 19351 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_System) (values []interface{}) { 19352 if source != nil { 19353 switch fp.selector { 19354 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19355 values = append(values, source.Manufacturer) 19356 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19357 values = append(values, source.ProductName) 19358 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19359 values = append(values, source.Version) 19360 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19361 values = append(values, source.SerialNumber) 19362 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19363 if source.Configuration != nil { 19364 values = append(values, source.Configuration) 19365 } 19366 default: 19367 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19368 } 19369 } 19370 return 19371 } 19372 19373 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 19374 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19375 } 19376 19377 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_System 19378 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System) (interface{}, bool) { 19379 switch fp.selector { 19380 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19381 return source.GetManufacturer(), source != nil 19382 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19383 return source.GetProductName(), source != nil 19384 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19385 return source.GetVersion(), source != nil 19386 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19387 return source.GetSerialNumber(), source != nil 19388 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19389 res := source.GetConfiguration() 19390 return res, res != nil 19391 default: 19392 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19393 } 19394 } 19395 19396 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 19397 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19398 } 19399 19400 // GetDefault returns a default value of the field type 19401 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) GetDefault() interface{} { 19402 switch fp.selector { 19403 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19404 return "" 19405 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19406 return "" 19407 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19408 return "" 19409 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19410 return "" 19411 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19412 return (*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)(nil) 19413 default: 19414 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19415 } 19416 } 19417 19418 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_System) { 19419 if item != nil { 19420 switch fp.selector { 19421 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19422 item.Manufacturer = "" 19423 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19424 item.ProductName = "" 19425 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19426 item.Version = "" 19427 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19428 item.SerialNumber = "" 19429 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19430 item.Configuration = nil 19431 default: 19432 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19433 } 19434 } 19435 } 19436 19437 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) ClearValueRaw(item proto.Message) { 19438 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19439 } 19440 19441 // IsLeaf - whether field path is holds simple value 19442 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) IsLeaf() bool { 19443 return fp.selector == DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer || 19444 fp.selector == DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName || 19445 fp.selector == DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion || 19446 fp.selector == DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber 19447 } 19448 19449 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 19450 return []gotenobject.FieldPath{fp} 19451 } 19452 19453 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue { 19454 switch fp.selector { 19455 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19456 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, value: value.(string)} 19457 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19458 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, value: value.(string)} 19459 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19460 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, value: value.(string)} 19461 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19462 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, value: value.(string)} 19463 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19464 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)} 19465 default: 19466 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19467 } 19468 } 19469 19470 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 19471 return fp.WithIValue(value) 19472 } 19473 19474 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues { 19475 fpaov := &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp} 19476 switch fp.selector { 19477 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19478 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, values: values.([]string)} 19479 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19480 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, values: values.([]string)} 19481 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19482 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, values: values.([]string)} 19483 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19484 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, values: values.([]string)} 19485 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19486 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)} 19487 default: 19488 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19489 } 19490 return fpaov 19491 } 19492 19493 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 19494 return fp.WithIArrayOfValues(values) 19495 } 19496 19497 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue { 19498 switch fp.selector { 19499 default: 19500 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fp.selector)) 19501 } 19502 } 19503 19504 func (fp *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 19505 return fp.WithIArrayItemValue(value) 19506 } 19507 19508 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath struct { 19509 selector DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector 19510 subPath gotenobject.FieldPath 19511 } 19512 19513 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath)(nil) 19514 19515 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelector { 19516 return fps.selector 19517 } 19518 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) AsConfigurationSubPath() (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath, bool) { 19519 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath) 19520 return res, ok 19521 } 19522 19523 // String returns path representation in proto convention 19524 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) String() string { 19525 return fps.selector.String() + "." + fps.subPath.String() 19526 } 19527 19528 // JSONString returns path representation is JSON convention 19529 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) JSONString() string { 19530 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 19531 } 19532 19533 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_System 19534 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_System) (values []interface{}) { 19535 switch fps.selector { 19536 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19537 values = append(values, fps.subPath.GetRaw(source.GetConfiguration())...) 19538 default: 19539 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fps.selector)) 19540 } 19541 return 19542 } 19543 19544 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) GetRaw(source proto.Message) []interface{} { 19545 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19546 } 19547 19548 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_System 19549 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System) (interface{}, bool) { 19550 switch fps.selector { 19551 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19552 if source.GetConfiguration() == nil { 19553 return nil, false 19554 } 19555 return fps.subPath.GetSingleRaw(source.GetConfiguration()) 19556 default: 19557 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fps.selector)) 19558 } 19559 } 19560 19561 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 19562 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19563 } 19564 19565 // GetDefault returns a default value of the field type 19566 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) GetDefault() interface{} { 19567 return fps.subPath.GetDefault() 19568 } 19569 19570 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_System) { 19571 if item != nil { 19572 switch fps.selector { 19573 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19574 fps.subPath.ClearValueRaw(item.Configuration) 19575 default: 19576 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fps.selector)) 19577 } 19578 } 19579 } 19580 19581 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) ClearValueRaw(item proto.Message) { 19582 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19583 } 19584 19585 // IsLeaf - whether field path is holds simple value 19586 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) IsLeaf() bool { 19587 return fps.subPath.IsLeaf() 19588 } 19589 19590 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 19591 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath{selector: fps.selector}} 19592 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 19593 return iPaths 19594 } 19595 19596 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue { 19597 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 19598 } 19599 19600 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 19601 return fps.WithIValue(value) 19602 } 19603 19604 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues { 19605 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 19606 } 19607 19608 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 19609 return fps.WithIArrayOfValues(values) 19610 } 19611 19612 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue { 19613 return &DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 19614 } 19615 19616 func (fps *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 19617 return fps.WithIArrayItemValue(value) 19618 } 19619 19620 // DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue allows storing values for System fields according to their type 19621 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue interface { 19622 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 19623 gotenobject.FieldPathValue 19624 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_System) 19625 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_System) (cmp int, comparable bool) 19626 } 19627 19628 func ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue, error) { 19629 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(pathStr) 19630 if err != nil { 19631 return nil, err 19632 } 19633 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 19634 if err != nil { 19635 return nil, status.Errorf(codes.InvalidArgument, "error parsing System field path value from %s: %v", valueStr, err) 19636 } 19637 return fpv.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue), nil 19638 } 19639 19640 func MustParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue { 19641 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue(pathStr, valueStr) 19642 if err != nil { 19643 panic(err) 19644 } 19645 return fpv 19646 } 19647 19648 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue struct { 19649 DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath 19650 value interface{} 19651 } 19652 19653 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue)(nil) 19654 19655 // GetRawValue returns raw value stored under selected path for 'System' as interface{} 19656 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) GetRawValue() interface{} { 19657 return fpv.value 19658 } 19659 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) AsManufacturerValue() (string, bool) { 19660 res, ok := fpv.value.(string) 19661 return res, ok 19662 } 19663 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) AsProductNameValue() (string, bool) { 19664 res, ok := fpv.value.(string) 19665 return res, ok 19666 } 19667 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) AsVersionValue() (string, bool) { 19668 res, ok := fpv.value.(string) 19669 return res, ok 19670 } 19671 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) AsSerialNumberValue() (string, bool) { 19672 res, ok := fpv.value.(string) 19673 return res, ok 19674 } 19675 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) AsConfigurationValue() (*Device_Status_DeviceInfo_HardwareInformation_System_Configuration, bool) { 19676 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 19677 return res, ok 19678 } 19679 19680 // SetTo stores value for selected field for object System 19681 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_System) { 19682 if *target == nil { 19683 *target = new(Device_Status_DeviceInfo_HardwareInformation_System) 19684 } 19685 switch fpv.selector { 19686 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19687 (*target).Manufacturer = fpv.value.(string) 19688 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19689 (*target).ProductName = fpv.value.(string) 19690 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19691 (*target).Version = fpv.value.(string) 19692 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19693 (*target).SerialNumber = fpv.value.(string) 19694 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19695 (*target).Configuration = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 19696 default: 19697 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fpv.selector)) 19698 } 19699 } 19700 19701 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) SetToRaw(target proto.Message) { 19702 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_System) 19703 fpv.SetTo(&typedObject) 19704 } 19705 19706 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_System'. 19707 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_System) (int, bool) { 19708 switch fpv.selector { 19709 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19710 leftValue := fpv.value.(string) 19711 rightValue := source.GetManufacturer() 19712 if (leftValue) == (rightValue) { 19713 return 0, true 19714 } else if (leftValue) < (rightValue) { 19715 return -1, true 19716 } else { 19717 return 1, true 19718 } 19719 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19720 leftValue := fpv.value.(string) 19721 rightValue := source.GetProductName() 19722 if (leftValue) == (rightValue) { 19723 return 0, true 19724 } else if (leftValue) < (rightValue) { 19725 return -1, true 19726 } else { 19727 return 1, true 19728 } 19729 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19730 leftValue := fpv.value.(string) 19731 rightValue := source.GetVersion() 19732 if (leftValue) == (rightValue) { 19733 return 0, true 19734 } else if (leftValue) < (rightValue) { 19735 return -1, true 19736 } else { 19737 return 1, true 19738 } 19739 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19740 leftValue := fpv.value.(string) 19741 rightValue := source.GetSerialNumber() 19742 if (leftValue) == (rightValue) { 19743 return 0, true 19744 } else if (leftValue) < (rightValue) { 19745 return -1, true 19746 } else { 19747 return 1, true 19748 } 19749 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19750 return 0, false 19751 default: 19752 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fpv.selector)) 19753 } 19754 } 19755 19756 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 19757 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19758 } 19759 19760 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue struct { 19761 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 19762 subPathValue gotenobject.FieldPathValue 19763 } 19764 19765 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue)(nil) 19766 19767 func (fpvs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue) AsConfigurationPathValue() (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue, bool) { 19768 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue) 19769 return res, ok 19770 } 19771 19772 func (fpvs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_System) { 19773 if *target == nil { 19774 *target = new(Device_Status_DeviceInfo_HardwareInformation_System) 19775 } 19776 switch fpvs.Selector() { 19777 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19778 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue).SetTo(&(*target).Configuration) 19779 default: 19780 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fpvs.Selector())) 19781 } 19782 } 19783 19784 func (fpvs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue) SetToRaw(target proto.Message) { 19785 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_System) 19786 fpvs.SetTo(&typedObject) 19787 } 19788 19789 func (fpvs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue) GetRawValue() interface{} { 19790 return fpvs.subPathValue.GetRawValue() 19791 } 19792 19793 func (fpvs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_System) (int, bool) { 19794 switch fpvs.Selector() { 19795 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19796 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue).CompareWith(source.GetConfiguration()) 19797 default: 19798 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fpvs.Selector())) 19799 } 19800 } 19801 19802 func (fpvs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 19803 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19804 } 19805 19806 // DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue allows storing single item in Path-specific values for System according to their type 19807 // Present only for array (repeated) types. 19808 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue interface { 19809 gotenobject.FieldPathArrayItemValue 19810 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 19811 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_System) bool 19812 } 19813 19814 // ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 19815 func ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue, error) { 19816 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(pathStr) 19817 if err != nil { 19818 return nil, err 19819 } 19820 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 19821 if err != nil { 19822 return nil, status.Errorf(codes.InvalidArgument, "error parsing System field path array item value from %s: %v", valueStr, err) 19823 } 19824 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue), nil 19825 } 19826 19827 func MustParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue { 19828 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue(pathStr, valueStr) 19829 if err != nil { 19830 panic(err) 19831 } 19832 return fpaiv 19833 } 19834 19835 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayItemValue struct { 19836 DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath 19837 value interface{} 19838 } 19839 19840 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayItemValue)(nil) 19841 19842 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_System as interface{} 19843 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 19844 return fpaiv.value 19845 } 19846 19847 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System) (interface{}, bool) { 19848 return nil, false 19849 } 19850 19851 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 19852 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_System)) 19853 } 19854 19855 // Contains returns a boolean indicating if value that is being held is present in given 'System' 19856 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_System) bool { 19857 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath.Get(source) 19858 for _, v := range slice { 19859 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 19860 if proto.Equal(asProtoMsg, v.(proto.Message)) { 19861 return true 19862 } 19863 } else if reflect.DeepEqual(v, fpaiv.value) { 19864 return true 19865 } 19866 } 19867 return false 19868 } 19869 19870 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayItemValue struct { 19871 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 19872 subPathItemValue gotenobject.FieldPathArrayItemValue 19873 } 19874 19875 // GetRawValue returns stored array item value 19876 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 19877 return fpaivs.subPathItemValue.GetRawItemValue() 19878 } 19879 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayItemValue) AsConfigurationPathItemValue() (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue, bool) { 19880 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue) 19881 return res, ok 19882 } 19883 19884 // Contains returns a boolean indicating if value that is being held is present in given 'System' 19885 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_System) bool { 19886 switch fpaivs.Selector() { 19887 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19888 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue).ContainsValue(source.GetConfiguration()) 19889 default: 19890 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System: %d", fpaivs.Selector())) 19891 } 19892 } 19893 19894 // DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues allows storing slice of values for System fields according to their type 19895 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues interface { 19896 gotenobject.FieldPathArrayOfValues 19897 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 19898 } 19899 19900 func ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues, error) { 19901 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPath(pathStr) 19902 if err != nil { 19903 return nil, err 19904 } 19905 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 19906 if err != nil { 19907 return nil, status.Errorf(codes.InvalidArgument, "error parsing System field path array of values from %s: %v", valuesStr, err) 19908 } 19909 return fpaov.(DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues), nil 19910 } 19911 19912 func MustParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues { 19913 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues(pathStr, valuesStr) 19914 if err != nil { 19915 panic(err) 19916 } 19917 return fpaov 19918 } 19919 19920 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues struct { 19921 DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPath 19922 values interface{} 19923 } 19924 19925 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues)(nil) 19926 19927 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 19928 switch fpaov.selector { 19929 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorManufacturer: 19930 for _, v := range fpaov.values.([]string) { 19931 values = append(values, v) 19932 } 19933 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorProductName: 19934 for _, v := range fpaov.values.([]string) { 19935 values = append(values, v) 19936 } 19937 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorVersion: 19938 for _, v := range fpaov.values.([]string) { 19939 values = append(values, v) 19940 } 19941 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorSerialNumber: 19942 for _, v := range fpaov.values.([]string) { 19943 values = append(values, v) 19944 } 19945 case DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathSelectorConfiguration: 19946 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) { 19947 values = append(values, v) 19948 } 19949 } 19950 return 19951 } 19952 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues) AsManufacturerArrayOfValues() ([]string, bool) { 19953 res, ok := fpaov.values.([]string) 19954 return res, ok 19955 } 19956 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues) AsProductNameArrayOfValues() ([]string, bool) { 19957 res, ok := fpaov.values.([]string) 19958 return res, ok 19959 } 19960 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues) AsVersionArrayOfValues() ([]string, bool) { 19961 res, ok := fpaov.values.([]string) 19962 return res, ok 19963 } 19964 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues) AsSerialNumberArrayOfValues() ([]string, bool) { 19965 res, ok := fpaov.values.([]string) 19966 return res, ok 19967 } 19968 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldTerminalPathArrayOfValues) AsConfigurationArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_System_Configuration, bool) { 19969 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 19970 return res, ok 19971 } 19972 19973 type DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayOfValues struct { 19974 DeviceStatusDeviceInfoHardwareInformationSystem_FieldPath 19975 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 19976 } 19977 19978 var _ DeviceStatusDeviceInfoHardwareInformationSystem_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayOfValues)(nil) 19979 19980 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 19981 return fpsaov.subPathArrayOfValues.GetRawValues() 19982 } 19983 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationSystem_FieldSubPathArrayOfValues) AsConfigurationPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues, bool) { 19984 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues) 19985 return res, ok 19986 } 19987 19988 // FieldPath provides implementation to handle 19989 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 19990 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath interface { 19991 gotenobject.FieldPath 19992 Selector() DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector 19993 Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU) []interface{} 19994 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (interface{}, bool) 19995 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU) 19996 19997 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue 19998 // (or array of values) and holds passed value. Panics if injected type is incorrect. 19999 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue 20000 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues 20001 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue 20002 } 20003 20004 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector int32 20005 20006 const ( 20007 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector = 0 20008 ) 20009 20010 func (s DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector) String() string { 20011 switch s { 20012 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20013 return "processors" 20014 default: 20015 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", s)) 20016 } 20017 } 20018 20019 func BuildDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath, error) { 20020 if len(fp) == 0 { 20021 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_CPU") 20022 } 20023 if len(fp) == 1 { 20024 switch fp[0] { 20025 case "processors": 20026 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors}, nil 20027 } 20028 } else { 20029 switch fp[0] { 20030 case "processors": 20031 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(fp[1:]); err != nil { 20032 return nil, err 20033 } else { 20034 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors, subPath: subpath}, nil 20035 } 20036 } 20037 } 20038 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_CPU", fp) 20039 } 20040 20041 func ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath, error) { 20042 fp, err := gotenobject.ParseRawFieldPath(rawField) 20043 if err != nil { 20044 return nil, err 20045 } 20046 return BuildDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(fp) 20047 } 20048 20049 func MustParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath { 20050 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(rawField) 20051 if err != nil { 20052 panic(err) 20053 } 20054 return fp 20055 } 20056 20057 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath struct { 20058 selector DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector 20059 } 20060 20061 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath)(nil) 20062 20063 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector { 20064 return fp.selector 20065 } 20066 20067 // String returns path representation in proto convention 20068 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) String() string { 20069 return fp.selector.String() 20070 } 20071 20072 // JSONString returns path representation is JSON convention 20073 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) JSONString() string { 20074 return strcase.ToLowerCamel(fp.String()) 20075 } 20076 20077 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_CPU 20078 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (values []interface{}) { 20079 if source != nil { 20080 switch fp.selector { 20081 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20082 for _, value := range source.GetProcessors() { 20083 values = append(values, value) 20084 } 20085 default: 20086 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20087 } 20088 } 20089 return 20090 } 20091 20092 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 20093 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20094 } 20095 20096 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_CPU 20097 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (interface{}, bool) { 20098 switch fp.selector { 20099 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20100 res := source.GetProcessors() 20101 return res, res != nil 20102 default: 20103 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20104 } 20105 } 20106 20107 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 20108 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20109 } 20110 20111 // GetDefault returns a default value of the field type 20112 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) GetDefault() interface{} { 20113 switch fp.selector { 20114 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20115 return ([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)(nil) 20116 default: 20117 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20118 } 20119 } 20120 20121 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU) { 20122 if item != nil { 20123 switch fp.selector { 20124 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20125 item.Processors = nil 20126 default: 20127 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20128 } 20129 } 20130 } 20131 20132 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) ClearValueRaw(item proto.Message) { 20133 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20134 } 20135 20136 // IsLeaf - whether field path is holds simple value 20137 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) IsLeaf() bool { 20138 return false 20139 } 20140 20141 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 20142 return []gotenobject.FieldPath{fp} 20143 } 20144 20145 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue { 20146 switch fp.selector { 20147 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20148 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)} 20149 default: 20150 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20151 } 20152 } 20153 20154 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 20155 return fp.WithIValue(value) 20156 } 20157 20158 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues { 20159 fpaov := &DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath: *fp} 20160 switch fp.selector { 20161 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20162 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)} 20163 default: 20164 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20165 } 20166 return fpaov 20167 } 20168 20169 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 20170 return fp.WithIArrayOfValues(values) 20171 } 20172 20173 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue { 20174 switch fp.selector { 20175 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20176 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)} 20177 default: 20178 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fp.selector)) 20179 } 20180 } 20181 20182 func (fp *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 20183 return fp.WithIArrayItemValue(value) 20184 } 20185 20186 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath struct { 20187 selector DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector 20188 subPath gotenobject.FieldPath 20189 } 20190 20191 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath)(nil) 20192 20193 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelector { 20194 return fps.selector 20195 } 20196 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) AsProcessorsSubPath() (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath, bool) { 20197 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath) 20198 return res, ok 20199 } 20200 20201 // String returns path representation in proto convention 20202 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) String() string { 20203 return fps.selector.String() + "." + fps.subPath.String() 20204 } 20205 20206 // JSONString returns path representation is JSON convention 20207 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) JSONString() string { 20208 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 20209 } 20210 20211 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_CPU 20212 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (values []interface{}) { 20213 switch fps.selector { 20214 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20215 for _, item := range source.GetProcessors() { 20216 values = append(values, fps.subPath.GetRaw(item)...) 20217 } 20218 default: 20219 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fps.selector)) 20220 } 20221 return 20222 } 20223 20224 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) GetRaw(source proto.Message) []interface{} { 20225 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20226 } 20227 20228 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_CPU 20229 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (interface{}, bool) { 20230 switch fps.selector { 20231 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20232 if len(source.GetProcessors()) == 0 { 20233 return nil, false 20234 } 20235 return fps.subPath.GetSingleRaw(source.GetProcessors()[0]) 20236 default: 20237 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fps.selector)) 20238 } 20239 } 20240 20241 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 20242 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20243 } 20244 20245 // GetDefault returns a default value of the field type 20246 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) GetDefault() interface{} { 20247 return fps.subPath.GetDefault() 20248 } 20249 20250 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU) { 20251 if item != nil { 20252 switch fps.selector { 20253 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20254 for _, subItem := range item.Processors { 20255 fps.subPath.ClearValueRaw(subItem) 20256 } 20257 default: 20258 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fps.selector)) 20259 } 20260 } 20261 } 20262 20263 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) ClearValueRaw(item proto.Message) { 20264 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20265 } 20266 20267 // IsLeaf - whether field path is holds simple value 20268 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) IsLeaf() bool { 20269 return fps.subPath.IsLeaf() 20270 } 20271 20272 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 20273 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath{selector: fps.selector}} 20274 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 20275 return iPaths 20276 } 20277 20278 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue { 20279 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 20280 } 20281 20282 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 20283 return fps.WithIValue(value) 20284 } 20285 20286 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues { 20287 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 20288 } 20289 20290 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 20291 return fps.WithIArrayOfValues(values) 20292 } 20293 20294 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue { 20295 return &DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 20296 } 20297 20298 func (fps *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 20299 return fps.WithIArrayItemValue(value) 20300 } 20301 20302 // DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue allows storing values for CPU fields according to their type 20303 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue interface { 20304 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 20305 gotenobject.FieldPathValue 20306 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU) 20307 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_CPU) (cmp int, comparable bool) 20308 } 20309 20310 func ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue, error) { 20311 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(pathStr) 20312 if err != nil { 20313 return nil, err 20314 } 20315 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 20316 if err != nil { 20317 return nil, status.Errorf(codes.InvalidArgument, "error parsing CPU field path value from %s: %v", valueStr, err) 20318 } 20319 return fpv.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue), nil 20320 } 20321 20322 func MustParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue { 20323 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue(pathStr, valueStr) 20324 if err != nil { 20325 panic(err) 20326 } 20327 return fpv 20328 } 20329 20330 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue struct { 20331 DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath 20332 value interface{} 20333 } 20334 20335 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue)(nil) 20336 20337 // GetRawValue returns raw value stored under selected path for 'CPU' as interface{} 20338 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue) GetRawValue() interface{} { 20339 return fpv.value 20340 } 20341 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue) AsProcessorsValue() ([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor, bool) { 20342 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 20343 return res, ok 20344 } 20345 20346 // SetTo stores value for selected field for object CPU 20347 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU) { 20348 if *target == nil { 20349 *target = new(Device_Status_DeviceInfo_HardwareInformation_CPU) 20350 } 20351 switch fpv.selector { 20352 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20353 (*target).Processors = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 20354 default: 20355 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fpv.selector)) 20356 } 20357 } 20358 20359 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue) SetToRaw(target proto.Message) { 20360 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_CPU) 20361 fpv.SetTo(&typedObject) 20362 } 20363 20364 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_CPU'. 20365 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (int, bool) { 20366 switch fpv.selector { 20367 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20368 return 0, false 20369 default: 20370 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fpv.selector)) 20371 } 20372 } 20373 20374 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 20375 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20376 } 20377 20378 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue struct { 20379 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 20380 subPathValue gotenobject.FieldPathValue 20381 } 20382 20383 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue)(nil) 20384 20385 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue) AsProcessorsPathValue() (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue, bool) { 20386 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue) 20387 return res, ok 20388 } 20389 20390 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU) { 20391 if *target == nil { 20392 *target = new(Device_Status_DeviceInfo_HardwareInformation_CPU) 20393 } 20394 switch fpvs.Selector() { 20395 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20396 panic("FieldPath setter is unsupported for array subpaths") 20397 default: 20398 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fpvs.Selector())) 20399 } 20400 } 20401 20402 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue) SetToRaw(target proto.Message) { 20403 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_CPU) 20404 fpvs.SetTo(&typedObject) 20405 } 20406 20407 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue) GetRawValue() interface{} { 20408 return fpvs.subPathValue.GetRawValue() 20409 } 20410 20411 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (int, bool) { 20412 switch fpvs.Selector() { 20413 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20414 return 0, false // repeated field 20415 default: 20416 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fpvs.Selector())) 20417 } 20418 } 20419 20420 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 20421 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20422 } 20423 20424 // DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue allows storing single item in Path-specific values for CPU according to their type 20425 // Present only for array (repeated) types. 20426 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue interface { 20427 gotenobject.FieldPathArrayItemValue 20428 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 20429 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_CPU) bool 20430 } 20431 20432 // ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 20433 func ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue, error) { 20434 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(pathStr) 20435 if err != nil { 20436 return nil, err 20437 } 20438 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 20439 if err != nil { 20440 return nil, status.Errorf(codes.InvalidArgument, "error parsing CPU field path array item value from %s: %v", valueStr, err) 20441 } 20442 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue), nil 20443 } 20444 20445 func MustParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue { 20446 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue(pathStr, valueStr) 20447 if err != nil { 20448 panic(err) 20449 } 20450 return fpaiv 20451 } 20452 20453 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue struct { 20454 DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath 20455 value interface{} 20456 } 20457 20458 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue)(nil) 20459 20460 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_CPU as interface{} 20461 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 20462 return fpaiv.value 20463 } 20464 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue) AsProcessorsItemValue() (*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor, bool) { 20465 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 20466 return res, ok 20467 } 20468 20469 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU) (interface{}, bool) { 20470 return nil, false 20471 } 20472 20473 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 20474 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU)) 20475 } 20476 20477 // Contains returns a boolean indicating if value that is being held is present in given 'CPU' 20478 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_CPU) bool { 20479 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath.Get(source) 20480 for _, v := range slice { 20481 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 20482 if proto.Equal(asProtoMsg, v.(proto.Message)) { 20483 return true 20484 } 20485 } else if reflect.DeepEqual(v, fpaiv.value) { 20486 return true 20487 } 20488 } 20489 return false 20490 } 20491 20492 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayItemValue struct { 20493 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 20494 subPathItemValue gotenobject.FieldPathArrayItemValue 20495 } 20496 20497 // GetRawValue returns stored array item value 20498 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 20499 return fpaivs.subPathItemValue.GetRawItemValue() 20500 } 20501 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayItemValue) AsProcessorsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue, bool) { 20502 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue) 20503 return res, ok 20504 } 20505 20506 // Contains returns a boolean indicating if value that is being held is present in given 'CPU' 20507 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_CPU) bool { 20508 switch fpaivs.Selector() { 20509 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20510 return false // repeated/map field 20511 default: 20512 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU: %d", fpaivs.Selector())) 20513 } 20514 } 20515 20516 // DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues allows storing slice of values for CPU fields according to their type 20517 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues interface { 20518 gotenobject.FieldPathArrayOfValues 20519 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 20520 } 20521 20522 func ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues, error) { 20523 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPath(pathStr) 20524 if err != nil { 20525 return nil, err 20526 } 20527 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 20528 if err != nil { 20529 return nil, status.Errorf(codes.InvalidArgument, "error parsing CPU field path array of values from %s: %v", valuesStr, err) 20530 } 20531 return fpaov.(DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues), nil 20532 } 20533 20534 func MustParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues { 20535 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues(pathStr, valuesStr) 20536 if err != nil { 20537 panic(err) 20538 } 20539 return fpaov 20540 } 20541 20542 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayOfValues struct { 20543 DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPath 20544 values interface{} 20545 } 20546 20547 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayOfValues)(nil) 20548 20549 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 20550 switch fpaov.selector { 20551 case DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathSelectorProcessors: 20552 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) { 20553 values = append(values, v) 20554 } 20555 } 20556 return 20557 } 20558 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPU_FieldTerminalPathArrayOfValues) AsProcessorsArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor, bool) { 20559 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 20560 return res, ok 20561 } 20562 20563 type DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayOfValues struct { 20564 DeviceStatusDeviceInfoHardwareInformationCPU_FieldPath 20565 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 20566 } 20567 20568 var _ DeviceStatusDeviceInfoHardwareInformationCPU_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayOfValues)(nil) 20569 20570 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 20571 return fpsaov.subPathArrayOfValues.GetRawValues() 20572 } 20573 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationCPU_FieldSubPathArrayOfValues) AsProcessorsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues, bool) { 20574 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues) 20575 return res, ok 20576 } 20577 20578 // FieldPath provides implementation to handle 20579 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 20580 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath interface { 20581 gotenobject.FieldPath 20582 Selector() DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector 20583 Get(source *Device_Status_DeviceInfo_HardwareInformation_Block) []interface{} 20584 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block) (interface{}, bool) 20585 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block) 20586 20587 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue 20588 // (or array of values) and holds passed value. Panics if injected type is incorrect. 20589 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue 20590 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues 20591 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue 20592 } 20593 20594 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector int32 20595 20596 const ( 20597 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector = 0 20598 ) 20599 20600 func (s DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector) String() string { 20601 switch s { 20602 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20603 return "disks" 20604 default: 20605 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", s)) 20606 } 20607 } 20608 20609 func BuildDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath, error) { 20610 if len(fp) == 0 { 20611 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_Block") 20612 } 20613 if len(fp) == 1 { 20614 switch fp[0] { 20615 case "disks": 20616 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks}, nil 20617 } 20618 } else { 20619 switch fp[0] { 20620 case "disks": 20621 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(fp[1:]); err != nil { 20622 return nil, err 20623 } else { 20624 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks, subPath: subpath}, nil 20625 } 20626 } 20627 } 20628 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_Block", fp) 20629 } 20630 20631 func ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath, error) { 20632 fp, err := gotenobject.ParseRawFieldPath(rawField) 20633 if err != nil { 20634 return nil, err 20635 } 20636 return BuildDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(fp) 20637 } 20638 20639 func MustParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath { 20640 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(rawField) 20641 if err != nil { 20642 panic(err) 20643 } 20644 return fp 20645 } 20646 20647 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath struct { 20648 selector DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector 20649 } 20650 20651 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath)(nil) 20652 20653 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector { 20654 return fp.selector 20655 } 20656 20657 // String returns path representation in proto convention 20658 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) String() string { 20659 return fp.selector.String() 20660 } 20661 20662 // JSONString returns path representation is JSON convention 20663 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) JSONString() string { 20664 return strcase.ToLowerCamel(fp.String()) 20665 } 20666 20667 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_Block 20668 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Block) (values []interface{}) { 20669 if source != nil { 20670 switch fp.selector { 20671 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20672 for _, value := range source.GetDisks() { 20673 values = append(values, value) 20674 } 20675 default: 20676 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20677 } 20678 } 20679 return 20680 } 20681 20682 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 20683 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20684 } 20685 20686 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_Block 20687 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block) (interface{}, bool) { 20688 switch fp.selector { 20689 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20690 res := source.GetDisks() 20691 return res, res != nil 20692 default: 20693 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20694 } 20695 } 20696 20697 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 20698 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20699 } 20700 20701 // GetDefault returns a default value of the field type 20702 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) GetDefault() interface{} { 20703 switch fp.selector { 20704 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20705 return ([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)(nil) 20706 default: 20707 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20708 } 20709 } 20710 20711 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block) { 20712 if item != nil { 20713 switch fp.selector { 20714 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20715 item.Disks = nil 20716 default: 20717 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20718 } 20719 } 20720 } 20721 20722 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) ClearValueRaw(item proto.Message) { 20723 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20724 } 20725 20726 // IsLeaf - whether field path is holds simple value 20727 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) IsLeaf() bool { 20728 return false 20729 } 20730 20731 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 20732 return []gotenobject.FieldPath{fp} 20733 } 20734 20735 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue { 20736 switch fp.selector { 20737 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20738 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)} 20739 default: 20740 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20741 } 20742 } 20743 20744 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 20745 return fp.WithIValue(value) 20746 } 20747 20748 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues { 20749 fpaov := &DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath: *fp} 20750 switch fp.selector { 20751 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20752 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)} 20753 default: 20754 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20755 } 20756 return fpaov 20757 } 20758 20759 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 20760 return fp.WithIArrayOfValues(values) 20761 } 20762 20763 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue { 20764 switch fp.selector { 20765 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20766 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)} 20767 default: 20768 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fp.selector)) 20769 } 20770 } 20771 20772 func (fp *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 20773 return fp.WithIArrayItemValue(value) 20774 } 20775 20776 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath struct { 20777 selector DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector 20778 subPath gotenobject.FieldPath 20779 } 20780 20781 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath)(nil) 20782 20783 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelector { 20784 return fps.selector 20785 } 20786 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) AsDisksSubPath() (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath, bool) { 20787 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath) 20788 return res, ok 20789 } 20790 20791 // String returns path representation in proto convention 20792 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) String() string { 20793 return fps.selector.String() + "." + fps.subPath.String() 20794 } 20795 20796 // JSONString returns path representation is JSON convention 20797 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) JSONString() string { 20798 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 20799 } 20800 20801 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_Block 20802 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Block) (values []interface{}) { 20803 switch fps.selector { 20804 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20805 for _, item := range source.GetDisks() { 20806 values = append(values, fps.subPath.GetRaw(item)...) 20807 } 20808 default: 20809 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fps.selector)) 20810 } 20811 return 20812 } 20813 20814 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) GetRaw(source proto.Message) []interface{} { 20815 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20816 } 20817 20818 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_Block 20819 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block) (interface{}, bool) { 20820 switch fps.selector { 20821 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20822 if len(source.GetDisks()) == 0 { 20823 return nil, false 20824 } 20825 return fps.subPath.GetSingleRaw(source.GetDisks()[0]) 20826 default: 20827 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fps.selector)) 20828 } 20829 } 20830 20831 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 20832 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20833 } 20834 20835 // GetDefault returns a default value of the field type 20836 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) GetDefault() interface{} { 20837 return fps.subPath.GetDefault() 20838 } 20839 20840 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block) { 20841 if item != nil { 20842 switch fps.selector { 20843 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20844 for _, subItem := range item.Disks { 20845 fps.subPath.ClearValueRaw(subItem) 20846 } 20847 default: 20848 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fps.selector)) 20849 } 20850 } 20851 } 20852 20853 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) ClearValueRaw(item proto.Message) { 20854 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20855 } 20856 20857 // IsLeaf - whether field path is holds simple value 20858 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) IsLeaf() bool { 20859 return fps.subPath.IsLeaf() 20860 } 20861 20862 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 20863 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath{selector: fps.selector}} 20864 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 20865 return iPaths 20866 } 20867 20868 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue { 20869 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 20870 } 20871 20872 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 20873 return fps.WithIValue(value) 20874 } 20875 20876 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues { 20877 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 20878 } 20879 20880 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 20881 return fps.WithIArrayOfValues(values) 20882 } 20883 20884 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue { 20885 return &DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 20886 } 20887 20888 func (fps *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 20889 return fps.WithIArrayItemValue(value) 20890 } 20891 20892 // DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue allows storing values for Block fields according to their type 20893 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue interface { 20894 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 20895 gotenobject.FieldPathValue 20896 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block) 20897 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_Block) (cmp int, comparable bool) 20898 } 20899 20900 func ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue, error) { 20901 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(pathStr) 20902 if err != nil { 20903 return nil, err 20904 } 20905 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 20906 if err != nil { 20907 return nil, status.Errorf(codes.InvalidArgument, "error parsing Block field path value from %s: %v", valueStr, err) 20908 } 20909 return fpv.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue), nil 20910 } 20911 20912 func MustParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue { 20913 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue(pathStr, valueStr) 20914 if err != nil { 20915 panic(err) 20916 } 20917 return fpv 20918 } 20919 20920 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue struct { 20921 DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath 20922 value interface{} 20923 } 20924 20925 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue)(nil) 20926 20927 // GetRawValue returns raw value stored under selected path for 'Block' as interface{} 20928 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue) GetRawValue() interface{} { 20929 return fpv.value 20930 } 20931 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue) AsDisksValue() ([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk, bool) { 20932 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 20933 return res, ok 20934 } 20935 20936 // SetTo stores value for selected field for object Block 20937 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block) { 20938 if *target == nil { 20939 *target = new(Device_Status_DeviceInfo_HardwareInformation_Block) 20940 } 20941 switch fpv.selector { 20942 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20943 (*target).Disks = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 20944 default: 20945 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fpv.selector)) 20946 } 20947 } 20948 20949 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue) SetToRaw(target proto.Message) { 20950 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Block) 20951 fpv.SetTo(&typedObject) 20952 } 20953 20954 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Block'. 20955 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Block) (int, bool) { 20956 switch fpv.selector { 20957 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20958 return 0, false 20959 default: 20960 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fpv.selector)) 20961 } 20962 } 20963 20964 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 20965 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 20966 } 20967 20968 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue struct { 20969 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 20970 subPathValue gotenobject.FieldPathValue 20971 } 20972 20973 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue)(nil) 20974 20975 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue) AsDisksPathValue() (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue, bool) { 20976 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue) 20977 return res, ok 20978 } 20979 20980 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block) { 20981 if *target == nil { 20982 *target = new(Device_Status_DeviceInfo_HardwareInformation_Block) 20983 } 20984 switch fpvs.Selector() { 20985 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 20986 panic("FieldPath setter is unsupported for array subpaths") 20987 default: 20988 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fpvs.Selector())) 20989 } 20990 } 20991 20992 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue) SetToRaw(target proto.Message) { 20993 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Block) 20994 fpvs.SetTo(&typedObject) 20995 } 20996 20997 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue) GetRawValue() interface{} { 20998 return fpvs.subPathValue.GetRawValue() 20999 } 21000 21001 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Block) (int, bool) { 21002 switch fpvs.Selector() { 21003 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 21004 return 0, false // repeated field 21005 default: 21006 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fpvs.Selector())) 21007 } 21008 } 21009 21010 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 21011 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 21012 } 21013 21014 // DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue allows storing single item in Path-specific values for Block according to their type 21015 // Present only for array (repeated) types. 21016 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue interface { 21017 gotenobject.FieldPathArrayItemValue 21018 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 21019 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_Block) bool 21020 } 21021 21022 // ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 21023 func ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue, error) { 21024 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(pathStr) 21025 if err != nil { 21026 return nil, err 21027 } 21028 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 21029 if err != nil { 21030 return nil, status.Errorf(codes.InvalidArgument, "error parsing Block field path array item value from %s: %v", valueStr, err) 21031 } 21032 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue), nil 21033 } 21034 21035 func MustParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue { 21036 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue(pathStr, valueStr) 21037 if err != nil { 21038 panic(err) 21039 } 21040 return fpaiv 21041 } 21042 21043 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue struct { 21044 DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath 21045 value interface{} 21046 } 21047 21048 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue)(nil) 21049 21050 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_Block as interface{} 21051 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 21052 return fpaiv.value 21053 } 21054 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue) AsDisksItemValue() (*Device_Status_DeviceInfo_HardwareInformation_Block_Disk, bool) { 21055 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 21056 return res, ok 21057 } 21058 21059 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block) (interface{}, bool) { 21060 return nil, false 21061 } 21062 21063 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 21064 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block)) 21065 } 21066 21067 // Contains returns a boolean indicating if value that is being held is present in given 'Block' 21068 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Block) bool { 21069 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath.Get(source) 21070 for _, v := range slice { 21071 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 21072 if proto.Equal(asProtoMsg, v.(proto.Message)) { 21073 return true 21074 } 21075 } else if reflect.DeepEqual(v, fpaiv.value) { 21076 return true 21077 } 21078 } 21079 return false 21080 } 21081 21082 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayItemValue struct { 21083 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 21084 subPathItemValue gotenobject.FieldPathArrayItemValue 21085 } 21086 21087 // GetRawValue returns stored array item value 21088 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 21089 return fpaivs.subPathItemValue.GetRawItemValue() 21090 } 21091 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayItemValue) AsDisksPathItemValue() (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue, bool) { 21092 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue) 21093 return res, ok 21094 } 21095 21096 // Contains returns a boolean indicating if value that is being held is present in given 'Block' 21097 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Block) bool { 21098 switch fpaivs.Selector() { 21099 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 21100 return false // repeated/map field 21101 default: 21102 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block: %d", fpaivs.Selector())) 21103 } 21104 } 21105 21106 // DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues allows storing slice of values for Block fields according to their type 21107 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues interface { 21108 gotenobject.FieldPathArrayOfValues 21109 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 21110 } 21111 21112 func ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues, error) { 21113 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPath(pathStr) 21114 if err != nil { 21115 return nil, err 21116 } 21117 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 21118 if err != nil { 21119 return nil, status.Errorf(codes.InvalidArgument, "error parsing Block field path array of values from %s: %v", valuesStr, err) 21120 } 21121 return fpaov.(DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues), nil 21122 } 21123 21124 func MustParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues { 21125 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues(pathStr, valuesStr) 21126 if err != nil { 21127 panic(err) 21128 } 21129 return fpaov 21130 } 21131 21132 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayOfValues struct { 21133 DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPath 21134 values interface{} 21135 } 21136 21137 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayOfValues)(nil) 21138 21139 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 21140 switch fpaov.selector { 21141 case DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathSelectorDisks: 21142 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) { 21143 values = append(values, v) 21144 } 21145 } 21146 return 21147 } 21148 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlock_FieldTerminalPathArrayOfValues) AsDisksArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk, bool) { 21149 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 21150 return res, ok 21151 } 21152 21153 type DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayOfValues struct { 21154 DeviceStatusDeviceInfoHardwareInformationBlock_FieldPath 21155 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 21156 } 21157 21158 var _ DeviceStatusDeviceInfoHardwareInformationBlock_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayOfValues)(nil) 21159 21160 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 21161 return fpsaov.subPathArrayOfValues.GetRawValues() 21162 } 21163 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationBlock_FieldSubPathArrayOfValues) AsDisksPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues, bool) { 21164 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues) 21165 return res, ok 21166 } 21167 21168 // FieldPath provides implementation to handle 21169 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 21170 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath interface { 21171 gotenobject.FieldPath 21172 Selector() DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector 21173 Get(source *Device_Status_DeviceInfo_HardwareInformation_Network) []interface{} 21174 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network) (interface{}, bool) 21175 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Network) 21176 21177 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue 21178 // (or array of values) and holds passed value. Panics if injected type is incorrect. 21179 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue 21180 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues 21181 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue 21182 } 21183 21184 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector int32 21185 21186 const ( 21187 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector = 0 21188 ) 21189 21190 func (s DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector) String() string { 21191 switch s { 21192 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21193 return "nics" 21194 default: 21195 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", s)) 21196 } 21197 } 21198 21199 func BuildDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath, error) { 21200 if len(fp) == 0 { 21201 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_Network") 21202 } 21203 if len(fp) == 1 { 21204 switch fp[0] { 21205 case "nics": 21206 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics}, nil 21207 } 21208 } else { 21209 switch fp[0] { 21210 case "nics": 21211 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(fp[1:]); err != nil { 21212 return nil, err 21213 } else { 21214 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics, subPath: subpath}, nil 21215 } 21216 } 21217 } 21218 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_Network", fp) 21219 } 21220 21221 func ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath, error) { 21222 fp, err := gotenobject.ParseRawFieldPath(rawField) 21223 if err != nil { 21224 return nil, err 21225 } 21226 return BuildDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(fp) 21227 } 21228 21229 func MustParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath { 21230 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(rawField) 21231 if err != nil { 21232 panic(err) 21233 } 21234 return fp 21235 } 21236 21237 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath struct { 21238 selector DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector 21239 } 21240 21241 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath)(nil) 21242 21243 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector { 21244 return fp.selector 21245 } 21246 21247 // String returns path representation in proto convention 21248 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) String() string { 21249 return fp.selector.String() 21250 } 21251 21252 // JSONString returns path representation is JSON convention 21253 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) JSONString() string { 21254 return strcase.ToLowerCamel(fp.String()) 21255 } 21256 21257 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_Network 21258 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Network) (values []interface{}) { 21259 if source != nil { 21260 switch fp.selector { 21261 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21262 for _, value := range source.GetNics() { 21263 values = append(values, value) 21264 } 21265 default: 21266 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21267 } 21268 } 21269 return 21270 } 21271 21272 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 21273 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21274 } 21275 21276 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_Network 21277 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network) (interface{}, bool) { 21278 switch fp.selector { 21279 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21280 res := source.GetNics() 21281 return res, res != nil 21282 default: 21283 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21284 } 21285 } 21286 21287 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 21288 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21289 } 21290 21291 // GetDefault returns a default value of the field type 21292 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) GetDefault() interface{} { 21293 switch fp.selector { 21294 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21295 return ([]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)(nil) 21296 default: 21297 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21298 } 21299 } 21300 21301 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Network) { 21302 if item != nil { 21303 switch fp.selector { 21304 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21305 item.Nics = nil 21306 default: 21307 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21308 } 21309 } 21310 } 21311 21312 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) ClearValueRaw(item proto.Message) { 21313 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21314 } 21315 21316 // IsLeaf - whether field path is holds simple value 21317 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) IsLeaf() bool { 21318 return false 21319 } 21320 21321 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 21322 return []gotenobject.FieldPath{fp} 21323 } 21324 21325 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue { 21326 switch fp.selector { 21327 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21328 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)} 21329 default: 21330 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21331 } 21332 } 21333 21334 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 21335 return fp.WithIValue(value) 21336 } 21337 21338 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues { 21339 fpaov := &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath: *fp} 21340 switch fp.selector { 21341 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21342 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)} 21343 default: 21344 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21345 } 21346 return fpaov 21347 } 21348 21349 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 21350 return fp.WithIArrayOfValues(values) 21351 } 21352 21353 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue { 21354 switch fp.selector { 21355 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21356 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)} 21357 default: 21358 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fp.selector)) 21359 } 21360 } 21361 21362 func (fp *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 21363 return fp.WithIArrayItemValue(value) 21364 } 21365 21366 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath struct { 21367 selector DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector 21368 subPath gotenobject.FieldPath 21369 } 21370 21371 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath)(nil) 21372 21373 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelector { 21374 return fps.selector 21375 } 21376 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) AsNicsSubPath() (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath, bool) { 21377 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath) 21378 return res, ok 21379 } 21380 21381 // String returns path representation in proto convention 21382 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) String() string { 21383 return fps.selector.String() + "." + fps.subPath.String() 21384 } 21385 21386 // JSONString returns path representation is JSON convention 21387 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) JSONString() string { 21388 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 21389 } 21390 21391 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_Network 21392 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Network) (values []interface{}) { 21393 switch fps.selector { 21394 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21395 for _, item := range source.GetNics() { 21396 values = append(values, fps.subPath.GetRaw(item)...) 21397 } 21398 default: 21399 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fps.selector)) 21400 } 21401 return 21402 } 21403 21404 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) GetRaw(source proto.Message) []interface{} { 21405 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21406 } 21407 21408 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_Network 21409 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network) (interface{}, bool) { 21410 switch fps.selector { 21411 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21412 if len(source.GetNics()) == 0 { 21413 return nil, false 21414 } 21415 return fps.subPath.GetSingleRaw(source.GetNics()[0]) 21416 default: 21417 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fps.selector)) 21418 } 21419 } 21420 21421 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 21422 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21423 } 21424 21425 // GetDefault returns a default value of the field type 21426 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) GetDefault() interface{} { 21427 return fps.subPath.GetDefault() 21428 } 21429 21430 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Network) { 21431 if item != nil { 21432 switch fps.selector { 21433 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21434 for _, subItem := range item.Nics { 21435 fps.subPath.ClearValueRaw(subItem) 21436 } 21437 default: 21438 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fps.selector)) 21439 } 21440 } 21441 } 21442 21443 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) ClearValueRaw(item proto.Message) { 21444 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21445 } 21446 21447 // IsLeaf - whether field path is holds simple value 21448 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) IsLeaf() bool { 21449 return fps.subPath.IsLeaf() 21450 } 21451 21452 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 21453 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath{selector: fps.selector}} 21454 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 21455 return iPaths 21456 } 21457 21458 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue { 21459 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 21460 } 21461 21462 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 21463 return fps.WithIValue(value) 21464 } 21465 21466 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues { 21467 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 21468 } 21469 21470 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 21471 return fps.WithIArrayOfValues(values) 21472 } 21473 21474 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue { 21475 return &DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 21476 } 21477 21478 func (fps *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 21479 return fps.WithIArrayItemValue(value) 21480 } 21481 21482 // DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue allows storing values for Network fields according to their type 21483 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue interface { 21484 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 21485 gotenobject.FieldPathValue 21486 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Network) 21487 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_Network) (cmp int, comparable bool) 21488 } 21489 21490 func ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue, error) { 21491 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(pathStr) 21492 if err != nil { 21493 return nil, err 21494 } 21495 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 21496 if err != nil { 21497 return nil, status.Errorf(codes.InvalidArgument, "error parsing Network field path value from %s: %v", valueStr, err) 21498 } 21499 return fpv.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue), nil 21500 } 21501 21502 func MustParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue { 21503 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue(pathStr, valueStr) 21504 if err != nil { 21505 panic(err) 21506 } 21507 return fpv 21508 } 21509 21510 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue struct { 21511 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath 21512 value interface{} 21513 } 21514 21515 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue)(nil) 21516 21517 // GetRawValue returns raw value stored under selected path for 'Network' as interface{} 21518 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue) GetRawValue() interface{} { 21519 return fpv.value 21520 } 21521 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue) AsNicsValue() ([]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC, bool) { 21522 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 21523 return res, ok 21524 } 21525 21526 // SetTo stores value for selected field for object Network 21527 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Network) { 21528 if *target == nil { 21529 *target = new(Device_Status_DeviceInfo_HardwareInformation_Network) 21530 } 21531 switch fpv.selector { 21532 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21533 (*target).Nics = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 21534 default: 21535 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fpv.selector)) 21536 } 21537 } 21538 21539 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue) SetToRaw(target proto.Message) { 21540 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Network) 21541 fpv.SetTo(&typedObject) 21542 } 21543 21544 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Network'. 21545 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Network) (int, bool) { 21546 switch fpv.selector { 21547 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21548 return 0, false 21549 default: 21550 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fpv.selector)) 21551 } 21552 } 21553 21554 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 21555 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21556 } 21557 21558 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue struct { 21559 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 21560 subPathValue gotenobject.FieldPathValue 21561 } 21562 21563 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue)(nil) 21564 21565 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue) AsNicsPathValue() (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue, bool) { 21566 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue) 21567 return res, ok 21568 } 21569 21570 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Network) { 21571 if *target == nil { 21572 *target = new(Device_Status_DeviceInfo_HardwareInformation_Network) 21573 } 21574 switch fpvs.Selector() { 21575 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21576 panic("FieldPath setter is unsupported for array subpaths") 21577 default: 21578 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fpvs.Selector())) 21579 } 21580 } 21581 21582 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue) SetToRaw(target proto.Message) { 21583 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Network) 21584 fpvs.SetTo(&typedObject) 21585 } 21586 21587 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue) GetRawValue() interface{} { 21588 return fpvs.subPathValue.GetRawValue() 21589 } 21590 21591 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Network) (int, bool) { 21592 switch fpvs.Selector() { 21593 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21594 return 0, false // repeated field 21595 default: 21596 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fpvs.Selector())) 21597 } 21598 } 21599 21600 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 21601 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21602 } 21603 21604 // DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue allows storing single item in Path-specific values for Network according to their type 21605 // Present only for array (repeated) types. 21606 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue interface { 21607 gotenobject.FieldPathArrayItemValue 21608 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 21609 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_Network) bool 21610 } 21611 21612 // ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 21613 func ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue, error) { 21614 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(pathStr) 21615 if err != nil { 21616 return nil, err 21617 } 21618 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 21619 if err != nil { 21620 return nil, status.Errorf(codes.InvalidArgument, "error parsing Network field path array item value from %s: %v", valueStr, err) 21621 } 21622 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue), nil 21623 } 21624 21625 func MustParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue { 21626 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue(pathStr, valueStr) 21627 if err != nil { 21628 panic(err) 21629 } 21630 return fpaiv 21631 } 21632 21633 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue struct { 21634 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath 21635 value interface{} 21636 } 21637 21638 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue)(nil) 21639 21640 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_Network as interface{} 21641 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 21642 return fpaiv.value 21643 } 21644 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue) AsNicsItemValue() (*Device_Status_DeviceInfo_HardwareInformation_Network_NIC, bool) { 21645 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 21646 return res, ok 21647 } 21648 21649 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network) (interface{}, bool) { 21650 return nil, false 21651 } 21652 21653 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 21654 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Network)) 21655 } 21656 21657 // Contains returns a boolean indicating if value that is being held is present in given 'Network' 21658 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Network) bool { 21659 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath.Get(source) 21660 for _, v := range slice { 21661 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 21662 if proto.Equal(asProtoMsg, v.(proto.Message)) { 21663 return true 21664 } 21665 } else if reflect.DeepEqual(v, fpaiv.value) { 21666 return true 21667 } 21668 } 21669 return false 21670 } 21671 21672 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayItemValue struct { 21673 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 21674 subPathItemValue gotenobject.FieldPathArrayItemValue 21675 } 21676 21677 // GetRawValue returns stored array item value 21678 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 21679 return fpaivs.subPathItemValue.GetRawItemValue() 21680 } 21681 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayItemValue) AsNicsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue, bool) { 21682 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue) 21683 return res, ok 21684 } 21685 21686 // Contains returns a boolean indicating if value that is being held is present in given 'Network' 21687 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Network) bool { 21688 switch fpaivs.Selector() { 21689 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21690 return false // repeated/map field 21691 default: 21692 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network: %d", fpaivs.Selector())) 21693 } 21694 } 21695 21696 // DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues allows storing slice of values for Network fields according to their type 21697 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues interface { 21698 gotenobject.FieldPathArrayOfValues 21699 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 21700 } 21701 21702 func ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues, error) { 21703 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath(pathStr) 21704 if err != nil { 21705 return nil, err 21706 } 21707 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 21708 if err != nil { 21709 return nil, status.Errorf(codes.InvalidArgument, "error parsing Network field path array of values from %s: %v", valuesStr, err) 21710 } 21711 return fpaov.(DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues), nil 21712 } 21713 21714 func MustParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues { 21715 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues(pathStr, valuesStr) 21716 if err != nil { 21717 panic(err) 21718 } 21719 return fpaov 21720 } 21721 21722 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayOfValues struct { 21723 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPath 21724 values interface{} 21725 } 21726 21727 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayOfValues)(nil) 21728 21729 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 21730 switch fpaov.selector { 21731 case DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathSelectorNics: 21732 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) { 21733 values = append(values, v) 21734 } 21735 } 21736 return 21737 } 21738 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldTerminalPathArrayOfValues) AsNicsArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC, bool) { 21739 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 21740 return res, ok 21741 } 21742 21743 type DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayOfValues struct { 21744 DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPath 21745 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 21746 } 21747 21748 var _ DeviceStatusDeviceInfoHardwareInformationNetwork_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayOfValues)(nil) 21749 21750 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 21751 return fpsaov.subPathArrayOfValues.GetRawValues() 21752 } 21753 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationNetwork_FieldSubPathArrayOfValues) AsNicsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues, bool) { 21754 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues) 21755 return res, ok 21756 } 21757 21758 // FieldPath provides implementation to handle 21759 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 21760 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath interface { 21761 gotenobject.FieldPath 21762 Selector() DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector 21763 Get(source *Device_Status_DeviceInfo_HardwareInformation_GPU) []interface{} 21764 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (interface{}, bool) 21765 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_GPU) 21766 21767 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue 21768 // (or array of values) and holds passed value. Panics if injected type is incorrect. 21769 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue 21770 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues 21771 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue 21772 } 21773 21774 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector int32 21775 21776 const ( 21777 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector = 0 21778 ) 21779 21780 func (s DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector) String() string { 21781 switch s { 21782 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21783 return "graphic_cards" 21784 default: 21785 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", s)) 21786 } 21787 } 21788 21789 func BuildDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath, error) { 21790 if len(fp) == 0 { 21791 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_GPU") 21792 } 21793 if len(fp) == 1 { 21794 switch fp[0] { 21795 case "graphic_cards", "graphicCards", "graphic-cards": 21796 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards}, nil 21797 } 21798 } else { 21799 switch fp[0] { 21800 case "graphic_cards", "graphicCards", "graphic-cards": 21801 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(fp[1:]); err != nil { 21802 return nil, err 21803 } else { 21804 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards, subPath: subpath}, nil 21805 } 21806 } 21807 } 21808 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_GPU", fp) 21809 } 21810 21811 func ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath, error) { 21812 fp, err := gotenobject.ParseRawFieldPath(rawField) 21813 if err != nil { 21814 return nil, err 21815 } 21816 return BuildDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(fp) 21817 } 21818 21819 func MustParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath { 21820 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(rawField) 21821 if err != nil { 21822 panic(err) 21823 } 21824 return fp 21825 } 21826 21827 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath struct { 21828 selector DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector 21829 } 21830 21831 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath)(nil) 21832 21833 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector { 21834 return fp.selector 21835 } 21836 21837 // String returns path representation in proto convention 21838 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) String() string { 21839 return fp.selector.String() 21840 } 21841 21842 // JSONString returns path representation is JSON convention 21843 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) JSONString() string { 21844 return strcase.ToLowerCamel(fp.String()) 21845 } 21846 21847 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_GPU 21848 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (values []interface{}) { 21849 if source != nil { 21850 switch fp.selector { 21851 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21852 for _, value := range source.GetGraphicCards() { 21853 values = append(values, value) 21854 } 21855 default: 21856 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21857 } 21858 } 21859 return 21860 } 21861 21862 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 21863 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 21864 } 21865 21866 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_GPU 21867 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (interface{}, bool) { 21868 switch fp.selector { 21869 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21870 res := source.GetGraphicCards() 21871 return res, res != nil 21872 default: 21873 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21874 } 21875 } 21876 21877 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 21878 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 21879 } 21880 21881 // GetDefault returns a default value of the field type 21882 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) GetDefault() interface{} { 21883 switch fp.selector { 21884 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21885 return ([]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)(nil) 21886 default: 21887 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21888 } 21889 } 21890 21891 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_GPU) { 21892 if item != nil { 21893 switch fp.selector { 21894 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21895 item.GraphicCards = nil 21896 default: 21897 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21898 } 21899 } 21900 } 21901 21902 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) ClearValueRaw(item proto.Message) { 21903 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 21904 } 21905 21906 // IsLeaf - whether field path is holds simple value 21907 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) IsLeaf() bool { 21908 return false 21909 } 21910 21911 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 21912 return []gotenobject.FieldPath{fp} 21913 } 21914 21915 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue { 21916 switch fp.selector { 21917 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21918 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)} 21919 default: 21920 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21921 } 21922 } 21923 21924 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 21925 return fp.WithIValue(value) 21926 } 21927 21928 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues { 21929 fpaov := &DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath: *fp} 21930 switch fp.selector { 21931 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21932 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)} 21933 default: 21934 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21935 } 21936 return fpaov 21937 } 21938 21939 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 21940 return fp.WithIArrayOfValues(values) 21941 } 21942 21943 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue { 21944 switch fp.selector { 21945 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21946 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)} 21947 default: 21948 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fp.selector)) 21949 } 21950 } 21951 21952 func (fp *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 21953 return fp.WithIArrayItemValue(value) 21954 } 21955 21956 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath struct { 21957 selector DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector 21958 subPath gotenobject.FieldPath 21959 } 21960 21961 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath)(nil) 21962 21963 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelector { 21964 return fps.selector 21965 } 21966 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) AsGraphicCardsSubPath() (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath, bool) { 21967 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath) 21968 return res, ok 21969 } 21970 21971 // String returns path representation in proto convention 21972 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) String() string { 21973 return fps.selector.String() + "." + fps.subPath.String() 21974 } 21975 21976 // JSONString returns path representation is JSON convention 21977 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) JSONString() string { 21978 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 21979 } 21980 21981 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_GPU 21982 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (values []interface{}) { 21983 switch fps.selector { 21984 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 21985 for _, item := range source.GetGraphicCards() { 21986 values = append(values, fps.subPath.GetRaw(item)...) 21987 } 21988 default: 21989 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fps.selector)) 21990 } 21991 return 21992 } 21993 21994 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) GetRaw(source proto.Message) []interface{} { 21995 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 21996 } 21997 21998 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_GPU 21999 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (interface{}, bool) { 22000 switch fps.selector { 22001 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22002 if len(source.GetGraphicCards()) == 0 { 22003 return nil, false 22004 } 22005 return fps.subPath.GetSingleRaw(source.GetGraphicCards()[0]) 22006 default: 22007 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fps.selector)) 22008 } 22009 } 22010 22011 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 22012 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 22013 } 22014 22015 // GetDefault returns a default value of the field type 22016 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) GetDefault() interface{} { 22017 return fps.subPath.GetDefault() 22018 } 22019 22020 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_GPU) { 22021 if item != nil { 22022 switch fps.selector { 22023 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22024 for _, subItem := range item.GraphicCards { 22025 fps.subPath.ClearValueRaw(subItem) 22026 } 22027 default: 22028 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fps.selector)) 22029 } 22030 } 22031 } 22032 22033 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) ClearValueRaw(item proto.Message) { 22034 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 22035 } 22036 22037 // IsLeaf - whether field path is holds simple value 22038 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) IsLeaf() bool { 22039 return fps.subPath.IsLeaf() 22040 } 22041 22042 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 22043 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath{selector: fps.selector}} 22044 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 22045 return iPaths 22046 } 22047 22048 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue { 22049 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 22050 } 22051 22052 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 22053 return fps.WithIValue(value) 22054 } 22055 22056 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues { 22057 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 22058 } 22059 22060 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 22061 return fps.WithIArrayOfValues(values) 22062 } 22063 22064 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue { 22065 return &DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 22066 } 22067 22068 func (fps *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 22069 return fps.WithIArrayItemValue(value) 22070 } 22071 22072 // DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue allows storing values for GPU fields according to their type 22073 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue interface { 22074 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 22075 gotenobject.FieldPathValue 22076 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_GPU) 22077 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_GPU) (cmp int, comparable bool) 22078 } 22079 22080 func ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue, error) { 22081 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(pathStr) 22082 if err != nil { 22083 return nil, err 22084 } 22085 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 22086 if err != nil { 22087 return nil, status.Errorf(codes.InvalidArgument, "error parsing GPU field path value from %s: %v", valueStr, err) 22088 } 22089 return fpv.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue), nil 22090 } 22091 22092 func MustParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue { 22093 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue(pathStr, valueStr) 22094 if err != nil { 22095 panic(err) 22096 } 22097 return fpv 22098 } 22099 22100 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue struct { 22101 DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath 22102 value interface{} 22103 } 22104 22105 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue)(nil) 22106 22107 // GetRawValue returns raw value stored under selected path for 'GPU' as interface{} 22108 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue) GetRawValue() interface{} { 22109 return fpv.value 22110 } 22111 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue) AsGraphicCardsValue() ([]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard, bool) { 22112 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 22113 return res, ok 22114 } 22115 22116 // SetTo stores value for selected field for object GPU 22117 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_GPU) { 22118 if *target == nil { 22119 *target = new(Device_Status_DeviceInfo_HardwareInformation_GPU) 22120 } 22121 switch fpv.selector { 22122 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22123 (*target).GraphicCards = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 22124 default: 22125 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fpv.selector)) 22126 } 22127 } 22128 22129 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue) SetToRaw(target proto.Message) { 22130 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_GPU) 22131 fpv.SetTo(&typedObject) 22132 } 22133 22134 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_GPU'. 22135 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (int, bool) { 22136 switch fpv.selector { 22137 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22138 return 0, false 22139 default: 22140 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fpv.selector)) 22141 } 22142 } 22143 22144 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 22145 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 22146 } 22147 22148 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue struct { 22149 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 22150 subPathValue gotenobject.FieldPathValue 22151 } 22152 22153 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue)(nil) 22154 22155 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue) AsGraphicCardsPathValue() (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue, bool) { 22156 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue) 22157 return res, ok 22158 } 22159 22160 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_GPU) { 22161 if *target == nil { 22162 *target = new(Device_Status_DeviceInfo_HardwareInformation_GPU) 22163 } 22164 switch fpvs.Selector() { 22165 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22166 panic("FieldPath setter is unsupported for array subpaths") 22167 default: 22168 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fpvs.Selector())) 22169 } 22170 } 22171 22172 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue) SetToRaw(target proto.Message) { 22173 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_GPU) 22174 fpvs.SetTo(&typedObject) 22175 } 22176 22177 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue) GetRawValue() interface{} { 22178 return fpvs.subPathValue.GetRawValue() 22179 } 22180 22181 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (int, bool) { 22182 switch fpvs.Selector() { 22183 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22184 return 0, false // repeated field 22185 default: 22186 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fpvs.Selector())) 22187 } 22188 } 22189 22190 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 22191 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 22192 } 22193 22194 // DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue allows storing single item in Path-specific values for GPU according to their type 22195 // Present only for array (repeated) types. 22196 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue interface { 22197 gotenobject.FieldPathArrayItemValue 22198 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 22199 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_GPU) bool 22200 } 22201 22202 // ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 22203 func ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue, error) { 22204 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(pathStr) 22205 if err != nil { 22206 return nil, err 22207 } 22208 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 22209 if err != nil { 22210 return nil, status.Errorf(codes.InvalidArgument, "error parsing GPU field path array item value from %s: %v", valueStr, err) 22211 } 22212 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue), nil 22213 } 22214 22215 func MustParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue { 22216 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue(pathStr, valueStr) 22217 if err != nil { 22218 panic(err) 22219 } 22220 return fpaiv 22221 } 22222 22223 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue struct { 22224 DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath 22225 value interface{} 22226 } 22227 22228 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue)(nil) 22229 22230 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_GPU as interface{} 22231 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 22232 return fpaiv.value 22233 } 22234 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue) AsGraphicCardsItemValue() (*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard, bool) { 22235 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 22236 return res, ok 22237 } 22238 22239 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU) (interface{}, bool) { 22240 return nil, false 22241 } 22242 22243 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 22244 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU)) 22245 } 22246 22247 // Contains returns a boolean indicating if value that is being held is present in given 'GPU' 22248 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_GPU) bool { 22249 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath.Get(source) 22250 for _, v := range slice { 22251 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 22252 if proto.Equal(asProtoMsg, v.(proto.Message)) { 22253 return true 22254 } 22255 } else if reflect.DeepEqual(v, fpaiv.value) { 22256 return true 22257 } 22258 } 22259 return false 22260 } 22261 22262 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayItemValue struct { 22263 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 22264 subPathItemValue gotenobject.FieldPathArrayItemValue 22265 } 22266 22267 // GetRawValue returns stored array item value 22268 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 22269 return fpaivs.subPathItemValue.GetRawItemValue() 22270 } 22271 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayItemValue) AsGraphicCardsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue, bool) { 22272 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue) 22273 return res, ok 22274 } 22275 22276 // Contains returns a boolean indicating if value that is being held is present in given 'GPU' 22277 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_GPU) bool { 22278 switch fpaivs.Selector() { 22279 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22280 return false // repeated/map field 22281 default: 22282 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU: %d", fpaivs.Selector())) 22283 } 22284 } 22285 22286 // DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues allows storing slice of values for GPU fields according to their type 22287 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues interface { 22288 gotenobject.FieldPathArrayOfValues 22289 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 22290 } 22291 22292 func ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues, error) { 22293 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPath(pathStr) 22294 if err != nil { 22295 return nil, err 22296 } 22297 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 22298 if err != nil { 22299 return nil, status.Errorf(codes.InvalidArgument, "error parsing GPU field path array of values from %s: %v", valuesStr, err) 22300 } 22301 return fpaov.(DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues), nil 22302 } 22303 22304 func MustParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues { 22305 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues(pathStr, valuesStr) 22306 if err != nil { 22307 panic(err) 22308 } 22309 return fpaov 22310 } 22311 22312 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayOfValues struct { 22313 DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPath 22314 values interface{} 22315 } 22316 22317 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayOfValues)(nil) 22318 22319 func (fpaov *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 22320 switch fpaov.selector { 22321 case DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathSelectorGraphicCards: 22322 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) { 22323 values = append(values, v) 22324 } 22325 } 22326 return 22327 } 22328 func (fpaov *DeviceStatusDeviceInfoHardwareInformationGPU_FieldTerminalPathArrayOfValues) AsGraphicCardsArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard, bool) { 22329 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 22330 return res, ok 22331 } 22332 22333 type DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayOfValues struct { 22334 DeviceStatusDeviceInfoHardwareInformationGPU_FieldPath 22335 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 22336 } 22337 22338 var _ DeviceStatusDeviceInfoHardwareInformationGPU_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayOfValues)(nil) 22339 22340 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 22341 return fpsaov.subPathArrayOfValues.GetRawValues() 22342 } 22343 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationGPU_FieldSubPathArrayOfValues) AsGraphicCardsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues, bool) { 22344 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues) 22345 return res, ok 22346 } 22347 22348 // FieldPath provides implementation to handle 22349 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 22350 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath interface { 22351 gotenobject.FieldPath 22352 Selector() DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector 22353 Get(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) []interface{} 22354 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) (interface{}, bool) 22355 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 22356 22357 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue 22358 // (or array of values) and holds passed value. Panics if injected type is incorrect. 22359 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue 22360 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues 22361 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue 22362 } 22363 22364 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector int32 22365 22366 const ( 22367 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector = 0 22368 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector = 1 22369 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector = 2 22370 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector = 3 22371 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector = 4 22372 ) 22373 22374 func (s DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector) String() string { 22375 switch s { 22376 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22377 return "address" 22378 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22379 return "vendor" 22380 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22381 return "product" 22382 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22383 return "name" 22384 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22385 return "subvendor" 22386 default: 22387 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", s)) 22388 } 22389 } 22390 22391 func BuildDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath, error) { 22392 if len(fp) == 0 { 22393 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_PCIDevice") 22394 } 22395 if len(fp) == 1 { 22396 switch fp[0] { 22397 case "address": 22398 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress}, nil 22399 case "vendor": 22400 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor}, nil 22401 case "product": 22402 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct}, nil 22403 case "name": 22404 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName}, nil 22405 case "subvendor": 22406 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor}, nil 22407 } 22408 } 22409 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_PCIDevice", fp) 22410 } 22411 22412 func ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath, error) { 22413 fp, err := gotenobject.ParseRawFieldPath(rawField) 22414 if err != nil { 22415 return nil, err 22416 } 22417 return BuildDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(fp) 22418 } 22419 22420 func MustParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath { 22421 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(rawField) 22422 if err != nil { 22423 panic(err) 22424 } 22425 return fp 22426 } 22427 22428 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath struct { 22429 selector DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector 22430 } 22431 22432 var _ DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath)(nil) 22433 22434 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelector { 22435 return fp.selector 22436 } 22437 22438 // String returns path representation in proto convention 22439 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) String() string { 22440 return fp.selector.String() 22441 } 22442 22443 // JSONString returns path representation is JSON convention 22444 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) JSONString() string { 22445 return strcase.ToLowerCamel(fp.String()) 22446 } 22447 22448 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_PCIDevice 22449 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) (values []interface{}) { 22450 if source != nil { 22451 switch fp.selector { 22452 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22453 values = append(values, source.Address) 22454 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22455 values = append(values, source.Vendor) 22456 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22457 values = append(values, source.Product) 22458 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22459 values = append(values, source.Name) 22460 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22461 values = append(values, source.Subvendor) 22462 default: 22463 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22464 } 22465 } 22466 return 22467 } 22468 22469 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 22470 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 22471 } 22472 22473 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_PCIDevice 22474 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) (interface{}, bool) { 22475 switch fp.selector { 22476 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22477 return source.GetAddress(), source != nil 22478 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22479 return source.GetVendor(), source != nil 22480 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22481 return source.GetProduct(), source != nil 22482 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22483 return source.GetName(), source != nil 22484 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22485 return source.GetSubvendor(), source != nil 22486 default: 22487 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22488 } 22489 } 22490 22491 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 22492 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 22493 } 22494 22495 // GetDefault returns a default value of the field type 22496 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) GetDefault() interface{} { 22497 switch fp.selector { 22498 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22499 return "" 22500 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22501 return "" 22502 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22503 return "" 22504 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22505 return "" 22506 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22507 return "" 22508 default: 22509 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22510 } 22511 } 22512 22513 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) { 22514 if item != nil { 22515 switch fp.selector { 22516 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22517 item.Address = "" 22518 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22519 item.Vendor = "" 22520 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22521 item.Product = "" 22522 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22523 item.Name = "" 22524 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22525 item.Subvendor = "" 22526 default: 22527 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22528 } 22529 } 22530 } 22531 22532 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) ClearValueRaw(item proto.Message) { 22533 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 22534 } 22535 22536 // IsLeaf - whether field path is holds simple value 22537 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) IsLeaf() bool { 22538 return fp.selector == DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress || 22539 fp.selector == DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor || 22540 fp.selector == DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct || 22541 fp.selector == DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName || 22542 fp.selector == DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor 22543 } 22544 22545 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 22546 return []gotenobject.FieldPath{fp} 22547 } 22548 22549 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue { 22550 switch fp.selector { 22551 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22552 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, value: value.(string)} 22553 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22554 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, value: value.(string)} 22555 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22556 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, value: value.(string)} 22557 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22558 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, value: value.(string)} 22559 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22560 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, value: value.(string)} 22561 default: 22562 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22563 } 22564 } 22565 22566 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 22567 return fp.WithIValue(value) 22568 } 22569 22570 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues { 22571 fpaov := &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp} 22572 switch fp.selector { 22573 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22574 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, values: values.([]string)} 22575 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22576 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, values: values.([]string)} 22577 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22578 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, values: values.([]string)} 22579 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22580 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, values: values.([]string)} 22581 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22582 return &DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath: *fp, values: values.([]string)} 22583 default: 22584 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22585 } 22586 return fpaov 22587 } 22588 22589 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 22590 return fp.WithIArrayOfValues(values) 22591 } 22592 22593 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue { 22594 switch fp.selector { 22595 default: 22596 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fp.selector)) 22597 } 22598 } 22599 22600 func (fp *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 22601 return fp.WithIArrayItemValue(value) 22602 } 22603 22604 // DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue allows storing values for PCIDevice fields according to their type 22605 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue interface { 22606 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath 22607 gotenobject.FieldPathValue 22608 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 22609 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) (cmp int, comparable bool) 22610 } 22611 22612 func ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue, error) { 22613 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(pathStr) 22614 if err != nil { 22615 return nil, err 22616 } 22617 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 22618 if err != nil { 22619 return nil, status.Errorf(codes.InvalidArgument, "error parsing PCIDevice field path value from %s: %v", valueStr, err) 22620 } 22621 return fpv.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue), nil 22622 } 22623 22624 func MustParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue { 22625 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue(pathStr, valueStr) 22626 if err != nil { 22627 panic(err) 22628 } 22629 return fpv 22630 } 22631 22632 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue struct { 22633 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath 22634 value interface{} 22635 } 22636 22637 var _ DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue)(nil) 22638 22639 // GetRawValue returns raw value stored under selected path for 'PCIDevice' as interface{} 22640 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) GetRawValue() interface{} { 22641 return fpv.value 22642 } 22643 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) AsAddressValue() (string, bool) { 22644 res, ok := fpv.value.(string) 22645 return res, ok 22646 } 22647 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) AsVendorValue() (string, bool) { 22648 res, ok := fpv.value.(string) 22649 return res, ok 22650 } 22651 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) AsProductValue() (string, bool) { 22652 res, ok := fpv.value.(string) 22653 return res, ok 22654 } 22655 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) AsNameValue() (string, bool) { 22656 res, ok := fpv.value.(string) 22657 return res, ok 22658 } 22659 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) AsSubvendorValue() (string, bool) { 22660 res, ok := fpv.value.(string) 22661 return res, ok 22662 } 22663 22664 // SetTo stores value for selected field for object PCIDevice 22665 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_PCIDevice) { 22666 if *target == nil { 22667 *target = new(Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 22668 } 22669 switch fpv.selector { 22670 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22671 (*target).Address = fpv.value.(string) 22672 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22673 (*target).Vendor = fpv.value.(string) 22674 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22675 (*target).Product = fpv.value.(string) 22676 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22677 (*target).Name = fpv.value.(string) 22678 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22679 (*target).Subvendor = fpv.value.(string) 22680 default: 22681 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fpv.selector)) 22682 } 22683 } 22684 22685 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) SetToRaw(target proto.Message) { 22686 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 22687 fpv.SetTo(&typedObject) 22688 } 22689 22690 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_PCIDevice'. 22691 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) (int, bool) { 22692 switch fpv.selector { 22693 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22694 leftValue := fpv.value.(string) 22695 rightValue := source.GetAddress() 22696 if (leftValue) == (rightValue) { 22697 return 0, true 22698 } else if (leftValue) < (rightValue) { 22699 return -1, true 22700 } else { 22701 return 1, true 22702 } 22703 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22704 leftValue := fpv.value.(string) 22705 rightValue := source.GetVendor() 22706 if (leftValue) == (rightValue) { 22707 return 0, true 22708 } else if (leftValue) < (rightValue) { 22709 return -1, true 22710 } else { 22711 return 1, true 22712 } 22713 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22714 leftValue := fpv.value.(string) 22715 rightValue := source.GetProduct() 22716 if (leftValue) == (rightValue) { 22717 return 0, true 22718 } else if (leftValue) < (rightValue) { 22719 return -1, true 22720 } else { 22721 return 1, true 22722 } 22723 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22724 leftValue := fpv.value.(string) 22725 rightValue := source.GetName() 22726 if (leftValue) == (rightValue) { 22727 return 0, true 22728 } else if (leftValue) < (rightValue) { 22729 return -1, true 22730 } else { 22731 return 1, true 22732 } 22733 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22734 leftValue := fpv.value.(string) 22735 rightValue := source.GetSubvendor() 22736 if (leftValue) == (rightValue) { 22737 return 0, true 22738 } else if (leftValue) < (rightValue) { 22739 return -1, true 22740 } else { 22741 return 1, true 22742 } 22743 default: 22744 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_PCIDevice: %d", fpv.selector)) 22745 } 22746 } 22747 22748 func (fpv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 22749 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 22750 } 22751 22752 // DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue allows storing single item in Path-specific values for PCIDevice according to their type 22753 // Present only for array (repeated) types. 22754 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue interface { 22755 gotenobject.FieldPathArrayItemValue 22756 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath 22757 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) bool 22758 } 22759 22760 // ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 22761 func ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue, error) { 22762 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(pathStr) 22763 if err != nil { 22764 return nil, err 22765 } 22766 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 22767 if err != nil { 22768 return nil, status.Errorf(codes.InvalidArgument, "error parsing PCIDevice field path array item value from %s: %v", valueStr, err) 22769 } 22770 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue), nil 22771 } 22772 22773 func MustParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue { 22774 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue(pathStr, valueStr) 22775 if err != nil { 22776 panic(err) 22777 } 22778 return fpaiv 22779 } 22780 22781 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayItemValue struct { 22782 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath 22783 value interface{} 22784 } 22785 22786 var _ DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayItemValue)(nil) 22787 22788 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_PCIDevice as interface{} 22789 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 22790 return fpaiv.value 22791 } 22792 22793 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) (interface{}, bool) { 22794 return nil, false 22795 } 22796 22797 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 22798 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)) 22799 } 22800 22801 // Contains returns a boolean indicating if value that is being held is present in given 'PCIDevice' 22802 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_PCIDevice) bool { 22803 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath.Get(source) 22804 for _, v := range slice { 22805 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 22806 if proto.Equal(asProtoMsg, v.(proto.Message)) { 22807 return true 22808 } 22809 } else if reflect.DeepEqual(v, fpaiv.value) { 22810 return true 22811 } 22812 } 22813 return false 22814 } 22815 22816 // DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues allows storing slice of values for PCIDevice fields according to their type 22817 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues interface { 22818 gotenobject.FieldPathArrayOfValues 22819 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath 22820 } 22821 22822 func ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues, error) { 22823 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(pathStr) 22824 if err != nil { 22825 return nil, err 22826 } 22827 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 22828 if err != nil { 22829 return nil, status.Errorf(codes.InvalidArgument, "error parsing PCIDevice field path array of values from %s: %v", valuesStr, err) 22830 } 22831 return fpaov.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues), nil 22832 } 22833 22834 func MustParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues { 22835 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues(pathStr, valuesStr) 22836 if err != nil { 22837 panic(err) 22838 } 22839 return fpaov 22840 } 22841 22842 type DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues struct { 22843 DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPath 22844 values interface{} 22845 } 22846 22847 var _ DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues)(nil) 22848 22849 func (fpaov *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 22850 switch fpaov.selector { 22851 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorAddress: 22852 for _, v := range fpaov.values.([]string) { 22853 values = append(values, v) 22854 } 22855 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorVendor: 22856 for _, v := range fpaov.values.([]string) { 22857 values = append(values, v) 22858 } 22859 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorProduct: 22860 for _, v := range fpaov.values.([]string) { 22861 values = append(values, v) 22862 } 22863 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorName: 22864 for _, v := range fpaov.values.([]string) { 22865 values = append(values, v) 22866 } 22867 case DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathSelectorSubvendor: 22868 for _, v := range fpaov.values.([]string) { 22869 values = append(values, v) 22870 } 22871 } 22872 return 22873 } 22874 func (fpaov *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues) AsAddressArrayOfValues() ([]string, bool) { 22875 res, ok := fpaov.values.([]string) 22876 return res, ok 22877 } 22878 func (fpaov *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues) AsVendorArrayOfValues() ([]string, bool) { 22879 res, ok := fpaov.values.([]string) 22880 return res, ok 22881 } 22882 func (fpaov *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues) AsProductArrayOfValues() ([]string, bool) { 22883 res, ok := fpaov.values.([]string) 22884 return res, ok 22885 } 22886 func (fpaov *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 22887 res, ok := fpaov.values.([]string) 22888 return res, ok 22889 } 22890 func (fpaov *DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldTerminalPathArrayOfValues) AsSubvendorArrayOfValues() ([]string, bool) { 22891 res, ok := fpaov.values.([]string) 22892 return res, ok 22893 } 22894 22895 // FieldPath provides implementation to handle 22896 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 22897 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath interface { 22898 gotenobject.FieldPath 22899 Selector() DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector 22900 Get(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) []interface{} 22901 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (interface{}, bool) 22902 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 22903 22904 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue 22905 // (or array of values) and holds passed value. Panics if injected type is incorrect. 22906 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue 22907 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues 22908 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue 22909 } 22910 22911 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector int32 22912 22913 const ( 22914 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector = 0 22915 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector = 1 22916 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector = 2 22917 ) 22918 22919 func (s DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector) String() string { 22920 switch s { 22921 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 22922 return "description" 22923 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 22924 return "size_bytes" 22925 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 22926 return "memory_banks" 22927 default: 22928 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", s)) 22929 } 22930 } 22931 22932 func BuildDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath, error) { 22933 if len(fp) == 0 { 22934 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_MemoryInfo") 22935 } 22936 if len(fp) == 1 { 22937 switch fp[0] { 22938 case "description": 22939 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription}, nil 22940 case "size_bytes", "sizeBytes", "size-bytes": 22941 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes}, nil 22942 case "memory_banks", "memoryBanks", "memory-banks": 22943 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks}, nil 22944 } 22945 } else { 22946 switch fp[0] { 22947 case "memory_banks", "memoryBanks", "memory-banks": 22948 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(fp[1:]); err != nil { 22949 return nil, err 22950 } else { 22951 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks, subPath: subpath}, nil 22952 } 22953 } 22954 } 22955 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_MemoryInfo", fp) 22956 } 22957 22958 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath, error) { 22959 fp, err := gotenobject.ParseRawFieldPath(rawField) 22960 if err != nil { 22961 return nil, err 22962 } 22963 return BuildDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(fp) 22964 } 22965 22966 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath { 22967 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(rawField) 22968 if err != nil { 22969 panic(err) 22970 } 22971 return fp 22972 } 22973 22974 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath struct { 22975 selector DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector 22976 } 22977 22978 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath)(nil) 22979 22980 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector { 22981 return fp.selector 22982 } 22983 22984 // String returns path representation in proto convention 22985 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) String() string { 22986 return fp.selector.String() 22987 } 22988 22989 // JSONString returns path representation is JSON convention 22990 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) JSONString() string { 22991 return strcase.ToLowerCamel(fp.String()) 22992 } 22993 22994 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_MemoryInfo 22995 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (values []interface{}) { 22996 if source != nil { 22997 switch fp.selector { 22998 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 22999 values = append(values, source.Description) 23000 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23001 values = append(values, source.SizeBytes) 23002 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23003 for _, value := range source.GetMemoryBanks() { 23004 values = append(values, value) 23005 } 23006 default: 23007 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23008 } 23009 } 23010 return 23011 } 23012 23013 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 23014 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23015 } 23016 23017 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_MemoryInfo 23018 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (interface{}, bool) { 23019 switch fp.selector { 23020 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23021 return source.GetDescription(), source != nil 23022 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23023 return source.GetSizeBytes(), source != nil 23024 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23025 res := source.GetMemoryBanks() 23026 return res, res != nil 23027 default: 23028 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23029 } 23030 } 23031 23032 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 23033 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23034 } 23035 23036 // GetDefault returns a default value of the field type 23037 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) GetDefault() interface{} { 23038 switch fp.selector { 23039 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23040 return "" 23041 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23042 return int64(0) 23043 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23044 return ([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)(nil) 23045 default: 23046 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23047 } 23048 } 23049 23050 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) { 23051 if item != nil { 23052 switch fp.selector { 23053 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23054 item.Description = "" 23055 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23056 item.SizeBytes = int64(0) 23057 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23058 item.MemoryBanks = nil 23059 default: 23060 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23061 } 23062 } 23063 } 23064 23065 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 23066 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23067 } 23068 23069 // IsLeaf - whether field path is holds simple value 23070 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) IsLeaf() bool { 23071 return fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription || 23072 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes 23073 } 23074 23075 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 23076 return []gotenobject.FieldPath{fp} 23077 } 23078 23079 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue { 23080 switch fp.selector { 23081 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23082 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, value: value.(string)} 23083 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23084 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, value: value.(int64)} 23085 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23086 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)} 23087 default: 23088 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23089 } 23090 } 23091 23092 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 23093 return fp.WithIValue(value) 23094 } 23095 23096 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues { 23097 fpaov := &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp} 23098 switch fp.selector { 23099 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23100 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, values: values.([]string)} 23101 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23102 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, values: values.([]int64)} 23103 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23104 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)} 23105 default: 23106 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23107 } 23108 return fpaov 23109 } 23110 23111 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 23112 return fp.WithIArrayOfValues(values) 23113 } 23114 23115 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue { 23116 switch fp.selector { 23117 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23118 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)} 23119 default: 23120 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fp.selector)) 23121 } 23122 } 23123 23124 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 23125 return fp.WithIArrayItemValue(value) 23126 } 23127 23128 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath struct { 23129 selector DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector 23130 subPath gotenobject.FieldPath 23131 } 23132 23133 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath)(nil) 23134 23135 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelector { 23136 return fps.selector 23137 } 23138 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) AsMemoryBanksSubPath() (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath, bool) { 23139 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath) 23140 return res, ok 23141 } 23142 23143 // String returns path representation in proto convention 23144 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) String() string { 23145 return fps.selector.String() + "." + fps.subPath.String() 23146 } 23147 23148 // JSONString returns path representation is JSON convention 23149 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) JSONString() string { 23150 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 23151 } 23152 23153 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_MemoryInfo 23154 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (values []interface{}) { 23155 switch fps.selector { 23156 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23157 for _, item := range source.GetMemoryBanks() { 23158 values = append(values, fps.subPath.GetRaw(item)...) 23159 } 23160 default: 23161 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fps.selector)) 23162 } 23163 return 23164 } 23165 23166 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) GetRaw(source proto.Message) []interface{} { 23167 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23168 } 23169 23170 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_MemoryInfo 23171 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (interface{}, bool) { 23172 switch fps.selector { 23173 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23174 if len(source.GetMemoryBanks()) == 0 { 23175 return nil, false 23176 } 23177 return fps.subPath.GetSingleRaw(source.GetMemoryBanks()[0]) 23178 default: 23179 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fps.selector)) 23180 } 23181 } 23182 23183 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 23184 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23185 } 23186 23187 // GetDefault returns a default value of the field type 23188 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) GetDefault() interface{} { 23189 return fps.subPath.GetDefault() 23190 } 23191 23192 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) { 23193 if item != nil { 23194 switch fps.selector { 23195 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23196 for _, subItem := range item.MemoryBanks { 23197 fps.subPath.ClearValueRaw(subItem) 23198 } 23199 default: 23200 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fps.selector)) 23201 } 23202 } 23203 } 23204 23205 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) ClearValueRaw(item proto.Message) { 23206 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23207 } 23208 23209 // IsLeaf - whether field path is holds simple value 23210 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) IsLeaf() bool { 23211 return fps.subPath.IsLeaf() 23212 } 23213 23214 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 23215 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath{selector: fps.selector}} 23216 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 23217 return iPaths 23218 } 23219 23220 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue { 23221 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 23222 } 23223 23224 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 23225 return fps.WithIValue(value) 23226 } 23227 23228 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues { 23229 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 23230 } 23231 23232 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 23233 return fps.WithIArrayOfValues(values) 23234 } 23235 23236 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue { 23237 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 23238 } 23239 23240 func (fps *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 23241 return fps.WithIArrayItemValue(value) 23242 } 23243 23244 // DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue allows storing values for MemoryInfo fields according to their type 23245 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue interface { 23246 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 23247 gotenobject.FieldPathValue 23248 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 23249 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (cmp int, comparable bool) 23250 } 23251 23252 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue, error) { 23253 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(pathStr) 23254 if err != nil { 23255 return nil, err 23256 } 23257 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 23258 if err != nil { 23259 return nil, status.Errorf(codes.InvalidArgument, "error parsing MemoryInfo field path value from %s: %v", valueStr, err) 23260 } 23261 return fpv.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue), nil 23262 } 23263 23264 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue { 23265 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue(pathStr, valueStr) 23266 if err != nil { 23267 panic(err) 23268 } 23269 return fpv 23270 } 23271 23272 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue struct { 23273 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath 23274 value interface{} 23275 } 23276 23277 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue)(nil) 23278 23279 // GetRawValue returns raw value stored under selected path for 'MemoryInfo' as interface{} 23280 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) GetRawValue() interface{} { 23281 return fpv.value 23282 } 23283 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 23284 res, ok := fpv.value.(string) 23285 return res, ok 23286 } 23287 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) AsSizeBytesValue() (int64, bool) { 23288 res, ok := fpv.value.(int64) 23289 return res, ok 23290 } 23291 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) AsMemoryBanksValue() ([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank, bool) { 23292 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 23293 return res, ok 23294 } 23295 23296 // SetTo stores value for selected field for object MemoryInfo 23297 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) { 23298 if *target == nil { 23299 *target = new(Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 23300 } 23301 switch fpv.selector { 23302 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23303 (*target).Description = fpv.value.(string) 23304 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23305 (*target).SizeBytes = fpv.value.(int64) 23306 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23307 (*target).MemoryBanks = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 23308 default: 23309 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fpv.selector)) 23310 } 23311 } 23312 23313 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 23314 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 23315 fpv.SetTo(&typedObject) 23316 } 23317 23318 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_MemoryInfo'. 23319 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (int, bool) { 23320 switch fpv.selector { 23321 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23322 leftValue := fpv.value.(string) 23323 rightValue := source.GetDescription() 23324 if (leftValue) == (rightValue) { 23325 return 0, true 23326 } else if (leftValue) < (rightValue) { 23327 return -1, true 23328 } else { 23329 return 1, true 23330 } 23331 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23332 leftValue := fpv.value.(int64) 23333 rightValue := source.GetSizeBytes() 23334 if (leftValue) == (rightValue) { 23335 return 0, true 23336 } else if (leftValue) < (rightValue) { 23337 return -1, true 23338 } else { 23339 return 1, true 23340 } 23341 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23342 return 0, false 23343 default: 23344 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fpv.selector)) 23345 } 23346 } 23347 23348 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 23349 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23350 } 23351 23352 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue struct { 23353 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 23354 subPathValue gotenobject.FieldPathValue 23355 } 23356 23357 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue)(nil) 23358 23359 func (fpvs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue) AsMemoryBanksPathValue() (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue, bool) { 23360 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue) 23361 return res, ok 23362 } 23363 23364 func (fpvs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) { 23365 if *target == nil { 23366 *target = new(Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 23367 } 23368 switch fpvs.Selector() { 23369 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23370 panic("FieldPath setter is unsupported for array subpaths") 23371 default: 23372 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fpvs.Selector())) 23373 } 23374 } 23375 23376 func (fpvs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue) SetToRaw(target proto.Message) { 23377 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) 23378 fpvs.SetTo(&typedObject) 23379 } 23380 23381 func (fpvs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue) GetRawValue() interface{} { 23382 return fpvs.subPathValue.GetRawValue() 23383 } 23384 23385 func (fpvs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (int, bool) { 23386 switch fpvs.Selector() { 23387 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23388 return 0, false // repeated field 23389 default: 23390 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fpvs.Selector())) 23391 } 23392 } 23393 23394 func (fpvs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 23395 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23396 } 23397 23398 // DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for MemoryInfo according to their type 23399 // Present only for array (repeated) types. 23400 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue interface { 23401 gotenobject.FieldPathArrayItemValue 23402 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 23403 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) bool 23404 } 23405 23406 // ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 23407 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue, error) { 23408 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(pathStr) 23409 if err != nil { 23410 return nil, err 23411 } 23412 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 23413 if err != nil { 23414 return nil, status.Errorf(codes.InvalidArgument, "error parsing MemoryInfo field path array item value from %s: %v", valueStr, err) 23415 } 23416 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue), nil 23417 } 23418 23419 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue { 23420 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue(pathStr, valueStr) 23421 if err != nil { 23422 panic(err) 23423 } 23424 return fpaiv 23425 } 23426 23427 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue struct { 23428 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath 23429 value interface{} 23430 } 23431 23432 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue)(nil) 23433 23434 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_MemoryInfo as interface{} 23435 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 23436 return fpaiv.value 23437 } 23438 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue) AsMemoryBanksItemValue() (*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank, bool) { 23439 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 23440 return res, ok 23441 } 23442 23443 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) (interface{}, bool) { 23444 return nil, false 23445 } 23446 23447 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 23448 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo)) 23449 } 23450 23451 // Contains returns a boolean indicating if value that is being held is present in given 'MemoryInfo' 23452 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) bool { 23453 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath.Get(source) 23454 for _, v := range slice { 23455 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 23456 if proto.Equal(asProtoMsg, v.(proto.Message)) { 23457 return true 23458 } 23459 } else if reflect.DeepEqual(v, fpaiv.value) { 23460 return true 23461 } 23462 } 23463 return false 23464 } 23465 23466 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayItemValue struct { 23467 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 23468 subPathItemValue gotenobject.FieldPathArrayItemValue 23469 } 23470 23471 // GetRawValue returns stored array item value 23472 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 23473 return fpaivs.subPathItemValue.GetRawItemValue() 23474 } 23475 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayItemValue) AsMemoryBanksPathItemValue() (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue, bool) { 23476 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue) 23477 return res, ok 23478 } 23479 23480 // Contains returns a boolean indicating if value that is being held is present in given 'MemoryInfo' 23481 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo) bool { 23482 switch fpaivs.Selector() { 23483 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23484 return false // repeated/map field 23485 default: 23486 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo: %d", fpaivs.Selector())) 23487 } 23488 } 23489 23490 // DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues allows storing slice of values for MemoryInfo fields according to their type 23491 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues interface { 23492 gotenobject.FieldPathArrayOfValues 23493 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 23494 } 23495 23496 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues, error) { 23497 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath(pathStr) 23498 if err != nil { 23499 return nil, err 23500 } 23501 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 23502 if err != nil { 23503 return nil, status.Errorf(codes.InvalidArgument, "error parsing MemoryInfo field path array of values from %s: %v", valuesStr, err) 23504 } 23505 return fpaov.(DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues), nil 23506 } 23507 23508 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues { 23509 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues(pathStr, valuesStr) 23510 if err != nil { 23511 panic(err) 23512 } 23513 return fpaov 23514 } 23515 23516 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues struct { 23517 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPath 23518 values interface{} 23519 } 23520 23521 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues)(nil) 23522 23523 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 23524 switch fpaov.selector { 23525 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorDescription: 23526 for _, v := range fpaov.values.([]string) { 23527 values = append(values, v) 23528 } 23529 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorSizeBytes: 23530 for _, v := range fpaov.values.([]int64) { 23531 values = append(values, v) 23532 } 23533 case DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathSelectorMemoryBanks: 23534 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) { 23535 values = append(values, v) 23536 } 23537 } 23538 return 23539 } 23540 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 23541 res, ok := fpaov.values.([]string) 23542 return res, ok 23543 } 23544 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues) AsSizeBytesArrayOfValues() ([]int64, bool) { 23545 res, ok := fpaov.values.([]int64) 23546 return res, ok 23547 } 23548 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldTerminalPathArrayOfValues) AsMemoryBanksArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank, bool) { 23549 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 23550 return res, ok 23551 } 23552 23553 type DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayOfValues struct { 23554 DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPath 23555 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 23556 } 23557 23558 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayOfValues)(nil) 23559 23560 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 23561 return fpsaov.subPathArrayOfValues.GetRawValues() 23562 } 23563 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfo_FieldSubPathArrayOfValues) AsMemoryBanksPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues, bool) { 23564 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues) 23565 return res, ok 23566 } 23567 23568 // FieldPath provides implementation to handle 23569 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 23570 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath interface { 23571 gotenobject.FieldPath 23572 Selector() DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector 23573 Get(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) []interface{} 23574 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (interface{}, bool) 23575 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 23576 23577 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue 23578 // (or array of values) and holds passed value. Panics if injected type is incorrect. 23579 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue 23580 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues 23581 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue 23582 } 23583 23584 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector int32 23585 23586 const ( 23587 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector = 0 23588 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector = 1 23589 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector = 2 23590 ) 23591 23592 func (s DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector) String() string { 23593 switch s { 23594 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23595 return "status" 23596 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23597 return "cli_version" 23598 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23599 return "modules" 23600 default: 23601 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", s)) 23602 } 23603 } 23604 23605 func BuildDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath, error) { 23606 if len(fp) == 0 { 23607 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_HailoInfo") 23608 } 23609 if len(fp) == 1 { 23610 switch fp[0] { 23611 case "status": 23612 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus}, nil 23613 case "cli_version", "cliVersion", "cli-version": 23614 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion}, nil 23615 case "modules": 23616 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules}, nil 23617 } 23618 } else { 23619 switch fp[0] { 23620 case "modules": 23621 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(fp[1:]); err != nil { 23622 return nil, err 23623 } else { 23624 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules, subPath: subpath}, nil 23625 } 23626 } 23627 } 23628 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_HailoInfo", fp) 23629 } 23630 23631 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath, error) { 23632 fp, err := gotenobject.ParseRawFieldPath(rawField) 23633 if err != nil { 23634 return nil, err 23635 } 23636 return BuildDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(fp) 23637 } 23638 23639 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath { 23640 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(rawField) 23641 if err != nil { 23642 panic(err) 23643 } 23644 return fp 23645 } 23646 23647 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath struct { 23648 selector DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector 23649 } 23650 23651 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath)(nil) 23652 23653 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector { 23654 return fp.selector 23655 } 23656 23657 // String returns path representation in proto convention 23658 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) String() string { 23659 return fp.selector.String() 23660 } 23661 23662 // JSONString returns path representation is JSON convention 23663 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) JSONString() string { 23664 return strcase.ToLowerCamel(fp.String()) 23665 } 23666 23667 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_HailoInfo 23668 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (values []interface{}) { 23669 if source != nil { 23670 switch fp.selector { 23671 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23672 values = append(values, source.Status) 23673 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23674 values = append(values, source.CliVersion) 23675 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23676 for _, value := range source.GetModules() { 23677 values = append(values, value) 23678 } 23679 default: 23680 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23681 } 23682 } 23683 return 23684 } 23685 23686 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 23687 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 23688 } 23689 23690 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_HailoInfo 23691 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (interface{}, bool) { 23692 switch fp.selector { 23693 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23694 return source.GetStatus(), source != nil 23695 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23696 return source.GetCliVersion(), source != nil 23697 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23698 res := source.GetModules() 23699 return res, res != nil 23700 default: 23701 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23702 } 23703 } 23704 23705 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 23706 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 23707 } 23708 23709 // GetDefault returns a default value of the field type 23710 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) GetDefault() interface{} { 23711 switch fp.selector { 23712 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23713 return "" 23714 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23715 return "" 23716 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23717 return ([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)(nil) 23718 default: 23719 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23720 } 23721 } 23722 23723 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) { 23724 if item != nil { 23725 switch fp.selector { 23726 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23727 item.Status = "" 23728 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23729 item.CliVersion = "" 23730 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23731 item.Modules = nil 23732 default: 23733 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23734 } 23735 } 23736 } 23737 23738 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 23739 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 23740 } 23741 23742 // IsLeaf - whether field path is holds simple value 23743 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) IsLeaf() bool { 23744 return fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus || 23745 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion 23746 } 23747 23748 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 23749 return []gotenobject.FieldPath{fp} 23750 } 23751 23752 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue { 23753 switch fp.selector { 23754 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23755 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, value: value.(string)} 23756 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23757 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, value: value.(string)} 23758 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23759 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)} 23760 default: 23761 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23762 } 23763 } 23764 23765 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 23766 return fp.WithIValue(value) 23767 } 23768 23769 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues { 23770 fpaov := &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp} 23771 switch fp.selector { 23772 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23773 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, values: values.([]string)} 23774 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23775 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, values: values.([]string)} 23776 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23777 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)} 23778 default: 23779 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23780 } 23781 return fpaov 23782 } 23783 23784 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 23785 return fp.WithIArrayOfValues(values) 23786 } 23787 23788 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue { 23789 switch fp.selector { 23790 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23791 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)} 23792 default: 23793 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fp.selector)) 23794 } 23795 } 23796 23797 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 23798 return fp.WithIArrayItemValue(value) 23799 } 23800 23801 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath struct { 23802 selector DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector 23803 subPath gotenobject.FieldPath 23804 } 23805 23806 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath)(nil) 23807 23808 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelector { 23809 return fps.selector 23810 } 23811 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) AsModulesSubPath() (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath, bool) { 23812 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath) 23813 return res, ok 23814 } 23815 23816 // String returns path representation in proto convention 23817 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) String() string { 23818 return fps.selector.String() + "." + fps.subPath.String() 23819 } 23820 23821 // JSONString returns path representation is JSON convention 23822 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) JSONString() string { 23823 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 23824 } 23825 23826 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_HailoInfo 23827 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (values []interface{}) { 23828 switch fps.selector { 23829 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23830 for _, item := range source.GetModules() { 23831 values = append(values, fps.subPath.GetRaw(item)...) 23832 } 23833 default: 23834 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fps.selector)) 23835 } 23836 return 23837 } 23838 23839 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) GetRaw(source proto.Message) []interface{} { 23840 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 23841 } 23842 23843 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_HailoInfo 23844 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (interface{}, bool) { 23845 switch fps.selector { 23846 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23847 if len(source.GetModules()) == 0 { 23848 return nil, false 23849 } 23850 return fps.subPath.GetSingleRaw(source.GetModules()[0]) 23851 default: 23852 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fps.selector)) 23853 } 23854 } 23855 23856 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 23857 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 23858 } 23859 23860 // GetDefault returns a default value of the field type 23861 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) GetDefault() interface{} { 23862 return fps.subPath.GetDefault() 23863 } 23864 23865 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) { 23866 if item != nil { 23867 switch fps.selector { 23868 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23869 for _, subItem := range item.Modules { 23870 fps.subPath.ClearValueRaw(subItem) 23871 } 23872 default: 23873 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fps.selector)) 23874 } 23875 } 23876 } 23877 23878 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) ClearValueRaw(item proto.Message) { 23879 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 23880 } 23881 23882 // IsLeaf - whether field path is holds simple value 23883 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) IsLeaf() bool { 23884 return fps.subPath.IsLeaf() 23885 } 23886 23887 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 23888 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath{selector: fps.selector}} 23889 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 23890 return iPaths 23891 } 23892 23893 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue { 23894 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 23895 } 23896 23897 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 23898 return fps.WithIValue(value) 23899 } 23900 23901 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues { 23902 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 23903 } 23904 23905 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 23906 return fps.WithIArrayOfValues(values) 23907 } 23908 23909 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue { 23910 return &DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 23911 } 23912 23913 func (fps *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 23914 return fps.WithIArrayItemValue(value) 23915 } 23916 23917 // DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue allows storing values for HailoInfo fields according to their type 23918 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue interface { 23919 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 23920 gotenobject.FieldPathValue 23921 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 23922 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (cmp int, comparable bool) 23923 } 23924 23925 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue, error) { 23926 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(pathStr) 23927 if err != nil { 23928 return nil, err 23929 } 23930 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 23931 if err != nil { 23932 return nil, status.Errorf(codes.InvalidArgument, "error parsing HailoInfo field path value from %s: %v", valueStr, err) 23933 } 23934 return fpv.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue), nil 23935 } 23936 23937 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue { 23938 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue(pathStr, valueStr) 23939 if err != nil { 23940 panic(err) 23941 } 23942 return fpv 23943 } 23944 23945 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue struct { 23946 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath 23947 value interface{} 23948 } 23949 23950 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue)(nil) 23951 23952 // GetRawValue returns raw value stored under selected path for 'HailoInfo' as interface{} 23953 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) GetRawValue() interface{} { 23954 return fpv.value 23955 } 23956 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) AsStatusValue() (string, bool) { 23957 res, ok := fpv.value.(string) 23958 return res, ok 23959 } 23960 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) AsCliVersionValue() (string, bool) { 23961 res, ok := fpv.value.(string) 23962 return res, ok 23963 } 23964 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) AsModulesValue() ([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo, bool) { 23965 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 23966 return res, ok 23967 } 23968 23969 // SetTo stores value for selected field for object HailoInfo 23970 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_HailoInfo) { 23971 if *target == nil { 23972 *target = new(Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 23973 } 23974 switch fpv.selector { 23975 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23976 (*target).Status = fpv.value.(string) 23977 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 23978 (*target).CliVersion = fpv.value.(string) 23979 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 23980 (*target).Modules = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 23981 default: 23982 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fpv.selector)) 23983 } 23984 } 23985 23986 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 23987 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 23988 fpv.SetTo(&typedObject) 23989 } 23990 23991 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_HailoInfo'. 23992 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (int, bool) { 23993 switch fpv.selector { 23994 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 23995 leftValue := fpv.value.(string) 23996 rightValue := source.GetStatus() 23997 if (leftValue) == (rightValue) { 23998 return 0, true 23999 } else if (leftValue) < (rightValue) { 24000 return -1, true 24001 } else { 24002 return 1, true 24003 } 24004 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 24005 leftValue := fpv.value.(string) 24006 rightValue := source.GetCliVersion() 24007 if (leftValue) == (rightValue) { 24008 return 0, true 24009 } else if (leftValue) < (rightValue) { 24010 return -1, true 24011 } else { 24012 return 1, true 24013 } 24014 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 24015 return 0, false 24016 default: 24017 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fpv.selector)) 24018 } 24019 } 24020 24021 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 24022 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 24023 } 24024 24025 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue struct { 24026 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 24027 subPathValue gotenobject.FieldPathValue 24028 } 24029 24030 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue)(nil) 24031 24032 func (fpvs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue) AsModulesPathValue() (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue, bool) { 24033 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue) 24034 return res, ok 24035 } 24036 24037 func (fpvs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_HailoInfo) { 24038 if *target == nil { 24039 *target = new(Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 24040 } 24041 switch fpvs.Selector() { 24042 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 24043 panic("FieldPath setter is unsupported for array subpaths") 24044 default: 24045 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fpvs.Selector())) 24046 } 24047 } 24048 24049 func (fpvs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue) SetToRaw(target proto.Message) { 24050 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) 24051 fpvs.SetTo(&typedObject) 24052 } 24053 24054 func (fpvs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue) GetRawValue() interface{} { 24055 return fpvs.subPathValue.GetRawValue() 24056 } 24057 24058 func (fpvs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (int, bool) { 24059 switch fpvs.Selector() { 24060 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 24061 return 0, false // repeated field 24062 default: 24063 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fpvs.Selector())) 24064 } 24065 } 24066 24067 func (fpvs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 24068 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 24069 } 24070 24071 // DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for HailoInfo according to their type 24072 // Present only for array (repeated) types. 24073 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue interface { 24074 gotenobject.FieldPathArrayItemValue 24075 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 24076 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo) bool 24077 } 24078 24079 // ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 24080 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue, error) { 24081 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(pathStr) 24082 if err != nil { 24083 return nil, err 24084 } 24085 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 24086 if err != nil { 24087 return nil, status.Errorf(codes.InvalidArgument, "error parsing HailoInfo field path array item value from %s: %v", valueStr, err) 24088 } 24089 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue), nil 24090 } 24091 24092 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue { 24093 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue(pathStr, valueStr) 24094 if err != nil { 24095 panic(err) 24096 } 24097 return fpaiv 24098 } 24099 24100 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue struct { 24101 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath 24102 value interface{} 24103 } 24104 24105 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue)(nil) 24106 24107 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_HailoInfo as interface{} 24108 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 24109 return fpaiv.value 24110 } 24111 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue) AsModulesItemValue() (*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo, bool) { 24112 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 24113 return res, ok 24114 } 24115 24116 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) (interface{}, bool) { 24117 return nil, false 24118 } 24119 24120 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 24121 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo)) 24122 } 24123 24124 // Contains returns a boolean indicating if value that is being held is present in given 'HailoInfo' 24125 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) bool { 24126 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath.Get(source) 24127 for _, v := range slice { 24128 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 24129 if proto.Equal(asProtoMsg, v.(proto.Message)) { 24130 return true 24131 } 24132 } else if reflect.DeepEqual(v, fpaiv.value) { 24133 return true 24134 } 24135 } 24136 return false 24137 } 24138 24139 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayItemValue struct { 24140 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 24141 subPathItemValue gotenobject.FieldPathArrayItemValue 24142 } 24143 24144 // GetRawValue returns stored array item value 24145 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 24146 return fpaivs.subPathItemValue.GetRawItemValue() 24147 } 24148 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayItemValue) AsModulesPathItemValue() (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue, bool) { 24149 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue) 24150 return res, ok 24151 } 24152 24153 // Contains returns a boolean indicating if value that is being held is present in given 'HailoInfo' 24154 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo) bool { 24155 switch fpaivs.Selector() { 24156 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 24157 return false // repeated/map field 24158 default: 24159 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo: %d", fpaivs.Selector())) 24160 } 24161 } 24162 24163 // DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues allows storing slice of values for HailoInfo fields according to their type 24164 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues interface { 24165 gotenobject.FieldPathArrayOfValues 24166 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 24167 } 24168 24169 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues, error) { 24170 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath(pathStr) 24171 if err != nil { 24172 return nil, err 24173 } 24174 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 24175 if err != nil { 24176 return nil, status.Errorf(codes.InvalidArgument, "error parsing HailoInfo field path array of values from %s: %v", valuesStr, err) 24177 } 24178 return fpaov.(DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues), nil 24179 } 24180 24181 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues { 24182 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues(pathStr, valuesStr) 24183 if err != nil { 24184 panic(err) 24185 } 24186 return fpaov 24187 } 24188 24189 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues struct { 24190 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPath 24191 values interface{} 24192 } 24193 24194 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues)(nil) 24195 24196 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 24197 switch fpaov.selector { 24198 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorStatus: 24199 for _, v := range fpaov.values.([]string) { 24200 values = append(values, v) 24201 } 24202 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorCliVersion: 24203 for _, v := range fpaov.values.([]string) { 24204 values = append(values, v) 24205 } 24206 case DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathSelectorModules: 24207 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) { 24208 values = append(values, v) 24209 } 24210 } 24211 return 24212 } 24213 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues) AsStatusArrayOfValues() ([]string, bool) { 24214 res, ok := fpaov.values.([]string) 24215 return res, ok 24216 } 24217 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues) AsCliVersionArrayOfValues() ([]string, bool) { 24218 res, ok := fpaov.values.([]string) 24219 return res, ok 24220 } 24221 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldTerminalPathArrayOfValues) AsModulesArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo, bool) { 24222 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 24223 return res, ok 24224 } 24225 24226 type DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayOfValues struct { 24227 DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPath 24228 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 24229 } 24230 24231 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayOfValues)(nil) 24232 24233 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 24234 return fpsaov.subPathArrayOfValues.GetRawValues() 24235 } 24236 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationHailoInfo_FieldSubPathArrayOfValues) AsModulesPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues, bool) { 24237 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues) 24238 return res, ok 24239 } 24240 24241 // FieldPath provides implementation to handle 24242 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 24243 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath interface { 24244 gotenobject.FieldPath 24245 Selector() DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector 24246 Get(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) []interface{} 24247 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (interface{}, bool) 24248 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 24249 24250 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue 24251 // (or array of values) and holds passed value. Panics if injected type is incorrect. 24252 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue 24253 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues 24254 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue 24255 } 24256 24257 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector int32 24258 24259 const ( 24260 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector = 0 24261 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector = 1 24262 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector = 2 24263 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector = 3 24264 ) 24265 24266 func (s DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector) String() string { 24267 switch s { 24268 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24269 return "status" 24270 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24271 return "driver_version" 24272 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24273 return "cuda_version" 24274 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24275 return "gpus" 24276 default: 24277 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", s)) 24278 } 24279 } 24280 24281 func BuildDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath, error) { 24282 if len(fp) == 0 { 24283 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo") 24284 } 24285 if len(fp) == 1 { 24286 switch fp[0] { 24287 case "status": 24288 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus}, nil 24289 case "driver_version", "driverVersion", "driver-version": 24290 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion}, nil 24291 case "cuda_version", "cudaVersion", "cuda-version": 24292 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion}, nil 24293 case "gpus": 24294 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus}, nil 24295 } 24296 } else { 24297 switch fp[0] { 24298 case "gpus": 24299 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(fp[1:]); err != nil { 24300 return nil, err 24301 } else { 24302 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus, subPath: subpath}, nil 24303 } 24304 } 24305 } 24306 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo", fp) 24307 } 24308 24309 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath, error) { 24310 fp, err := gotenobject.ParseRawFieldPath(rawField) 24311 if err != nil { 24312 return nil, err 24313 } 24314 return BuildDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(fp) 24315 } 24316 24317 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath { 24318 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(rawField) 24319 if err != nil { 24320 panic(err) 24321 } 24322 return fp 24323 } 24324 24325 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath struct { 24326 selector DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector 24327 } 24328 24329 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath)(nil) 24330 24331 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector { 24332 return fp.selector 24333 } 24334 24335 // String returns path representation in proto convention 24336 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) String() string { 24337 return fp.selector.String() 24338 } 24339 24340 // JSONString returns path representation is JSON convention 24341 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) JSONString() string { 24342 return strcase.ToLowerCamel(fp.String()) 24343 } 24344 24345 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo 24346 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (values []interface{}) { 24347 if source != nil { 24348 switch fp.selector { 24349 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24350 values = append(values, source.Status) 24351 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24352 values = append(values, source.DriverVersion) 24353 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24354 values = append(values, source.CudaVersion) 24355 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24356 for _, value := range source.GetGpus() { 24357 values = append(values, value) 24358 } 24359 default: 24360 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24361 } 24362 } 24363 return 24364 } 24365 24366 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 24367 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24368 } 24369 24370 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo 24371 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (interface{}, bool) { 24372 switch fp.selector { 24373 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24374 return source.GetStatus(), source != nil 24375 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24376 return source.GetDriverVersion(), source != nil 24377 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24378 return source.GetCudaVersion(), source != nil 24379 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24380 res := source.GetGpus() 24381 return res, res != nil 24382 default: 24383 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24384 } 24385 } 24386 24387 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 24388 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24389 } 24390 24391 // GetDefault returns a default value of the field type 24392 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) GetDefault() interface{} { 24393 switch fp.selector { 24394 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24395 return "" 24396 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24397 return "" 24398 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24399 return "" 24400 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24401 return ([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)(nil) 24402 default: 24403 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24404 } 24405 } 24406 24407 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) { 24408 if item != nil { 24409 switch fp.selector { 24410 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24411 item.Status = "" 24412 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24413 item.DriverVersion = "" 24414 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24415 item.CudaVersion = "" 24416 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24417 item.Gpus = nil 24418 default: 24419 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24420 } 24421 } 24422 } 24423 24424 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 24425 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24426 } 24427 24428 // IsLeaf - whether field path is holds simple value 24429 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) IsLeaf() bool { 24430 return fp.selector == DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus || 24431 fp.selector == DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion || 24432 fp.selector == DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion 24433 } 24434 24435 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 24436 return []gotenobject.FieldPath{fp} 24437 } 24438 24439 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue { 24440 switch fp.selector { 24441 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24442 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, value: value.(string)} 24443 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24444 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, value: value.(string)} 24445 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24446 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, value: value.(string)} 24447 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24448 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)} 24449 default: 24450 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24451 } 24452 } 24453 24454 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 24455 return fp.WithIValue(value) 24456 } 24457 24458 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues { 24459 fpaov := &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp} 24460 switch fp.selector { 24461 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24462 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, values: values.([]string)} 24463 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24464 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, values: values.([]string)} 24465 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24466 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, values: values.([]string)} 24467 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24468 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)} 24469 default: 24470 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24471 } 24472 return fpaov 24473 } 24474 24475 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 24476 return fp.WithIArrayOfValues(values) 24477 } 24478 24479 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue { 24480 switch fp.selector { 24481 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24482 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)} 24483 default: 24484 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fp.selector)) 24485 } 24486 } 24487 24488 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 24489 return fp.WithIArrayItemValue(value) 24490 } 24491 24492 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath struct { 24493 selector DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector 24494 subPath gotenobject.FieldPath 24495 } 24496 24497 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath)(nil) 24498 24499 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelector { 24500 return fps.selector 24501 } 24502 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) AsGpusSubPath() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath, bool) { 24503 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath) 24504 return res, ok 24505 } 24506 24507 // String returns path representation in proto convention 24508 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) String() string { 24509 return fps.selector.String() + "." + fps.subPath.String() 24510 } 24511 24512 // JSONString returns path representation is JSON convention 24513 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) JSONString() string { 24514 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 24515 } 24516 24517 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo 24518 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (values []interface{}) { 24519 switch fps.selector { 24520 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24521 for _, item := range source.GetGpus() { 24522 values = append(values, fps.subPath.GetRaw(item)...) 24523 } 24524 default: 24525 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fps.selector)) 24526 } 24527 return 24528 } 24529 24530 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) GetRaw(source proto.Message) []interface{} { 24531 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24532 } 24533 24534 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo 24535 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (interface{}, bool) { 24536 switch fps.selector { 24537 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24538 if len(source.GetGpus()) == 0 { 24539 return nil, false 24540 } 24541 return fps.subPath.GetSingleRaw(source.GetGpus()[0]) 24542 default: 24543 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fps.selector)) 24544 } 24545 } 24546 24547 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 24548 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24549 } 24550 24551 // GetDefault returns a default value of the field type 24552 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) GetDefault() interface{} { 24553 return fps.subPath.GetDefault() 24554 } 24555 24556 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) { 24557 if item != nil { 24558 switch fps.selector { 24559 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24560 for _, subItem := range item.Gpus { 24561 fps.subPath.ClearValueRaw(subItem) 24562 } 24563 default: 24564 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fps.selector)) 24565 } 24566 } 24567 } 24568 24569 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) ClearValueRaw(item proto.Message) { 24570 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24571 } 24572 24573 // IsLeaf - whether field path is holds simple value 24574 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) IsLeaf() bool { 24575 return fps.subPath.IsLeaf() 24576 } 24577 24578 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 24579 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath{selector: fps.selector}} 24580 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 24581 return iPaths 24582 } 24583 24584 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue { 24585 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 24586 } 24587 24588 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 24589 return fps.WithIValue(value) 24590 } 24591 24592 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues { 24593 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 24594 } 24595 24596 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 24597 return fps.WithIArrayOfValues(values) 24598 } 24599 24600 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue { 24601 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 24602 } 24603 24604 func (fps *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 24605 return fps.WithIArrayItemValue(value) 24606 } 24607 24608 // DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue allows storing values for NvidiaInfo fields according to their type 24609 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue interface { 24610 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 24611 gotenobject.FieldPathValue 24612 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 24613 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (cmp int, comparable bool) 24614 } 24615 24616 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue, error) { 24617 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(pathStr) 24618 if err != nil { 24619 return nil, err 24620 } 24621 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 24622 if err != nil { 24623 return nil, status.Errorf(codes.InvalidArgument, "error parsing NvidiaInfo field path value from %s: %v", valueStr, err) 24624 } 24625 return fpv.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue), nil 24626 } 24627 24628 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue { 24629 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue(pathStr, valueStr) 24630 if err != nil { 24631 panic(err) 24632 } 24633 return fpv 24634 } 24635 24636 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue struct { 24637 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath 24638 value interface{} 24639 } 24640 24641 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue)(nil) 24642 24643 // GetRawValue returns raw value stored under selected path for 'NvidiaInfo' as interface{} 24644 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) GetRawValue() interface{} { 24645 return fpv.value 24646 } 24647 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) AsStatusValue() (string, bool) { 24648 res, ok := fpv.value.(string) 24649 return res, ok 24650 } 24651 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) AsDriverVersionValue() (string, bool) { 24652 res, ok := fpv.value.(string) 24653 return res, ok 24654 } 24655 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) AsCudaVersionValue() (string, bool) { 24656 res, ok := fpv.value.(string) 24657 return res, ok 24658 } 24659 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) AsGpusValue() ([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo, bool) { 24660 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 24661 return res, ok 24662 } 24663 24664 // SetTo stores value for selected field for object NvidiaInfo 24665 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) { 24666 if *target == nil { 24667 *target = new(Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 24668 } 24669 switch fpv.selector { 24670 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24671 (*target).Status = fpv.value.(string) 24672 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24673 (*target).DriverVersion = fpv.value.(string) 24674 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24675 (*target).CudaVersion = fpv.value.(string) 24676 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24677 (*target).Gpus = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 24678 default: 24679 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fpv.selector)) 24680 } 24681 } 24682 24683 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 24684 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 24685 fpv.SetTo(&typedObject) 24686 } 24687 24688 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo'. 24689 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (int, bool) { 24690 switch fpv.selector { 24691 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24692 leftValue := fpv.value.(string) 24693 rightValue := source.GetStatus() 24694 if (leftValue) == (rightValue) { 24695 return 0, true 24696 } else if (leftValue) < (rightValue) { 24697 return -1, true 24698 } else { 24699 return 1, true 24700 } 24701 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24702 leftValue := fpv.value.(string) 24703 rightValue := source.GetDriverVersion() 24704 if (leftValue) == (rightValue) { 24705 return 0, true 24706 } else if (leftValue) < (rightValue) { 24707 return -1, true 24708 } else { 24709 return 1, true 24710 } 24711 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24712 leftValue := fpv.value.(string) 24713 rightValue := source.GetCudaVersion() 24714 if (leftValue) == (rightValue) { 24715 return 0, true 24716 } else if (leftValue) < (rightValue) { 24717 return -1, true 24718 } else { 24719 return 1, true 24720 } 24721 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24722 return 0, false 24723 default: 24724 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fpv.selector)) 24725 } 24726 } 24727 24728 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 24729 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24730 } 24731 24732 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue struct { 24733 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 24734 subPathValue gotenobject.FieldPathValue 24735 } 24736 24737 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue)(nil) 24738 24739 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue) AsGpusPathValue() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue, bool) { 24740 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue) 24741 return res, ok 24742 } 24743 24744 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) { 24745 if *target == nil { 24746 *target = new(Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 24747 } 24748 switch fpvs.Selector() { 24749 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24750 panic("FieldPath setter is unsupported for array subpaths") 24751 default: 24752 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fpvs.Selector())) 24753 } 24754 } 24755 24756 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue) SetToRaw(target proto.Message) { 24757 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) 24758 fpvs.SetTo(&typedObject) 24759 } 24760 24761 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue) GetRawValue() interface{} { 24762 return fpvs.subPathValue.GetRawValue() 24763 } 24764 24765 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (int, bool) { 24766 switch fpvs.Selector() { 24767 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24768 return 0, false // repeated field 24769 default: 24770 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fpvs.Selector())) 24771 } 24772 } 24773 24774 func (fpvs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 24775 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24776 } 24777 24778 // DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for NvidiaInfo according to their type 24779 // Present only for array (repeated) types. 24780 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue interface { 24781 gotenobject.FieldPathArrayItemValue 24782 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 24783 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) bool 24784 } 24785 24786 // ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 24787 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue, error) { 24788 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(pathStr) 24789 if err != nil { 24790 return nil, err 24791 } 24792 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 24793 if err != nil { 24794 return nil, status.Errorf(codes.InvalidArgument, "error parsing NvidiaInfo field path array item value from %s: %v", valueStr, err) 24795 } 24796 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue), nil 24797 } 24798 24799 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue { 24800 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue(pathStr, valueStr) 24801 if err != nil { 24802 panic(err) 24803 } 24804 return fpaiv 24805 } 24806 24807 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue struct { 24808 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath 24809 value interface{} 24810 } 24811 24812 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue)(nil) 24813 24814 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo as interface{} 24815 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 24816 return fpaiv.value 24817 } 24818 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue) AsGpusItemValue() (*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo, bool) { 24819 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 24820 return res, ok 24821 } 24822 24823 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) (interface{}, bool) { 24824 return nil, false 24825 } 24826 24827 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 24828 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo)) 24829 } 24830 24831 // Contains returns a boolean indicating if value that is being held is present in given 'NvidiaInfo' 24832 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) bool { 24833 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath.Get(source) 24834 for _, v := range slice { 24835 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 24836 if proto.Equal(asProtoMsg, v.(proto.Message)) { 24837 return true 24838 } 24839 } else if reflect.DeepEqual(v, fpaiv.value) { 24840 return true 24841 } 24842 } 24843 return false 24844 } 24845 24846 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayItemValue struct { 24847 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 24848 subPathItemValue gotenobject.FieldPathArrayItemValue 24849 } 24850 24851 // GetRawValue returns stored array item value 24852 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 24853 return fpaivs.subPathItemValue.GetRawItemValue() 24854 } 24855 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayItemValue) AsGpusPathItemValue() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue, bool) { 24856 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue) 24857 return res, ok 24858 } 24859 24860 // Contains returns a boolean indicating if value that is being held is present in given 'NvidiaInfo' 24861 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo) bool { 24862 switch fpaivs.Selector() { 24863 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24864 return false // repeated/map field 24865 default: 24866 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo: %d", fpaivs.Selector())) 24867 } 24868 } 24869 24870 // DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues allows storing slice of values for NvidiaInfo fields according to their type 24871 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues interface { 24872 gotenobject.FieldPathArrayOfValues 24873 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 24874 } 24875 24876 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues, error) { 24877 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath(pathStr) 24878 if err != nil { 24879 return nil, err 24880 } 24881 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 24882 if err != nil { 24883 return nil, status.Errorf(codes.InvalidArgument, "error parsing NvidiaInfo field path array of values from %s: %v", valuesStr, err) 24884 } 24885 return fpaov.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues), nil 24886 } 24887 24888 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues { 24889 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues(pathStr, valuesStr) 24890 if err != nil { 24891 panic(err) 24892 } 24893 return fpaov 24894 } 24895 24896 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues struct { 24897 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPath 24898 values interface{} 24899 } 24900 24901 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues)(nil) 24902 24903 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 24904 switch fpaov.selector { 24905 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorStatus: 24906 for _, v := range fpaov.values.([]string) { 24907 values = append(values, v) 24908 } 24909 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorDriverVersion: 24910 for _, v := range fpaov.values.([]string) { 24911 values = append(values, v) 24912 } 24913 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorCudaVersion: 24914 for _, v := range fpaov.values.([]string) { 24915 values = append(values, v) 24916 } 24917 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathSelectorGpus: 24918 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) { 24919 values = append(values, v) 24920 } 24921 } 24922 return 24923 } 24924 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues) AsStatusArrayOfValues() ([]string, bool) { 24925 res, ok := fpaov.values.([]string) 24926 return res, ok 24927 } 24928 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues) AsDriverVersionArrayOfValues() ([]string, bool) { 24929 res, ok := fpaov.values.([]string) 24930 return res, ok 24931 } 24932 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues) AsCudaVersionArrayOfValues() ([]string, bool) { 24933 res, ok := fpaov.values.([]string) 24934 return res, ok 24935 } 24936 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldTerminalPathArrayOfValues) AsGpusArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo, bool) { 24937 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 24938 return res, ok 24939 } 24940 24941 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayOfValues struct { 24942 DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPath 24943 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 24944 } 24945 24946 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayOfValues)(nil) 24947 24948 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 24949 return fpsaov.subPathArrayOfValues.GetRawValues() 24950 } 24951 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfo_FieldSubPathArrayOfValues) AsGpusPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues, bool) { 24952 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues) 24953 return res, ok 24954 } 24955 24956 // FieldPath provides implementation to handle 24957 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 24958 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath interface { 24959 gotenobject.FieldPath 24960 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector 24961 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) []interface{} 24962 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (interface{}, bool) 24963 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 24964 24965 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue 24966 // (or array of values) and holds passed value. Panics if injected type is incorrect. 24967 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue 24968 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues 24969 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue 24970 } 24971 24972 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector int32 24973 24974 const ( 24975 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector = 0 24976 ) 24977 24978 func (s DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector) String() string { 24979 switch s { 24980 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 24981 return "modem" 24982 default: 24983 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", s)) 24984 } 24985 } 24986 24987 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath, error) { 24988 if len(fp) == 0 { 24989 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus") 24990 } 24991 if len(fp) == 1 { 24992 switch fp[0] { 24993 case "modem": 24994 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem}, nil 24995 } 24996 } else { 24997 switch fp[0] { 24998 case "modem": 24999 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(fp[1:]); err != nil { 25000 return nil, err 25001 } else { 25002 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem, subPath: subpath}, nil 25003 } 25004 } 25005 } 25006 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus", fp) 25007 } 25008 25009 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath, error) { 25010 fp, err := gotenobject.ParseRawFieldPath(rawField) 25011 if err != nil { 25012 return nil, err 25013 } 25014 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(fp) 25015 } 25016 25017 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath { 25018 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(rawField) 25019 if err != nil { 25020 panic(err) 25021 } 25022 return fp 25023 } 25024 25025 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath struct { 25026 selector DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector 25027 } 25028 25029 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath)(nil) 25030 25031 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector { 25032 return fp.selector 25033 } 25034 25035 // String returns path representation in proto convention 25036 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) String() string { 25037 return fp.selector.String() 25038 } 25039 25040 // JSONString returns path representation is JSON convention 25041 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) JSONString() string { 25042 return strcase.ToLowerCamel(fp.String()) 25043 } 25044 25045 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus 25046 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (values []interface{}) { 25047 if source != nil { 25048 switch fp.selector { 25049 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25050 if source.Modem != nil { 25051 values = append(values, source.Modem) 25052 } 25053 default: 25054 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25055 } 25056 } 25057 return 25058 } 25059 25060 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 25061 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25062 } 25063 25064 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus 25065 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (interface{}, bool) { 25066 switch fp.selector { 25067 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25068 res := source.GetModem() 25069 return res, res != nil 25070 default: 25071 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25072 } 25073 } 25074 25075 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 25076 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25077 } 25078 25079 // GetDefault returns a default value of the field type 25080 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) GetDefault() interface{} { 25081 switch fp.selector { 25082 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25083 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)(nil) 25084 default: 25085 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25086 } 25087 } 25088 25089 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) { 25090 if item != nil { 25091 switch fp.selector { 25092 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25093 item.Modem = nil 25094 default: 25095 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25096 } 25097 } 25098 } 25099 25100 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) ClearValueRaw(item proto.Message) { 25101 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25102 } 25103 25104 // IsLeaf - whether field path is holds simple value 25105 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) IsLeaf() bool { 25106 return false 25107 } 25108 25109 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 25110 return []gotenobject.FieldPath{fp} 25111 } 25112 25113 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue { 25114 switch fp.selector { 25115 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25116 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)} 25117 default: 25118 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25119 } 25120 } 25121 25122 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 25123 return fp.WithIValue(value) 25124 } 25125 25126 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues { 25127 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath: *fp} 25128 switch fp.selector { 25129 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25130 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)} 25131 default: 25132 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25133 } 25134 return fpaov 25135 } 25136 25137 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 25138 return fp.WithIArrayOfValues(values) 25139 } 25140 25141 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue { 25142 switch fp.selector { 25143 default: 25144 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fp.selector)) 25145 } 25146 } 25147 25148 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 25149 return fp.WithIArrayItemValue(value) 25150 } 25151 25152 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath struct { 25153 selector DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector 25154 subPath gotenobject.FieldPath 25155 } 25156 25157 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath)(nil) 25158 25159 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelector { 25160 return fps.selector 25161 } 25162 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) AsModemSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath, bool) { 25163 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath) 25164 return res, ok 25165 } 25166 25167 // String returns path representation in proto convention 25168 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) String() string { 25169 return fps.selector.String() + "." + fps.subPath.String() 25170 } 25171 25172 // JSONString returns path representation is JSON convention 25173 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) JSONString() string { 25174 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 25175 } 25176 25177 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus 25178 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (values []interface{}) { 25179 switch fps.selector { 25180 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25181 values = append(values, fps.subPath.GetRaw(source.GetModem())...) 25182 default: 25183 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fps.selector)) 25184 } 25185 return 25186 } 25187 25188 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) GetRaw(source proto.Message) []interface{} { 25189 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25190 } 25191 25192 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus 25193 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (interface{}, bool) { 25194 switch fps.selector { 25195 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25196 if source.GetModem() == nil { 25197 return nil, false 25198 } 25199 return fps.subPath.GetSingleRaw(source.GetModem()) 25200 default: 25201 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fps.selector)) 25202 } 25203 } 25204 25205 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 25206 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25207 } 25208 25209 // GetDefault returns a default value of the field type 25210 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) GetDefault() interface{} { 25211 return fps.subPath.GetDefault() 25212 } 25213 25214 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) { 25215 if item != nil { 25216 switch fps.selector { 25217 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25218 fps.subPath.ClearValueRaw(item.Modem) 25219 default: 25220 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fps.selector)) 25221 } 25222 } 25223 } 25224 25225 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) ClearValueRaw(item proto.Message) { 25226 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25227 } 25228 25229 // IsLeaf - whether field path is holds simple value 25230 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) IsLeaf() bool { 25231 return fps.subPath.IsLeaf() 25232 } 25233 25234 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 25235 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath{selector: fps.selector}} 25236 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 25237 return iPaths 25238 } 25239 25240 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue { 25241 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 25242 } 25243 25244 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 25245 return fps.WithIValue(value) 25246 } 25247 25248 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues { 25249 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 25250 } 25251 25252 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 25253 return fps.WithIArrayOfValues(values) 25254 } 25255 25256 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue { 25257 return &DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 25258 } 25259 25260 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 25261 return fps.WithIArrayItemValue(value) 25262 } 25263 25264 // DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue allows storing values for ModemStatus fields according to their type 25265 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue interface { 25266 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 25267 gotenobject.FieldPathValue 25268 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 25269 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (cmp int, comparable bool) 25270 } 25271 25272 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue, error) { 25273 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(pathStr) 25274 if err != nil { 25275 return nil, err 25276 } 25277 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 25278 if err != nil { 25279 return nil, status.Errorf(codes.InvalidArgument, "error parsing ModemStatus field path value from %s: %v", valueStr, err) 25280 } 25281 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue), nil 25282 } 25283 25284 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue { 25285 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue(pathStr, valueStr) 25286 if err != nil { 25287 panic(err) 25288 } 25289 return fpv 25290 } 25291 25292 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue struct { 25293 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath 25294 value interface{} 25295 } 25296 25297 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue)(nil) 25298 25299 // GetRawValue returns raw value stored under selected path for 'ModemStatus' as interface{} 25300 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue) GetRawValue() interface{} { 25301 return fpv.value 25302 } 25303 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue) AsModemValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem, bool) { 25304 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 25305 return res, ok 25306 } 25307 25308 // SetTo stores value for selected field for object ModemStatus 25309 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus) { 25310 if *target == nil { 25311 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 25312 } 25313 switch fpv.selector { 25314 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25315 (*target).Modem = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 25316 default: 25317 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fpv.selector)) 25318 } 25319 } 25320 25321 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue) SetToRaw(target proto.Message) { 25322 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 25323 fpv.SetTo(&typedObject) 25324 } 25325 25326 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus'. 25327 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (int, bool) { 25328 switch fpv.selector { 25329 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25330 return 0, false 25331 default: 25332 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fpv.selector)) 25333 } 25334 } 25335 25336 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 25337 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25338 } 25339 25340 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue struct { 25341 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 25342 subPathValue gotenobject.FieldPathValue 25343 } 25344 25345 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue)(nil) 25346 25347 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue) AsModemPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue, bool) { 25348 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue) 25349 return res, ok 25350 } 25351 25352 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus) { 25353 if *target == nil { 25354 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 25355 } 25356 switch fpvs.Selector() { 25357 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25358 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue).SetTo(&(*target).Modem) 25359 default: 25360 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fpvs.Selector())) 25361 } 25362 } 25363 25364 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue) SetToRaw(target proto.Message) { 25365 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) 25366 fpvs.SetTo(&typedObject) 25367 } 25368 25369 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue) GetRawValue() interface{} { 25370 return fpvs.subPathValue.GetRawValue() 25371 } 25372 25373 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (int, bool) { 25374 switch fpvs.Selector() { 25375 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25376 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue).CompareWith(source.GetModem()) 25377 default: 25378 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fpvs.Selector())) 25379 } 25380 } 25381 25382 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 25383 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25384 } 25385 25386 // DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue allows storing single item in Path-specific values for ModemStatus according to their type 25387 // Present only for array (repeated) types. 25388 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue interface { 25389 gotenobject.FieldPathArrayItemValue 25390 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 25391 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus) bool 25392 } 25393 25394 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 25395 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue, error) { 25396 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(pathStr) 25397 if err != nil { 25398 return nil, err 25399 } 25400 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 25401 if err != nil { 25402 return nil, status.Errorf(codes.InvalidArgument, "error parsing ModemStatus field path array item value from %s: %v", valueStr, err) 25403 } 25404 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue), nil 25405 } 25406 25407 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue { 25408 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue(pathStr, valueStr) 25409 if err != nil { 25410 panic(err) 25411 } 25412 return fpaiv 25413 } 25414 25415 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayItemValue struct { 25416 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath 25417 value interface{} 25418 } 25419 25420 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayItemValue)(nil) 25421 25422 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus as interface{} 25423 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 25424 return fpaiv.value 25425 } 25426 25427 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) (interface{}, bool) { 25428 return nil, false 25429 } 25430 25431 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 25432 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus)) 25433 } 25434 25435 // Contains returns a boolean indicating if value that is being held is present in given 'ModemStatus' 25436 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) bool { 25437 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath.Get(source) 25438 for _, v := range slice { 25439 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 25440 if proto.Equal(asProtoMsg, v.(proto.Message)) { 25441 return true 25442 } 25443 } else if reflect.DeepEqual(v, fpaiv.value) { 25444 return true 25445 } 25446 } 25447 return false 25448 } 25449 25450 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayItemValue struct { 25451 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 25452 subPathItemValue gotenobject.FieldPathArrayItemValue 25453 } 25454 25455 // GetRawValue returns stored array item value 25456 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 25457 return fpaivs.subPathItemValue.GetRawItemValue() 25458 } 25459 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayItemValue) AsModemPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue, bool) { 25460 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue) 25461 return res, ok 25462 } 25463 25464 // Contains returns a boolean indicating if value that is being held is present in given 'ModemStatus' 25465 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus) bool { 25466 switch fpaivs.Selector() { 25467 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25468 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue).ContainsValue(source.GetModem()) 25469 default: 25470 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus: %d", fpaivs.Selector())) 25471 } 25472 } 25473 25474 // DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues allows storing slice of values for ModemStatus fields according to their type 25475 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues interface { 25476 gotenobject.FieldPathArrayOfValues 25477 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 25478 } 25479 25480 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues, error) { 25481 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath(pathStr) 25482 if err != nil { 25483 return nil, err 25484 } 25485 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 25486 if err != nil { 25487 return nil, status.Errorf(codes.InvalidArgument, "error parsing ModemStatus field path array of values from %s: %v", valuesStr, err) 25488 } 25489 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues), nil 25490 } 25491 25492 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues { 25493 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues(pathStr, valuesStr) 25494 if err != nil { 25495 panic(err) 25496 } 25497 return fpaov 25498 } 25499 25500 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayOfValues struct { 25501 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPath 25502 values interface{} 25503 } 25504 25505 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayOfValues)(nil) 25506 25507 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 25508 switch fpaov.selector { 25509 case DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathSelectorModem: 25510 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 25511 values = append(values, v) 25512 } 25513 } 25514 return 25515 } 25516 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldTerminalPathArrayOfValues) AsModemArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem, bool) { 25517 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 25518 return res, ok 25519 } 25520 25521 type DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayOfValues struct { 25522 DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPath 25523 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 25524 } 25525 25526 var _ DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayOfValues)(nil) 25527 25528 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 25529 return fpsaov.subPathArrayOfValues.GetRawValues() 25530 } 25531 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatus_FieldSubPathArrayOfValues) AsModemPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues, bool) { 25532 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues) 25533 return res, ok 25534 } 25535 25536 // FieldPath provides implementation to handle 25537 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 25538 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath interface { 25539 gotenobject.FieldPath 25540 Selector() DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector 25541 Get(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) []interface{} 25542 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) (interface{}, bool) 25543 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 25544 25545 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue 25546 // (or array of values) and holds passed value. Panics if injected type is incorrect. 25547 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue 25548 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues 25549 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue 25550 } 25551 25552 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector int32 25553 25554 const ( 25555 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector = 0 25556 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector = 1 25557 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector = 2 25558 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector = 3 25559 ) 25560 25561 func (s DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector) String() string { 25562 switch s { 25563 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25564 return "chassis" 25565 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25566 return "uuid" 25567 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25568 return "sku_number" 25569 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25570 return "family" 25571 default: 25572 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", s)) 25573 } 25574 } 25575 25576 func BuildDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath, error) { 25577 if len(fp) == 0 { 25578 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_System_Configuration") 25579 } 25580 if len(fp) == 1 { 25581 switch fp[0] { 25582 case "chassis": 25583 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis}, nil 25584 case "uuid": 25585 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid}, nil 25586 case "sku_number", "skuNumber", "sku-number": 25587 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber}, nil 25588 case "family": 25589 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily}, nil 25590 } 25591 } 25592 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_System_Configuration", fp) 25593 } 25594 25595 func ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath, error) { 25596 fp, err := gotenobject.ParseRawFieldPath(rawField) 25597 if err != nil { 25598 return nil, err 25599 } 25600 return BuildDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(fp) 25601 } 25602 25603 func MustParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath { 25604 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(rawField) 25605 if err != nil { 25606 panic(err) 25607 } 25608 return fp 25609 } 25610 25611 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath struct { 25612 selector DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector 25613 } 25614 25615 var _ DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath)(nil) 25616 25617 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelector { 25618 return fp.selector 25619 } 25620 25621 // String returns path representation in proto convention 25622 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) String() string { 25623 return fp.selector.String() 25624 } 25625 25626 // JSONString returns path representation is JSON convention 25627 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) JSONString() string { 25628 return strcase.ToLowerCamel(fp.String()) 25629 } 25630 25631 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_System_Configuration 25632 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) (values []interface{}) { 25633 if source != nil { 25634 switch fp.selector { 25635 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25636 values = append(values, source.Chassis) 25637 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25638 values = append(values, source.Uuid) 25639 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25640 values = append(values, source.SkuNumber) 25641 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25642 values = append(values, source.Family) 25643 default: 25644 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25645 } 25646 } 25647 return 25648 } 25649 25650 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 25651 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 25652 } 25653 25654 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_System_Configuration 25655 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) (interface{}, bool) { 25656 switch fp.selector { 25657 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25658 return source.GetChassis(), source != nil 25659 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25660 return source.GetUuid(), source != nil 25661 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25662 return source.GetSkuNumber(), source != nil 25663 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25664 return source.GetFamily(), source != nil 25665 default: 25666 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25667 } 25668 } 25669 25670 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 25671 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 25672 } 25673 25674 // GetDefault returns a default value of the field type 25675 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) GetDefault() interface{} { 25676 switch fp.selector { 25677 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25678 return "" 25679 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25680 return "" 25681 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25682 return "" 25683 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25684 return "" 25685 default: 25686 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25687 } 25688 } 25689 25690 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) { 25691 if item != nil { 25692 switch fp.selector { 25693 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25694 item.Chassis = "" 25695 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25696 item.Uuid = "" 25697 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25698 item.SkuNumber = "" 25699 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25700 item.Family = "" 25701 default: 25702 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25703 } 25704 } 25705 } 25706 25707 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) ClearValueRaw(item proto.Message) { 25708 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 25709 } 25710 25711 // IsLeaf - whether field path is holds simple value 25712 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) IsLeaf() bool { 25713 return fp.selector == DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis || 25714 fp.selector == DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid || 25715 fp.selector == DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber || 25716 fp.selector == DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily 25717 } 25718 25719 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 25720 return []gotenobject.FieldPath{fp} 25721 } 25722 25723 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue { 25724 switch fp.selector { 25725 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25726 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, value: value.(string)} 25727 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25728 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, value: value.(string)} 25729 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25730 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, value: value.(string)} 25731 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25732 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, value: value.(string)} 25733 default: 25734 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25735 } 25736 } 25737 25738 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 25739 return fp.WithIValue(value) 25740 } 25741 25742 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues { 25743 fpaov := &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp} 25744 switch fp.selector { 25745 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25746 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, values: values.([]string)} 25747 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25748 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, values: values.([]string)} 25749 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25750 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, values: values.([]string)} 25751 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25752 return &DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath: *fp, values: values.([]string)} 25753 default: 25754 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25755 } 25756 return fpaov 25757 } 25758 25759 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 25760 return fp.WithIArrayOfValues(values) 25761 } 25762 25763 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue { 25764 switch fp.selector { 25765 default: 25766 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fp.selector)) 25767 } 25768 } 25769 25770 func (fp *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 25771 return fp.WithIArrayItemValue(value) 25772 } 25773 25774 // DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue allows storing values for Configuration fields according to their type 25775 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue interface { 25776 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath 25777 gotenobject.FieldPathValue 25778 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 25779 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) (cmp int, comparable bool) 25780 } 25781 25782 func ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue, error) { 25783 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(pathStr) 25784 if err != nil { 25785 return nil, err 25786 } 25787 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 25788 if err != nil { 25789 return nil, status.Errorf(codes.InvalidArgument, "error parsing Configuration field path value from %s: %v", valueStr, err) 25790 } 25791 return fpv.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue), nil 25792 } 25793 25794 func MustParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue { 25795 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue(pathStr, valueStr) 25796 if err != nil { 25797 panic(err) 25798 } 25799 return fpv 25800 } 25801 25802 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue struct { 25803 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath 25804 value interface{} 25805 } 25806 25807 var _ DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue)(nil) 25808 25809 // GetRawValue returns raw value stored under selected path for 'Configuration' as interface{} 25810 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) GetRawValue() interface{} { 25811 return fpv.value 25812 } 25813 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) AsChassisValue() (string, bool) { 25814 res, ok := fpv.value.(string) 25815 return res, ok 25816 } 25817 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) AsUuidValue() (string, bool) { 25818 res, ok := fpv.value.(string) 25819 return res, ok 25820 } 25821 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) AsSkuNumberValue() (string, bool) { 25822 res, ok := fpv.value.(string) 25823 return res, ok 25824 } 25825 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) AsFamilyValue() (string, bool) { 25826 res, ok := fpv.value.(string) 25827 return res, ok 25828 } 25829 25830 // SetTo stores value for selected field for object Configuration 25831 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_System_Configuration) { 25832 if *target == nil { 25833 *target = new(Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 25834 } 25835 switch fpv.selector { 25836 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25837 (*target).Chassis = fpv.value.(string) 25838 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25839 (*target).Uuid = fpv.value.(string) 25840 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25841 (*target).SkuNumber = fpv.value.(string) 25842 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25843 (*target).Family = fpv.value.(string) 25844 default: 25845 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fpv.selector)) 25846 } 25847 } 25848 25849 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) SetToRaw(target proto.Message) { 25850 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) 25851 fpv.SetTo(&typedObject) 25852 } 25853 25854 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_System_Configuration'. 25855 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) (int, bool) { 25856 switch fpv.selector { 25857 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 25858 leftValue := fpv.value.(string) 25859 rightValue := source.GetChassis() 25860 if (leftValue) == (rightValue) { 25861 return 0, true 25862 } else if (leftValue) < (rightValue) { 25863 return -1, true 25864 } else { 25865 return 1, true 25866 } 25867 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 25868 leftValue := fpv.value.(string) 25869 rightValue := source.GetUuid() 25870 if (leftValue) == (rightValue) { 25871 return 0, true 25872 } else if (leftValue) < (rightValue) { 25873 return -1, true 25874 } else { 25875 return 1, true 25876 } 25877 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 25878 leftValue := fpv.value.(string) 25879 rightValue := source.GetSkuNumber() 25880 if (leftValue) == (rightValue) { 25881 return 0, true 25882 } else if (leftValue) < (rightValue) { 25883 return -1, true 25884 } else { 25885 return 1, true 25886 } 25887 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 25888 leftValue := fpv.value.(string) 25889 rightValue := source.GetFamily() 25890 if (leftValue) == (rightValue) { 25891 return 0, true 25892 } else if (leftValue) < (rightValue) { 25893 return -1, true 25894 } else { 25895 return 1, true 25896 } 25897 default: 25898 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_System_Configuration: %d", fpv.selector)) 25899 } 25900 } 25901 25902 func (fpv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 25903 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 25904 } 25905 25906 // DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue allows storing single item in Path-specific values for Configuration according to their type 25907 // Present only for array (repeated) types. 25908 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue interface { 25909 gotenobject.FieldPathArrayItemValue 25910 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath 25911 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration) bool 25912 } 25913 25914 // ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 25915 func ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue, error) { 25916 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(pathStr) 25917 if err != nil { 25918 return nil, err 25919 } 25920 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 25921 if err != nil { 25922 return nil, status.Errorf(codes.InvalidArgument, "error parsing Configuration field path array item value from %s: %v", valueStr, err) 25923 } 25924 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue), nil 25925 } 25926 25927 func MustParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue { 25928 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue(pathStr, valueStr) 25929 if err != nil { 25930 panic(err) 25931 } 25932 return fpaiv 25933 } 25934 25935 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayItemValue struct { 25936 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath 25937 value interface{} 25938 } 25939 25940 var _ DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayItemValue)(nil) 25941 25942 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_System_Configuration as interface{} 25943 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 25944 return fpaiv.value 25945 } 25946 25947 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) (interface{}, bool) { 25948 return nil, false 25949 } 25950 25951 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 25952 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_System_Configuration)) 25953 } 25954 25955 // Contains returns a boolean indicating if value that is being held is present in given 'Configuration' 25956 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_System_Configuration) bool { 25957 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath.Get(source) 25958 for _, v := range slice { 25959 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 25960 if proto.Equal(asProtoMsg, v.(proto.Message)) { 25961 return true 25962 } 25963 } else if reflect.DeepEqual(v, fpaiv.value) { 25964 return true 25965 } 25966 } 25967 return false 25968 } 25969 25970 // DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues allows storing slice of values for Configuration fields according to their type 25971 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues interface { 25972 gotenobject.FieldPathArrayOfValues 25973 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath 25974 } 25975 25976 func ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues, error) { 25977 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPath(pathStr) 25978 if err != nil { 25979 return nil, err 25980 } 25981 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 25982 if err != nil { 25983 return nil, status.Errorf(codes.InvalidArgument, "error parsing Configuration field path array of values from %s: %v", valuesStr, err) 25984 } 25985 return fpaov.(DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues), nil 25986 } 25987 25988 func MustParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues { 25989 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues(pathStr, valuesStr) 25990 if err != nil { 25991 panic(err) 25992 } 25993 return fpaov 25994 } 25995 25996 type DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues struct { 25997 DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPath 25998 values interface{} 25999 } 26000 26001 var _ DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues)(nil) 26002 26003 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 26004 switch fpaov.selector { 26005 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorChassis: 26006 for _, v := range fpaov.values.([]string) { 26007 values = append(values, v) 26008 } 26009 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorUuid: 26010 for _, v := range fpaov.values.([]string) { 26011 values = append(values, v) 26012 } 26013 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorSkuNumber: 26014 for _, v := range fpaov.values.([]string) { 26015 values = append(values, v) 26016 } 26017 case DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldPathSelectorFamily: 26018 for _, v := range fpaov.values.([]string) { 26019 values = append(values, v) 26020 } 26021 } 26022 return 26023 } 26024 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues) AsChassisArrayOfValues() ([]string, bool) { 26025 res, ok := fpaov.values.([]string) 26026 return res, ok 26027 } 26028 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues) AsUuidArrayOfValues() ([]string, bool) { 26029 res, ok := fpaov.values.([]string) 26030 return res, ok 26031 } 26032 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues) AsSkuNumberArrayOfValues() ([]string, bool) { 26033 res, ok := fpaov.values.([]string) 26034 return res, ok 26035 } 26036 func (fpaov *DeviceStatusDeviceInfoHardwareInformationSystemConfiguration_FieldTerminalPathArrayOfValues) AsFamilyArrayOfValues() ([]string, bool) { 26037 res, ok := fpaov.values.([]string) 26038 return res, ok 26039 } 26040 26041 // FieldPath provides implementation to handle 26042 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 26043 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath interface { 26044 gotenobject.FieldPath 26045 Selector() DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector 26046 Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) []interface{} 26047 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (interface{}, bool) 26048 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 26049 26050 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue 26051 // (or array of values) and holds passed value. Panics if injected type is incorrect. 26052 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue 26053 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues 26054 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue 26055 } 26056 26057 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector int32 26058 26059 const ( 26060 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 0 26061 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 1 26062 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 2 26063 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 3 26064 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 4 26065 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 5 26066 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 6 26067 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 7 26068 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 8 26069 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 9 26070 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 10 26071 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 11 26072 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 12 26073 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector = 13 26074 ) 26075 26076 func (s DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector) String() string { 26077 switch s { 26078 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26079 return "vendor" 26080 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26081 return "model" 26082 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26083 return "capabilities" 26084 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26085 return "num_threads" 26086 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26087 return "num_cores" 26088 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26089 return "num_enabled_cores" 26090 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26091 return "name" 26092 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26093 return "serial" 26094 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26095 return "frequency_mhz" 26096 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26097 return "max_frequency_mhz" 26098 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26099 return "cache_info" 26100 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26101 return "driver" 26102 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26103 return "latency" 26104 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26105 return "clock" 26106 default: 26107 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", s)) 26108 } 26109 } 26110 26111 func BuildDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath, error) { 26112 if len(fp) == 0 { 26113 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_CPU_Processor") 26114 } 26115 if len(fp) == 1 { 26116 switch fp[0] { 26117 case "vendor": 26118 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor}, nil 26119 case "model": 26120 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel}, nil 26121 case "capabilities": 26122 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities}, nil 26123 case "num_threads", "numThreads", "num-threads": 26124 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads}, nil 26125 case "num_cores", "numCores", "num-cores": 26126 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores}, nil 26127 case "num_enabled_cores", "numEnabledCores", "num-enabled-cores": 26128 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores}, nil 26129 case "name": 26130 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName}, nil 26131 case "serial": 26132 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial}, nil 26133 case "frequency_mhz", "frequencyMhz", "frequency-mhz": 26134 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz}, nil 26135 case "max_frequency_mhz", "maxFrequencyMhz", "max-frequency-mhz": 26136 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz}, nil 26137 case "cache_info", "cacheInfo", "cache-info": 26138 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo}, nil 26139 case "driver": 26140 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver}, nil 26141 case "latency": 26142 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency}, nil 26143 case "clock": 26144 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock}, nil 26145 } 26146 } else { 26147 switch fp[0] { 26148 case "capabilities": 26149 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationCapability_FieldPath(fp[1:]); err != nil { 26150 return nil, err 26151 } else { 26152 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities, subPath: subpath}, nil 26153 } 26154 case "cache_info", "cacheInfo", "cache-info": 26155 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(fp[1:]); err != nil { 26156 return nil, err 26157 } else { 26158 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo, subPath: subpath}, nil 26159 } 26160 } 26161 } 26162 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_CPU_Processor", fp) 26163 } 26164 26165 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath, error) { 26166 fp, err := gotenobject.ParseRawFieldPath(rawField) 26167 if err != nil { 26168 return nil, err 26169 } 26170 return BuildDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(fp) 26171 } 26172 26173 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath { 26174 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(rawField) 26175 if err != nil { 26176 panic(err) 26177 } 26178 return fp 26179 } 26180 26181 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath struct { 26182 selector DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector 26183 } 26184 26185 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath)(nil) 26186 26187 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector { 26188 return fp.selector 26189 } 26190 26191 // String returns path representation in proto convention 26192 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) String() string { 26193 return fp.selector.String() 26194 } 26195 26196 // JSONString returns path representation is JSON convention 26197 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) JSONString() string { 26198 return strcase.ToLowerCamel(fp.String()) 26199 } 26200 26201 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_CPU_Processor 26202 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (values []interface{}) { 26203 if source != nil { 26204 switch fp.selector { 26205 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26206 values = append(values, source.Vendor) 26207 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26208 values = append(values, source.Model) 26209 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26210 for _, value := range source.GetCapabilities() { 26211 values = append(values, value) 26212 } 26213 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26214 values = append(values, source.NumThreads) 26215 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26216 values = append(values, source.NumCores) 26217 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26218 values = append(values, source.NumEnabledCores) 26219 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26220 values = append(values, source.Name) 26221 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26222 values = append(values, source.Serial) 26223 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26224 values = append(values, source.FrequencyMhz) 26225 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26226 values = append(values, source.MaxFrequencyMhz) 26227 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26228 for _, value := range source.GetCacheInfo() { 26229 values = append(values, value) 26230 } 26231 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26232 values = append(values, source.Driver) 26233 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26234 values = append(values, source.Latency) 26235 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26236 values = append(values, source.Clock) 26237 default: 26238 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26239 } 26240 } 26241 return 26242 } 26243 26244 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 26245 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26246 } 26247 26248 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_CPU_Processor 26249 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (interface{}, bool) { 26250 switch fp.selector { 26251 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26252 return source.GetVendor(), source != nil 26253 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26254 return source.GetModel(), source != nil 26255 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26256 res := source.GetCapabilities() 26257 return res, res != nil 26258 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26259 return source.GetNumThreads(), source != nil 26260 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26261 return source.GetNumCores(), source != nil 26262 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26263 return source.GetNumEnabledCores(), source != nil 26264 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26265 return source.GetName(), source != nil 26266 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26267 return source.GetSerial(), source != nil 26268 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26269 return source.GetFrequencyMhz(), source != nil 26270 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26271 return source.GetMaxFrequencyMhz(), source != nil 26272 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26273 res := source.GetCacheInfo() 26274 return res, res != nil 26275 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26276 return source.GetDriver(), source != nil 26277 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26278 return source.GetLatency(), source != nil 26279 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26280 return source.GetClock(), source != nil 26281 default: 26282 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26283 } 26284 } 26285 26286 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 26287 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26288 } 26289 26290 // GetDefault returns a default value of the field type 26291 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) GetDefault() interface{} { 26292 switch fp.selector { 26293 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26294 return "" 26295 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26296 return "" 26297 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26298 return ([]*Device_Status_DeviceInfo_HardwareInformation_Capability)(nil) 26299 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26300 return uint32(0) 26301 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26302 return uint32(0) 26303 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26304 return uint32(0) 26305 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26306 return "" 26307 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26308 return "" 26309 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26310 return int64(0) 26311 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26312 return int64(0) 26313 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26314 return ([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)(nil) 26315 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26316 return "" 26317 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26318 return int64(0) 26319 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26320 return int64(0) 26321 default: 26322 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26323 } 26324 } 26325 26326 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) { 26327 if item != nil { 26328 switch fp.selector { 26329 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26330 item.Vendor = "" 26331 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26332 item.Model = "" 26333 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26334 item.Capabilities = nil 26335 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26336 item.NumThreads = uint32(0) 26337 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26338 item.NumCores = uint32(0) 26339 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26340 item.NumEnabledCores = uint32(0) 26341 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26342 item.Name = "" 26343 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26344 item.Serial = "" 26345 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26346 item.FrequencyMhz = int64(0) 26347 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26348 item.MaxFrequencyMhz = int64(0) 26349 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26350 item.CacheInfo = nil 26351 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26352 item.Driver = "" 26353 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26354 item.Latency = int64(0) 26355 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26356 item.Clock = int64(0) 26357 default: 26358 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26359 } 26360 } 26361 } 26362 26363 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) ClearValueRaw(item proto.Message) { 26364 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26365 } 26366 26367 // IsLeaf - whether field path is holds simple value 26368 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) IsLeaf() bool { 26369 return fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor || 26370 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel || 26371 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads || 26372 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores || 26373 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores || 26374 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName || 26375 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial || 26376 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz || 26377 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz || 26378 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver || 26379 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency || 26380 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock 26381 } 26382 26383 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 26384 return []gotenobject.FieldPath{fp} 26385 } 26386 26387 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue { 26388 switch fp.selector { 26389 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26390 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(string)} 26391 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26392 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(string)} 26393 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26394 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_Capability)} 26395 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26396 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(uint32)} 26397 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26398 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(uint32)} 26399 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26400 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(uint32)} 26401 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26402 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(string)} 26403 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26404 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(string)} 26405 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26406 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(int64)} 26407 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26408 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(int64)} 26409 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26410 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)} 26411 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26412 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(string)} 26413 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26414 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(int64)} 26415 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26416 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(int64)} 26417 default: 26418 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26419 } 26420 } 26421 26422 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 26423 return fp.WithIValue(value) 26424 } 26425 26426 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues { 26427 fpaov := &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp} 26428 switch fp.selector { 26429 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26430 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]string)} 26431 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26432 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]string)} 26433 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26434 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_Capability)} 26435 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26436 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]uint32)} 26437 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26438 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]uint32)} 26439 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26440 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]uint32)} 26441 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26442 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]string)} 26443 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26444 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]string)} 26445 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26446 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]int64)} 26447 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26448 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]int64)} 26449 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26450 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)} 26451 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26452 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]string)} 26453 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26454 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]int64)} 26455 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26456 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, values: values.([]int64)} 26457 default: 26458 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26459 } 26460 return fpaov 26461 } 26462 26463 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 26464 return fp.WithIArrayOfValues(values) 26465 } 26466 26467 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue { 26468 switch fp.selector { 26469 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26470 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_Capability)} 26471 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26472 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)} 26473 default: 26474 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fp.selector)) 26475 } 26476 } 26477 26478 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 26479 return fp.WithIArrayItemValue(value) 26480 } 26481 26482 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath struct { 26483 selector DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector 26484 subPath gotenobject.FieldPath 26485 } 26486 26487 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath)(nil) 26488 26489 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelector { 26490 return fps.selector 26491 } 26492 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) AsCapabilitiesSubPath() (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath, bool) { 26493 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPath) 26494 return res, ok 26495 } 26496 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) AsCacheInfoSubPath() (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath, bool) { 26497 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath) 26498 return res, ok 26499 } 26500 26501 // String returns path representation in proto convention 26502 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) String() string { 26503 return fps.selector.String() + "." + fps.subPath.String() 26504 } 26505 26506 // JSONString returns path representation is JSON convention 26507 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) JSONString() string { 26508 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 26509 } 26510 26511 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_CPU_Processor 26512 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (values []interface{}) { 26513 switch fps.selector { 26514 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26515 for _, item := range source.GetCapabilities() { 26516 values = append(values, fps.subPath.GetRaw(item)...) 26517 } 26518 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26519 for _, item := range source.GetCacheInfo() { 26520 values = append(values, fps.subPath.GetRaw(item)...) 26521 } 26522 default: 26523 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fps.selector)) 26524 } 26525 return 26526 } 26527 26528 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) GetRaw(source proto.Message) []interface{} { 26529 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26530 } 26531 26532 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_CPU_Processor 26533 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (interface{}, bool) { 26534 switch fps.selector { 26535 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26536 if len(source.GetCapabilities()) == 0 { 26537 return nil, false 26538 } 26539 return fps.subPath.GetSingleRaw(source.GetCapabilities()[0]) 26540 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26541 if len(source.GetCacheInfo()) == 0 { 26542 return nil, false 26543 } 26544 return fps.subPath.GetSingleRaw(source.GetCacheInfo()[0]) 26545 default: 26546 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fps.selector)) 26547 } 26548 } 26549 26550 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 26551 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26552 } 26553 26554 // GetDefault returns a default value of the field type 26555 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) GetDefault() interface{} { 26556 return fps.subPath.GetDefault() 26557 } 26558 26559 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) { 26560 if item != nil { 26561 switch fps.selector { 26562 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26563 for _, subItem := range item.Capabilities { 26564 fps.subPath.ClearValueRaw(subItem) 26565 } 26566 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26567 for _, subItem := range item.CacheInfo { 26568 fps.subPath.ClearValueRaw(subItem) 26569 } 26570 default: 26571 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fps.selector)) 26572 } 26573 } 26574 } 26575 26576 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) ClearValueRaw(item proto.Message) { 26577 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26578 } 26579 26580 // IsLeaf - whether field path is holds simple value 26581 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) IsLeaf() bool { 26582 return fps.subPath.IsLeaf() 26583 } 26584 26585 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 26586 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath{selector: fps.selector}} 26587 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 26588 return iPaths 26589 } 26590 26591 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue { 26592 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 26593 } 26594 26595 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 26596 return fps.WithIValue(value) 26597 } 26598 26599 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues { 26600 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 26601 } 26602 26603 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 26604 return fps.WithIArrayOfValues(values) 26605 } 26606 26607 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue { 26608 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 26609 } 26610 26611 func (fps *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 26612 return fps.WithIArrayItemValue(value) 26613 } 26614 26615 // DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue allows storing values for Processor fields according to their type 26616 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue interface { 26617 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 26618 gotenobject.FieldPathValue 26619 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 26620 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (cmp int, comparable bool) 26621 } 26622 26623 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue, error) { 26624 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(pathStr) 26625 if err != nil { 26626 return nil, err 26627 } 26628 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 26629 if err != nil { 26630 return nil, status.Errorf(codes.InvalidArgument, "error parsing Processor field path value from %s: %v", valueStr, err) 26631 } 26632 return fpv.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue), nil 26633 } 26634 26635 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue { 26636 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue(pathStr, valueStr) 26637 if err != nil { 26638 panic(err) 26639 } 26640 return fpv 26641 } 26642 26643 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue struct { 26644 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath 26645 value interface{} 26646 } 26647 26648 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue)(nil) 26649 26650 // GetRawValue returns raw value stored under selected path for 'Processor' as interface{} 26651 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) GetRawValue() interface{} { 26652 return fpv.value 26653 } 26654 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsVendorValue() (string, bool) { 26655 res, ok := fpv.value.(string) 26656 return res, ok 26657 } 26658 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsModelValue() (string, bool) { 26659 res, ok := fpv.value.(string) 26660 return res, ok 26661 } 26662 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsCapabilitiesValue() ([]*Device_Status_DeviceInfo_HardwareInformation_Capability, bool) { 26663 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Capability) 26664 return res, ok 26665 } 26666 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsNumThreadsValue() (uint32, bool) { 26667 res, ok := fpv.value.(uint32) 26668 return res, ok 26669 } 26670 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsNumCoresValue() (uint32, bool) { 26671 res, ok := fpv.value.(uint32) 26672 return res, ok 26673 } 26674 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsNumEnabledCoresValue() (uint32, bool) { 26675 res, ok := fpv.value.(uint32) 26676 return res, ok 26677 } 26678 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsNameValue() (string, bool) { 26679 res, ok := fpv.value.(string) 26680 return res, ok 26681 } 26682 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsSerialValue() (string, bool) { 26683 res, ok := fpv.value.(string) 26684 return res, ok 26685 } 26686 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsFrequencyMhzValue() (int64, bool) { 26687 res, ok := fpv.value.(int64) 26688 return res, ok 26689 } 26690 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsMaxFrequencyMhzValue() (int64, bool) { 26691 res, ok := fpv.value.(int64) 26692 return res, ok 26693 } 26694 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsCacheInfoValue() ([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache, bool) { 26695 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 26696 return res, ok 26697 } 26698 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsDriverValue() (string, bool) { 26699 res, ok := fpv.value.(string) 26700 return res, ok 26701 } 26702 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsLatencyValue() (int64, bool) { 26703 res, ok := fpv.value.(int64) 26704 return res, ok 26705 } 26706 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) AsClockValue() (int64, bool) { 26707 res, ok := fpv.value.(int64) 26708 return res, ok 26709 } 26710 26711 // SetTo stores value for selected field for object Processor 26712 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) { 26713 if *target == nil { 26714 *target = new(Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 26715 } 26716 switch fpv.selector { 26717 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26718 (*target).Vendor = fpv.value.(string) 26719 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26720 (*target).Model = fpv.value.(string) 26721 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26722 (*target).Capabilities = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Capability) 26723 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26724 (*target).NumThreads = fpv.value.(uint32) 26725 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26726 (*target).NumCores = fpv.value.(uint32) 26727 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26728 (*target).NumEnabledCores = fpv.value.(uint32) 26729 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26730 (*target).Name = fpv.value.(string) 26731 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26732 (*target).Serial = fpv.value.(string) 26733 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26734 (*target).FrequencyMhz = fpv.value.(int64) 26735 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26736 (*target).MaxFrequencyMhz = fpv.value.(int64) 26737 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26738 (*target).CacheInfo = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 26739 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26740 (*target).Driver = fpv.value.(string) 26741 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26742 (*target).Latency = fpv.value.(int64) 26743 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26744 (*target).Clock = fpv.value.(int64) 26745 default: 26746 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fpv.selector)) 26747 } 26748 } 26749 26750 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) SetToRaw(target proto.Message) { 26751 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 26752 fpv.SetTo(&typedObject) 26753 } 26754 26755 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_CPU_Processor'. 26756 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (int, bool) { 26757 switch fpv.selector { 26758 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 26759 leftValue := fpv.value.(string) 26760 rightValue := source.GetVendor() 26761 if (leftValue) == (rightValue) { 26762 return 0, true 26763 } else if (leftValue) < (rightValue) { 26764 return -1, true 26765 } else { 26766 return 1, true 26767 } 26768 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 26769 leftValue := fpv.value.(string) 26770 rightValue := source.GetModel() 26771 if (leftValue) == (rightValue) { 26772 return 0, true 26773 } else if (leftValue) < (rightValue) { 26774 return -1, true 26775 } else { 26776 return 1, true 26777 } 26778 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26779 return 0, false 26780 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 26781 leftValue := fpv.value.(uint32) 26782 rightValue := source.GetNumThreads() 26783 if (leftValue) == (rightValue) { 26784 return 0, true 26785 } else if (leftValue) < (rightValue) { 26786 return -1, true 26787 } else { 26788 return 1, true 26789 } 26790 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 26791 leftValue := fpv.value.(uint32) 26792 rightValue := source.GetNumCores() 26793 if (leftValue) == (rightValue) { 26794 return 0, true 26795 } else if (leftValue) < (rightValue) { 26796 return -1, true 26797 } else { 26798 return 1, true 26799 } 26800 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 26801 leftValue := fpv.value.(uint32) 26802 rightValue := source.GetNumEnabledCores() 26803 if (leftValue) == (rightValue) { 26804 return 0, true 26805 } else if (leftValue) < (rightValue) { 26806 return -1, true 26807 } else { 26808 return 1, true 26809 } 26810 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 26811 leftValue := fpv.value.(string) 26812 rightValue := source.GetName() 26813 if (leftValue) == (rightValue) { 26814 return 0, true 26815 } else if (leftValue) < (rightValue) { 26816 return -1, true 26817 } else { 26818 return 1, true 26819 } 26820 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 26821 leftValue := fpv.value.(string) 26822 rightValue := source.GetSerial() 26823 if (leftValue) == (rightValue) { 26824 return 0, true 26825 } else if (leftValue) < (rightValue) { 26826 return -1, true 26827 } else { 26828 return 1, true 26829 } 26830 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 26831 leftValue := fpv.value.(int64) 26832 rightValue := source.GetFrequencyMhz() 26833 if (leftValue) == (rightValue) { 26834 return 0, true 26835 } else if (leftValue) < (rightValue) { 26836 return -1, true 26837 } else { 26838 return 1, true 26839 } 26840 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 26841 leftValue := fpv.value.(int64) 26842 rightValue := source.GetMaxFrequencyMhz() 26843 if (leftValue) == (rightValue) { 26844 return 0, true 26845 } else if (leftValue) < (rightValue) { 26846 return -1, true 26847 } else { 26848 return 1, true 26849 } 26850 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26851 return 0, false 26852 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 26853 leftValue := fpv.value.(string) 26854 rightValue := source.GetDriver() 26855 if (leftValue) == (rightValue) { 26856 return 0, true 26857 } else if (leftValue) < (rightValue) { 26858 return -1, true 26859 } else { 26860 return 1, true 26861 } 26862 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 26863 leftValue := fpv.value.(int64) 26864 rightValue := source.GetLatency() 26865 if (leftValue) == (rightValue) { 26866 return 0, true 26867 } else if (leftValue) < (rightValue) { 26868 return -1, true 26869 } else { 26870 return 1, true 26871 } 26872 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 26873 leftValue := fpv.value.(int64) 26874 rightValue := source.GetClock() 26875 if (leftValue) == (rightValue) { 26876 return 0, true 26877 } else if (leftValue) < (rightValue) { 26878 return -1, true 26879 } else { 26880 return 1, true 26881 } 26882 default: 26883 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fpv.selector)) 26884 } 26885 } 26886 26887 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 26888 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26889 } 26890 26891 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue struct { 26892 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 26893 subPathValue gotenobject.FieldPathValue 26894 } 26895 26896 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue)(nil) 26897 26898 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) AsCapabilitiesPathValue() (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue, bool) { 26899 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathValue) 26900 return res, ok 26901 } 26902 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) AsCacheInfoPathValue() (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue, bool) { 26903 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue) 26904 return res, ok 26905 } 26906 26907 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) { 26908 if *target == nil { 26909 *target = new(Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 26910 } 26911 switch fpvs.Selector() { 26912 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26913 panic("FieldPath setter is unsupported for array subpaths") 26914 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26915 panic("FieldPath setter is unsupported for array subpaths") 26916 default: 26917 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fpvs.Selector())) 26918 } 26919 } 26920 26921 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) SetToRaw(target proto.Message) { 26922 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) 26923 fpvs.SetTo(&typedObject) 26924 } 26925 26926 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) GetRawValue() interface{} { 26927 return fpvs.subPathValue.GetRawValue() 26928 } 26929 26930 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (int, bool) { 26931 switch fpvs.Selector() { 26932 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 26933 return 0, false // repeated field 26934 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 26935 return 0, false // repeated field 26936 default: 26937 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fpvs.Selector())) 26938 } 26939 } 26940 26941 func (fpvs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 26942 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 26943 } 26944 26945 // DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue allows storing single item in Path-specific values for Processor according to their type 26946 // Present only for array (repeated) types. 26947 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue interface { 26948 gotenobject.FieldPathArrayItemValue 26949 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 26950 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) bool 26951 } 26952 26953 // ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 26954 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue, error) { 26955 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(pathStr) 26956 if err != nil { 26957 return nil, err 26958 } 26959 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 26960 if err != nil { 26961 return nil, status.Errorf(codes.InvalidArgument, "error parsing Processor field path array item value from %s: %v", valueStr, err) 26962 } 26963 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue), nil 26964 } 26965 26966 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue { 26967 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue(pathStr, valueStr) 26968 if err != nil { 26969 panic(err) 26970 } 26971 return fpaiv 26972 } 26973 26974 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue struct { 26975 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath 26976 value interface{} 26977 } 26978 26979 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue)(nil) 26980 26981 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_CPU_Processor as interface{} 26982 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 26983 return fpaiv.value 26984 } 26985 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue) AsCapabilitiesItemValue() (*Device_Status_DeviceInfo_HardwareInformation_Capability, bool) { 26986 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_Capability) 26987 return res, ok 26988 } 26989 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue) AsCacheInfoItemValue() (*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache, bool) { 26990 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 26991 return res, ok 26992 } 26993 26994 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) (interface{}, bool) { 26995 return nil, false 26996 } 26997 26998 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 26999 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor)) 27000 } 27001 27002 // Contains returns a boolean indicating if value that is being held is present in given 'Processor' 27003 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) bool { 27004 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath.Get(source) 27005 for _, v := range slice { 27006 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 27007 if proto.Equal(asProtoMsg, v.(proto.Message)) { 27008 return true 27009 } 27010 } else if reflect.DeepEqual(v, fpaiv.value) { 27011 return true 27012 } 27013 } 27014 return false 27015 } 27016 27017 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayItemValue struct { 27018 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 27019 subPathItemValue gotenobject.FieldPathArrayItemValue 27020 } 27021 27022 // GetRawValue returns stored array item value 27023 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 27024 return fpaivs.subPathItemValue.GetRawItemValue() 27025 } 27026 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayItemValue) AsCapabilitiesPathItemValue() (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue, bool) { 27027 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayItemValue) 27028 return res, ok 27029 } 27030 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayItemValue) AsCacheInfoPathItemValue() (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue, bool) { 27031 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue) 27032 return res, ok 27033 } 27034 27035 // Contains returns a boolean indicating if value that is being held is present in given 'Processor' 27036 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor) bool { 27037 switch fpaivs.Selector() { 27038 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 27039 return false // repeated/map field 27040 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 27041 return false // repeated/map field 27042 default: 27043 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor: %d", fpaivs.Selector())) 27044 } 27045 } 27046 27047 // DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues allows storing slice of values for Processor fields according to their type 27048 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues interface { 27049 gotenobject.FieldPathArrayOfValues 27050 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 27051 } 27052 27053 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues, error) { 27054 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath(pathStr) 27055 if err != nil { 27056 return nil, err 27057 } 27058 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 27059 if err != nil { 27060 return nil, status.Errorf(codes.InvalidArgument, "error parsing Processor field path array of values from %s: %v", valuesStr, err) 27061 } 27062 return fpaov.(DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues), nil 27063 } 27064 27065 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues { 27066 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues(pathStr, valuesStr) 27067 if err != nil { 27068 panic(err) 27069 } 27070 return fpaov 27071 } 27072 27073 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues struct { 27074 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPath 27075 values interface{} 27076 } 27077 27078 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues)(nil) 27079 27080 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 27081 switch fpaov.selector { 27082 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorVendor: 27083 for _, v := range fpaov.values.([]string) { 27084 values = append(values, v) 27085 } 27086 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorModel: 27087 for _, v := range fpaov.values.([]string) { 27088 values = append(values, v) 27089 } 27090 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCapabilities: 27091 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Capability) { 27092 values = append(values, v) 27093 } 27094 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumThreads: 27095 for _, v := range fpaov.values.([]uint32) { 27096 values = append(values, v) 27097 } 27098 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumCores: 27099 for _, v := range fpaov.values.([]uint32) { 27100 values = append(values, v) 27101 } 27102 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorNumEnabledCores: 27103 for _, v := range fpaov.values.([]uint32) { 27104 values = append(values, v) 27105 } 27106 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorName: 27107 for _, v := range fpaov.values.([]string) { 27108 values = append(values, v) 27109 } 27110 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorSerial: 27111 for _, v := range fpaov.values.([]string) { 27112 values = append(values, v) 27113 } 27114 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorFrequencyMhz: 27115 for _, v := range fpaov.values.([]int64) { 27116 values = append(values, v) 27117 } 27118 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorMaxFrequencyMhz: 27119 for _, v := range fpaov.values.([]int64) { 27120 values = append(values, v) 27121 } 27122 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorCacheInfo: 27123 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) { 27124 values = append(values, v) 27125 } 27126 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorDriver: 27127 for _, v := range fpaov.values.([]string) { 27128 values = append(values, v) 27129 } 27130 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorLatency: 27131 for _, v := range fpaov.values.([]int64) { 27132 values = append(values, v) 27133 } 27134 case DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathSelectorClock: 27135 for _, v := range fpaov.values.([]int64) { 27136 values = append(values, v) 27137 } 27138 } 27139 return 27140 } 27141 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsVendorArrayOfValues() ([]string, bool) { 27142 res, ok := fpaov.values.([]string) 27143 return res, ok 27144 } 27145 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsModelArrayOfValues() ([]string, bool) { 27146 res, ok := fpaov.values.([]string) 27147 return res, ok 27148 } 27149 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsCapabilitiesArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_Capability, bool) { 27150 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Capability) 27151 return res, ok 27152 } 27153 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsNumThreadsArrayOfValues() ([]uint32, bool) { 27154 res, ok := fpaov.values.([]uint32) 27155 return res, ok 27156 } 27157 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsNumCoresArrayOfValues() ([]uint32, bool) { 27158 res, ok := fpaov.values.([]uint32) 27159 return res, ok 27160 } 27161 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsNumEnabledCoresArrayOfValues() ([]uint32, bool) { 27162 res, ok := fpaov.values.([]uint32) 27163 return res, ok 27164 } 27165 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 27166 res, ok := fpaov.values.([]string) 27167 return res, ok 27168 } 27169 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsSerialArrayOfValues() ([]string, bool) { 27170 res, ok := fpaov.values.([]string) 27171 return res, ok 27172 } 27173 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsFrequencyMhzArrayOfValues() ([]int64, bool) { 27174 res, ok := fpaov.values.([]int64) 27175 return res, ok 27176 } 27177 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsMaxFrequencyMhzArrayOfValues() ([]int64, bool) { 27178 res, ok := fpaov.values.([]int64) 27179 return res, ok 27180 } 27181 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsCacheInfoArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache, bool) { 27182 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 27183 return res, ok 27184 } 27185 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsDriverArrayOfValues() ([]string, bool) { 27186 res, ok := fpaov.values.([]string) 27187 return res, ok 27188 } 27189 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsLatencyArrayOfValues() ([]int64, bool) { 27190 res, ok := fpaov.values.([]int64) 27191 return res, ok 27192 } 27193 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldTerminalPathArrayOfValues) AsClockArrayOfValues() ([]int64, bool) { 27194 res, ok := fpaov.values.([]int64) 27195 return res, ok 27196 } 27197 27198 type DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayOfValues struct { 27199 DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPath 27200 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 27201 } 27202 27203 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayOfValues)(nil) 27204 27205 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 27206 return fpsaov.subPathArrayOfValues.GetRawValues() 27207 } 27208 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayOfValues) AsCapabilitiesPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues, bool) { 27209 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationCapability_FieldPathArrayOfValues) 27210 return res, ok 27211 } 27212 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessor_FieldSubPathArrayOfValues) AsCacheInfoPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues, bool) { 27213 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues) 27214 return res, ok 27215 } 27216 27217 // FieldPath provides implementation to handle 27218 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 27219 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath interface { 27220 gotenobject.FieldPath 27221 Selector() DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector 27222 Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) []interface{} 27223 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) (interface{}, bool) 27224 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 27225 27226 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue 27227 // (or array of values) and holds passed value. Panics if injected type is incorrect. 27228 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue 27229 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues 27230 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue 27231 } 27232 27233 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector int32 27234 27235 const ( 27236 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector = 0 27237 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector = 1 27238 ) 27239 27240 func (s DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector) String() string { 27241 switch s { 27242 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27243 return "type" 27244 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27245 return "size_bytes" 27246 default: 27247 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", s)) 27248 } 27249 } 27250 27251 func BuildDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath, error) { 27252 if len(fp) == 0 { 27253 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache") 27254 } 27255 if len(fp) == 1 { 27256 switch fp[0] { 27257 case "type": 27258 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType}, nil 27259 case "size_bytes", "sizeBytes", "size-bytes": 27260 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes}, nil 27261 } 27262 } 27263 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache", fp) 27264 } 27265 27266 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath, error) { 27267 fp, err := gotenobject.ParseRawFieldPath(rawField) 27268 if err != nil { 27269 return nil, err 27270 } 27271 return BuildDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(fp) 27272 } 27273 27274 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath { 27275 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(rawField) 27276 if err != nil { 27277 panic(err) 27278 } 27279 return fp 27280 } 27281 27282 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath struct { 27283 selector DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector 27284 } 27285 27286 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath)(nil) 27287 27288 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelector { 27289 return fp.selector 27290 } 27291 27292 // String returns path representation in proto convention 27293 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) String() string { 27294 return fp.selector.String() 27295 } 27296 27297 // JSONString returns path representation is JSON convention 27298 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) JSONString() string { 27299 return strcase.ToLowerCamel(fp.String()) 27300 } 27301 27302 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache 27303 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) (values []interface{}) { 27304 if source != nil { 27305 switch fp.selector { 27306 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27307 values = append(values, source.Type) 27308 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27309 values = append(values, source.SizeBytes) 27310 default: 27311 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27312 } 27313 } 27314 return 27315 } 27316 27317 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 27318 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 27319 } 27320 27321 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache 27322 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) (interface{}, bool) { 27323 switch fp.selector { 27324 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27325 return source.GetType(), source != nil 27326 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27327 return source.GetSizeBytes(), source != nil 27328 default: 27329 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27330 } 27331 } 27332 27333 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 27334 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 27335 } 27336 27337 // GetDefault returns a default value of the field type 27338 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) GetDefault() interface{} { 27339 switch fp.selector { 27340 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27341 return "" 27342 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27343 return int64(0) 27344 default: 27345 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27346 } 27347 } 27348 27349 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) { 27350 if item != nil { 27351 switch fp.selector { 27352 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27353 item.Type = "" 27354 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27355 item.SizeBytes = int64(0) 27356 default: 27357 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27358 } 27359 } 27360 } 27361 27362 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) ClearValueRaw(item proto.Message) { 27363 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 27364 } 27365 27366 // IsLeaf - whether field path is holds simple value 27367 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) IsLeaf() bool { 27368 return fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType || 27369 fp.selector == DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes 27370 } 27371 27372 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 27373 return []gotenobject.FieldPath{fp} 27374 } 27375 27376 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue { 27377 switch fp.selector { 27378 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27379 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: *fp, value: value.(string)} 27380 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27381 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: *fp, value: value.(int64)} 27382 default: 27383 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27384 } 27385 } 27386 27387 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 27388 return fp.WithIValue(value) 27389 } 27390 27391 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues { 27392 fpaov := &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: *fp} 27393 switch fp.selector { 27394 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27395 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: *fp, values: values.([]string)} 27396 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27397 return &DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath: *fp, values: values.([]int64)} 27398 default: 27399 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27400 } 27401 return fpaov 27402 } 27403 27404 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 27405 return fp.WithIArrayOfValues(values) 27406 } 27407 27408 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue { 27409 switch fp.selector { 27410 default: 27411 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fp.selector)) 27412 } 27413 } 27414 27415 func (fp *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 27416 return fp.WithIArrayItemValue(value) 27417 } 27418 27419 // DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue allows storing values for Cache fields according to their type 27420 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue interface { 27421 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath 27422 gotenobject.FieldPathValue 27423 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 27424 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) (cmp int, comparable bool) 27425 } 27426 27427 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue, error) { 27428 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(pathStr) 27429 if err != nil { 27430 return nil, err 27431 } 27432 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 27433 if err != nil { 27434 return nil, status.Errorf(codes.InvalidArgument, "error parsing Cache field path value from %s: %v", valueStr, err) 27435 } 27436 return fpv.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue), nil 27437 } 27438 27439 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue { 27440 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue(pathStr, valueStr) 27441 if err != nil { 27442 panic(err) 27443 } 27444 return fpv 27445 } 27446 27447 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue struct { 27448 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath 27449 value interface{} 27450 } 27451 27452 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue)(nil) 27453 27454 // GetRawValue returns raw value stored under selected path for 'Cache' as interface{} 27455 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) GetRawValue() interface{} { 27456 return fpv.value 27457 } 27458 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) AsTypeValue() (string, bool) { 27459 res, ok := fpv.value.(string) 27460 return res, ok 27461 } 27462 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) AsSizeBytesValue() (int64, bool) { 27463 res, ok := fpv.value.(int64) 27464 return res, ok 27465 } 27466 27467 // SetTo stores value for selected field for object Cache 27468 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) { 27469 if *target == nil { 27470 *target = new(Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 27471 } 27472 switch fpv.selector { 27473 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27474 (*target).Type = fpv.value.(string) 27475 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27476 (*target).SizeBytes = fpv.value.(int64) 27477 default: 27478 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fpv.selector)) 27479 } 27480 } 27481 27482 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) SetToRaw(target proto.Message) { 27483 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) 27484 fpv.SetTo(&typedObject) 27485 } 27486 27487 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache'. 27488 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) (int, bool) { 27489 switch fpv.selector { 27490 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27491 leftValue := fpv.value.(string) 27492 rightValue := source.GetType() 27493 if (leftValue) == (rightValue) { 27494 return 0, true 27495 } else if (leftValue) < (rightValue) { 27496 return -1, true 27497 } else { 27498 return 1, true 27499 } 27500 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27501 leftValue := fpv.value.(int64) 27502 rightValue := source.GetSizeBytes() 27503 if (leftValue) == (rightValue) { 27504 return 0, true 27505 } else if (leftValue) < (rightValue) { 27506 return -1, true 27507 } else { 27508 return 1, true 27509 } 27510 default: 27511 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache: %d", fpv.selector)) 27512 } 27513 } 27514 27515 func (fpv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 27516 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 27517 } 27518 27519 // DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue allows storing single item in Path-specific values for Cache according to their type 27520 // Present only for array (repeated) types. 27521 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue interface { 27522 gotenobject.FieldPathArrayItemValue 27523 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath 27524 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) bool 27525 } 27526 27527 // ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 27528 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue, error) { 27529 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(pathStr) 27530 if err != nil { 27531 return nil, err 27532 } 27533 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 27534 if err != nil { 27535 return nil, status.Errorf(codes.InvalidArgument, "error parsing Cache field path array item value from %s: %v", valueStr, err) 27536 } 27537 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue), nil 27538 } 27539 27540 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue { 27541 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue(pathStr, valueStr) 27542 if err != nil { 27543 panic(err) 27544 } 27545 return fpaiv 27546 } 27547 27548 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayItemValue struct { 27549 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath 27550 value interface{} 27551 } 27552 27553 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayItemValue)(nil) 27554 27555 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache as interface{} 27556 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 27557 return fpaiv.value 27558 } 27559 27560 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) (interface{}, bool) { 27561 return nil, false 27562 } 27563 27564 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 27565 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache)) 27566 } 27567 27568 // Contains returns a boolean indicating if value that is being held is present in given 'Cache' 27569 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_CPU_Processor_Cache) bool { 27570 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath.Get(source) 27571 for _, v := range slice { 27572 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 27573 if proto.Equal(asProtoMsg, v.(proto.Message)) { 27574 return true 27575 } 27576 } else if reflect.DeepEqual(v, fpaiv.value) { 27577 return true 27578 } 27579 } 27580 return false 27581 } 27582 27583 // DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues allows storing slice of values for Cache fields according to their type 27584 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues interface { 27585 gotenobject.FieldPathArrayOfValues 27586 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath 27587 } 27588 27589 func ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues, error) { 27590 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPath(pathStr) 27591 if err != nil { 27592 return nil, err 27593 } 27594 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 27595 if err != nil { 27596 return nil, status.Errorf(codes.InvalidArgument, "error parsing Cache field path array of values from %s: %v", valuesStr, err) 27597 } 27598 return fpaov.(DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues), nil 27599 } 27600 27601 func MustParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues { 27602 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues(pathStr, valuesStr) 27603 if err != nil { 27604 panic(err) 27605 } 27606 return fpaov 27607 } 27608 27609 type DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues struct { 27610 DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPath 27611 values interface{} 27612 } 27613 27614 var _ DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues)(nil) 27615 27616 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 27617 switch fpaov.selector { 27618 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorType: 27619 for _, v := range fpaov.values.([]string) { 27620 values = append(values, v) 27621 } 27622 case DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldPathSelectorSizeBytes: 27623 for _, v := range fpaov.values.([]int64) { 27624 values = append(values, v) 27625 } 27626 } 27627 return 27628 } 27629 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues) AsTypeArrayOfValues() ([]string, bool) { 27630 res, ok := fpaov.values.([]string) 27631 return res, ok 27632 } 27633 func (fpaov *DeviceStatusDeviceInfoHardwareInformationCPUProcessorCache_FieldTerminalPathArrayOfValues) AsSizeBytesArrayOfValues() ([]int64, bool) { 27634 res, ok := fpaov.values.([]int64) 27635 return res, ok 27636 } 27637 27638 // FieldPath provides implementation to handle 27639 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 27640 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath interface { 27641 gotenobject.FieldPath 27642 Selector() DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector 27643 Get(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) []interface{} 27644 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (interface{}, bool) 27645 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 27646 27647 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue 27648 // (or array of values) and holds passed value. Panics if injected type is incorrect. 27649 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue 27650 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues 27651 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue 27652 } 27653 27654 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector int32 27655 27656 const ( 27657 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 0 27658 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 1 27659 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 2 27660 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 3 27661 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 4 27662 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 5 27663 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 6 27664 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector = 7 27665 ) 27666 27667 func (s DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector) String() string { 27668 switch s { 27669 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27670 return "name" 27671 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27672 return "size_bytes" 27673 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27674 return "drive_type" 27675 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27676 return "vendor" 27677 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27678 return "model" 27679 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27680 return "serial_number" 27681 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27682 return "wwn" 27683 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27684 return "partitions" 27685 default: 27686 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", s)) 27687 } 27688 } 27689 27690 func BuildDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath, error) { 27691 if len(fp) == 0 { 27692 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_Block_Disk") 27693 } 27694 if len(fp) == 1 { 27695 switch fp[0] { 27696 case "name": 27697 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName}, nil 27698 case "size_bytes", "sizeBytes", "size-bytes": 27699 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes}, nil 27700 case "drive_type", "driveType", "drive-type": 27701 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType}, nil 27702 case "vendor": 27703 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor}, nil 27704 case "model": 27705 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel}, nil 27706 case "serial_number", "serialNumber", "serial-number": 27707 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber}, nil 27708 case "wwn": 27709 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn}, nil 27710 case "partitions": 27711 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions}, nil 27712 } 27713 } else { 27714 switch fp[0] { 27715 case "partitions": 27716 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(fp[1:]); err != nil { 27717 return nil, err 27718 } else { 27719 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions, subPath: subpath}, nil 27720 } 27721 } 27722 } 27723 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_Block_Disk", fp) 27724 } 27725 27726 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath, error) { 27727 fp, err := gotenobject.ParseRawFieldPath(rawField) 27728 if err != nil { 27729 return nil, err 27730 } 27731 return BuildDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(fp) 27732 } 27733 27734 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath { 27735 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(rawField) 27736 if err != nil { 27737 panic(err) 27738 } 27739 return fp 27740 } 27741 27742 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath struct { 27743 selector DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector 27744 } 27745 27746 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath)(nil) 27747 27748 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector { 27749 return fp.selector 27750 } 27751 27752 // String returns path representation in proto convention 27753 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) String() string { 27754 return fp.selector.String() 27755 } 27756 27757 // JSONString returns path representation is JSON convention 27758 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) JSONString() string { 27759 return strcase.ToLowerCamel(fp.String()) 27760 } 27761 27762 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_Block_Disk 27763 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (values []interface{}) { 27764 if source != nil { 27765 switch fp.selector { 27766 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27767 values = append(values, source.Name) 27768 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27769 values = append(values, source.SizeBytes) 27770 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27771 values = append(values, source.DriveType) 27772 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27773 values = append(values, source.Vendor) 27774 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27775 values = append(values, source.Model) 27776 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27777 values = append(values, source.SerialNumber) 27778 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27779 values = append(values, source.Wwn) 27780 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27781 for _, value := range source.GetPartitions() { 27782 values = append(values, value) 27783 } 27784 default: 27785 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27786 } 27787 } 27788 return 27789 } 27790 27791 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 27792 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 27793 } 27794 27795 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_Block_Disk 27796 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (interface{}, bool) { 27797 switch fp.selector { 27798 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27799 return source.GetName(), source != nil 27800 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27801 return source.GetSizeBytes(), source != nil 27802 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27803 return source.GetDriveType(), source != nil 27804 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27805 return source.GetVendor(), source != nil 27806 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27807 return source.GetModel(), source != nil 27808 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27809 return source.GetSerialNumber(), source != nil 27810 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27811 return source.GetWwn(), source != nil 27812 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27813 res := source.GetPartitions() 27814 return res, res != nil 27815 default: 27816 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27817 } 27818 } 27819 27820 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 27821 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 27822 } 27823 27824 // GetDefault returns a default value of the field type 27825 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) GetDefault() interface{} { 27826 switch fp.selector { 27827 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27828 return "" 27829 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27830 return int64(0) 27831 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27832 return "" 27833 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27834 return "" 27835 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27836 return "" 27837 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27838 return "" 27839 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27840 return "" 27841 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27842 return ([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)(nil) 27843 default: 27844 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27845 } 27846 } 27847 27848 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) { 27849 if item != nil { 27850 switch fp.selector { 27851 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27852 item.Name = "" 27853 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27854 item.SizeBytes = int64(0) 27855 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27856 item.DriveType = "" 27857 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27858 item.Vendor = "" 27859 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27860 item.Model = "" 27861 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27862 item.SerialNumber = "" 27863 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27864 item.Wwn = "" 27865 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27866 item.Partitions = nil 27867 default: 27868 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27869 } 27870 } 27871 } 27872 27873 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) ClearValueRaw(item proto.Message) { 27874 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 27875 } 27876 27877 // IsLeaf - whether field path is holds simple value 27878 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) IsLeaf() bool { 27879 return fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName || 27880 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes || 27881 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType || 27882 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor || 27883 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel || 27884 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber || 27885 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn 27886 } 27887 27888 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 27889 return []gotenobject.FieldPath{fp} 27890 } 27891 27892 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue { 27893 switch fp.selector { 27894 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27895 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(string)} 27896 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27897 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(int64)} 27898 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27899 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(string)} 27900 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27901 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(string)} 27902 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27903 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(string)} 27904 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27905 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(string)} 27906 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27907 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(string)} 27908 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27909 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)} 27910 default: 27911 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27912 } 27913 } 27914 27915 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 27916 return fp.WithIValue(value) 27917 } 27918 27919 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues { 27920 fpaov := &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp} 27921 switch fp.selector { 27922 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 27923 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]string)} 27924 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 27925 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]int64)} 27926 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 27927 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]string)} 27928 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 27929 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]string)} 27930 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 27931 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]string)} 27932 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 27933 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]string)} 27934 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 27935 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([]string)} 27936 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27937 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, values: values.([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)} 27938 default: 27939 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27940 } 27941 return fpaov 27942 } 27943 27944 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 27945 return fp.WithIArrayOfValues(values) 27946 } 27947 27948 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue { 27949 switch fp.selector { 27950 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27951 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)} 27952 default: 27953 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fp.selector)) 27954 } 27955 } 27956 27957 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 27958 return fp.WithIArrayItemValue(value) 27959 } 27960 27961 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath struct { 27962 selector DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector 27963 subPath gotenobject.FieldPath 27964 } 27965 27966 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath)(nil) 27967 27968 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelector { 27969 return fps.selector 27970 } 27971 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) AsPartitionsSubPath() (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath, bool) { 27972 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath) 27973 return res, ok 27974 } 27975 27976 // String returns path representation in proto convention 27977 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) String() string { 27978 return fps.selector.String() + "." + fps.subPath.String() 27979 } 27980 27981 // JSONString returns path representation is JSON convention 27982 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) JSONString() string { 27983 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 27984 } 27985 27986 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_Block_Disk 27987 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (values []interface{}) { 27988 switch fps.selector { 27989 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 27990 for _, item := range source.GetPartitions() { 27991 values = append(values, fps.subPath.GetRaw(item)...) 27992 } 27993 default: 27994 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fps.selector)) 27995 } 27996 return 27997 } 27998 27999 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) GetRaw(source proto.Message) []interface{} { 28000 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 28001 } 28002 28003 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_Block_Disk 28004 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (interface{}, bool) { 28005 switch fps.selector { 28006 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28007 if len(source.GetPartitions()) == 0 { 28008 return nil, false 28009 } 28010 return fps.subPath.GetSingleRaw(source.GetPartitions()[0]) 28011 default: 28012 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fps.selector)) 28013 } 28014 } 28015 28016 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 28017 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 28018 } 28019 28020 // GetDefault returns a default value of the field type 28021 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) GetDefault() interface{} { 28022 return fps.subPath.GetDefault() 28023 } 28024 28025 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) { 28026 if item != nil { 28027 switch fps.selector { 28028 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28029 for _, subItem := range item.Partitions { 28030 fps.subPath.ClearValueRaw(subItem) 28031 } 28032 default: 28033 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fps.selector)) 28034 } 28035 } 28036 } 28037 28038 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) ClearValueRaw(item proto.Message) { 28039 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 28040 } 28041 28042 // IsLeaf - whether field path is holds simple value 28043 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) IsLeaf() bool { 28044 return fps.subPath.IsLeaf() 28045 } 28046 28047 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 28048 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath{selector: fps.selector}} 28049 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 28050 return iPaths 28051 } 28052 28053 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue { 28054 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 28055 } 28056 28057 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 28058 return fps.WithIValue(value) 28059 } 28060 28061 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues { 28062 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 28063 } 28064 28065 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 28066 return fps.WithIArrayOfValues(values) 28067 } 28068 28069 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue { 28070 return &DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 28071 } 28072 28073 func (fps *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 28074 return fps.WithIArrayItemValue(value) 28075 } 28076 28077 // DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue allows storing values for Disk fields according to their type 28078 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue interface { 28079 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 28080 gotenobject.FieldPathValue 28081 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 28082 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (cmp int, comparable bool) 28083 } 28084 28085 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue, error) { 28086 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(pathStr) 28087 if err != nil { 28088 return nil, err 28089 } 28090 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 28091 if err != nil { 28092 return nil, status.Errorf(codes.InvalidArgument, "error parsing Disk field path value from %s: %v", valueStr, err) 28093 } 28094 return fpv.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue), nil 28095 } 28096 28097 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue { 28098 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue(pathStr, valueStr) 28099 if err != nil { 28100 panic(err) 28101 } 28102 return fpv 28103 } 28104 28105 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue struct { 28106 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath 28107 value interface{} 28108 } 28109 28110 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue)(nil) 28111 28112 // GetRawValue returns raw value stored under selected path for 'Disk' as interface{} 28113 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) GetRawValue() interface{} { 28114 return fpv.value 28115 } 28116 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsNameValue() (string, bool) { 28117 res, ok := fpv.value.(string) 28118 return res, ok 28119 } 28120 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsSizeBytesValue() (int64, bool) { 28121 res, ok := fpv.value.(int64) 28122 return res, ok 28123 } 28124 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsDriveTypeValue() (string, bool) { 28125 res, ok := fpv.value.(string) 28126 return res, ok 28127 } 28128 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsVendorValue() (string, bool) { 28129 res, ok := fpv.value.(string) 28130 return res, ok 28131 } 28132 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsModelValue() (string, bool) { 28133 res, ok := fpv.value.(string) 28134 return res, ok 28135 } 28136 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsSerialNumberValue() (string, bool) { 28137 res, ok := fpv.value.(string) 28138 return res, ok 28139 } 28140 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsWwnValue() (string, bool) { 28141 res, ok := fpv.value.(string) 28142 return res, ok 28143 } 28144 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) AsPartitionsValue() ([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition, bool) { 28145 res, ok := fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28146 return res, ok 28147 } 28148 28149 // SetTo stores value for selected field for object Disk 28150 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block_Disk) { 28151 if *target == nil { 28152 *target = new(Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 28153 } 28154 switch fpv.selector { 28155 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 28156 (*target).Name = fpv.value.(string) 28157 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 28158 (*target).SizeBytes = fpv.value.(int64) 28159 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 28160 (*target).DriveType = fpv.value.(string) 28161 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 28162 (*target).Vendor = fpv.value.(string) 28163 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 28164 (*target).Model = fpv.value.(string) 28165 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 28166 (*target).SerialNumber = fpv.value.(string) 28167 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 28168 (*target).Wwn = fpv.value.(string) 28169 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28170 (*target).Partitions = fpv.value.([]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28171 default: 28172 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fpv.selector)) 28173 } 28174 } 28175 28176 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) SetToRaw(target proto.Message) { 28177 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 28178 fpv.SetTo(&typedObject) 28179 } 28180 28181 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Block_Disk'. 28182 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (int, bool) { 28183 switch fpv.selector { 28184 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 28185 leftValue := fpv.value.(string) 28186 rightValue := source.GetName() 28187 if (leftValue) == (rightValue) { 28188 return 0, true 28189 } else if (leftValue) < (rightValue) { 28190 return -1, true 28191 } else { 28192 return 1, true 28193 } 28194 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 28195 leftValue := fpv.value.(int64) 28196 rightValue := source.GetSizeBytes() 28197 if (leftValue) == (rightValue) { 28198 return 0, true 28199 } else if (leftValue) < (rightValue) { 28200 return -1, true 28201 } else { 28202 return 1, true 28203 } 28204 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 28205 leftValue := fpv.value.(string) 28206 rightValue := source.GetDriveType() 28207 if (leftValue) == (rightValue) { 28208 return 0, true 28209 } else if (leftValue) < (rightValue) { 28210 return -1, true 28211 } else { 28212 return 1, true 28213 } 28214 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 28215 leftValue := fpv.value.(string) 28216 rightValue := source.GetVendor() 28217 if (leftValue) == (rightValue) { 28218 return 0, true 28219 } else if (leftValue) < (rightValue) { 28220 return -1, true 28221 } else { 28222 return 1, true 28223 } 28224 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 28225 leftValue := fpv.value.(string) 28226 rightValue := source.GetModel() 28227 if (leftValue) == (rightValue) { 28228 return 0, true 28229 } else if (leftValue) < (rightValue) { 28230 return -1, true 28231 } else { 28232 return 1, true 28233 } 28234 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 28235 leftValue := fpv.value.(string) 28236 rightValue := source.GetSerialNumber() 28237 if (leftValue) == (rightValue) { 28238 return 0, true 28239 } else if (leftValue) < (rightValue) { 28240 return -1, true 28241 } else { 28242 return 1, true 28243 } 28244 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 28245 leftValue := fpv.value.(string) 28246 rightValue := source.GetWwn() 28247 if (leftValue) == (rightValue) { 28248 return 0, true 28249 } else if (leftValue) < (rightValue) { 28250 return -1, true 28251 } else { 28252 return 1, true 28253 } 28254 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28255 return 0, false 28256 default: 28257 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fpv.selector)) 28258 } 28259 } 28260 28261 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 28262 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 28263 } 28264 28265 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue struct { 28266 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 28267 subPathValue gotenobject.FieldPathValue 28268 } 28269 28270 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue)(nil) 28271 28272 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue) AsPartitionsPathValue() (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue, bool) { 28273 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue) 28274 return res, ok 28275 } 28276 28277 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block_Disk) { 28278 if *target == nil { 28279 *target = new(Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 28280 } 28281 switch fpvs.Selector() { 28282 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28283 panic("FieldPath setter is unsupported for array subpaths") 28284 default: 28285 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fpvs.Selector())) 28286 } 28287 } 28288 28289 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue) SetToRaw(target proto.Message) { 28290 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) 28291 fpvs.SetTo(&typedObject) 28292 } 28293 28294 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue) GetRawValue() interface{} { 28295 return fpvs.subPathValue.GetRawValue() 28296 } 28297 28298 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (int, bool) { 28299 switch fpvs.Selector() { 28300 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28301 return 0, false // repeated field 28302 default: 28303 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fpvs.Selector())) 28304 } 28305 } 28306 28307 func (fpvs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 28308 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 28309 } 28310 28311 // DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue allows storing single item in Path-specific values for Disk according to their type 28312 // Present only for array (repeated) types. 28313 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue interface { 28314 gotenobject.FieldPathArrayItemValue 28315 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 28316 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk) bool 28317 } 28318 28319 // ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 28320 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue, error) { 28321 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(pathStr) 28322 if err != nil { 28323 return nil, err 28324 } 28325 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 28326 if err != nil { 28327 return nil, status.Errorf(codes.InvalidArgument, "error parsing Disk field path array item value from %s: %v", valueStr, err) 28328 } 28329 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue), nil 28330 } 28331 28332 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue { 28333 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue(pathStr, valueStr) 28334 if err != nil { 28335 panic(err) 28336 } 28337 return fpaiv 28338 } 28339 28340 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue struct { 28341 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath 28342 value interface{} 28343 } 28344 28345 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue)(nil) 28346 28347 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_Block_Disk as interface{} 28348 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 28349 return fpaiv.value 28350 } 28351 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue) AsPartitionsItemValue() (*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition, bool) { 28352 res, ok := fpaiv.value.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28353 return res, ok 28354 } 28355 28356 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) (interface{}, bool) { 28357 return nil, false 28358 } 28359 28360 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 28361 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk)) 28362 } 28363 28364 // Contains returns a boolean indicating if value that is being held is present in given 'Disk' 28365 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) bool { 28366 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath.Get(source) 28367 for _, v := range slice { 28368 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 28369 if proto.Equal(asProtoMsg, v.(proto.Message)) { 28370 return true 28371 } 28372 } else if reflect.DeepEqual(v, fpaiv.value) { 28373 return true 28374 } 28375 } 28376 return false 28377 } 28378 28379 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayItemValue struct { 28380 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 28381 subPathItemValue gotenobject.FieldPathArrayItemValue 28382 } 28383 28384 // GetRawValue returns stored array item value 28385 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 28386 return fpaivs.subPathItemValue.GetRawItemValue() 28387 } 28388 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayItemValue) AsPartitionsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue, bool) { 28389 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue) 28390 return res, ok 28391 } 28392 28393 // Contains returns a boolean indicating if value that is being held is present in given 'Disk' 28394 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk) bool { 28395 switch fpaivs.Selector() { 28396 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28397 return false // repeated/map field 28398 default: 28399 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk: %d", fpaivs.Selector())) 28400 } 28401 } 28402 28403 // DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues allows storing slice of values for Disk fields according to their type 28404 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues interface { 28405 gotenobject.FieldPathArrayOfValues 28406 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 28407 } 28408 28409 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues, error) { 28410 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath(pathStr) 28411 if err != nil { 28412 return nil, err 28413 } 28414 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 28415 if err != nil { 28416 return nil, status.Errorf(codes.InvalidArgument, "error parsing Disk field path array of values from %s: %v", valuesStr, err) 28417 } 28418 return fpaov.(DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues), nil 28419 } 28420 28421 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues { 28422 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues(pathStr, valuesStr) 28423 if err != nil { 28424 panic(err) 28425 } 28426 return fpaov 28427 } 28428 28429 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues struct { 28430 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPath 28431 values interface{} 28432 } 28433 28434 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues)(nil) 28435 28436 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 28437 switch fpaov.selector { 28438 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorName: 28439 for _, v := range fpaov.values.([]string) { 28440 values = append(values, v) 28441 } 28442 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSizeBytes: 28443 for _, v := range fpaov.values.([]int64) { 28444 values = append(values, v) 28445 } 28446 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorDriveType: 28447 for _, v := range fpaov.values.([]string) { 28448 values = append(values, v) 28449 } 28450 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorVendor: 28451 for _, v := range fpaov.values.([]string) { 28452 values = append(values, v) 28453 } 28454 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorModel: 28455 for _, v := range fpaov.values.([]string) { 28456 values = append(values, v) 28457 } 28458 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorSerialNumber: 28459 for _, v := range fpaov.values.([]string) { 28460 values = append(values, v) 28461 } 28462 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorWwn: 28463 for _, v := range fpaov.values.([]string) { 28464 values = append(values, v) 28465 } 28466 case DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathSelectorPartitions: 28467 for _, v := range fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) { 28468 values = append(values, v) 28469 } 28470 } 28471 return 28472 } 28473 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 28474 res, ok := fpaov.values.([]string) 28475 return res, ok 28476 } 28477 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsSizeBytesArrayOfValues() ([]int64, bool) { 28478 res, ok := fpaov.values.([]int64) 28479 return res, ok 28480 } 28481 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsDriveTypeArrayOfValues() ([]string, bool) { 28482 res, ok := fpaov.values.([]string) 28483 return res, ok 28484 } 28485 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsVendorArrayOfValues() ([]string, bool) { 28486 res, ok := fpaov.values.([]string) 28487 return res, ok 28488 } 28489 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsModelArrayOfValues() ([]string, bool) { 28490 res, ok := fpaov.values.([]string) 28491 return res, ok 28492 } 28493 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsSerialNumberArrayOfValues() ([]string, bool) { 28494 res, ok := fpaov.values.([]string) 28495 return res, ok 28496 } 28497 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsWwnArrayOfValues() ([]string, bool) { 28498 res, ok := fpaov.values.([]string) 28499 return res, ok 28500 } 28501 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldTerminalPathArrayOfValues) AsPartitionsArrayOfValues() ([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition, bool) { 28502 res, ok := fpaov.values.([][]*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28503 return res, ok 28504 } 28505 28506 type DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayOfValues struct { 28507 DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPath 28508 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 28509 } 28510 28511 var _ DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayOfValues)(nil) 28512 28513 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 28514 return fpsaov.subPathArrayOfValues.GetRawValues() 28515 } 28516 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationBlockDisk_FieldSubPathArrayOfValues) AsPartitionsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues, bool) { 28517 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues) 28518 return res, ok 28519 } 28520 28521 // FieldPath provides implementation to handle 28522 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 28523 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath interface { 28524 gotenobject.FieldPath 28525 Selector() DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector 28526 Get(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) []interface{} 28527 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) (interface{}, bool) 28528 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28529 28530 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue 28531 // (or array of values) and holds passed value. Panics if injected type is incorrect. 28532 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue 28533 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues 28534 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue 28535 } 28536 28537 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector int32 28538 28539 const ( 28540 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector = 0 28541 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector = 1 28542 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector = 2 28543 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector = 3 28544 ) 28545 28546 func (s DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector) String() string { 28547 switch s { 28548 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28549 return "name" 28550 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28551 return "size_bytes" 28552 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28553 return "mount_point" 28554 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28555 return "type" 28556 default: 28557 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", s)) 28558 } 28559 } 28560 28561 func BuildDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath, error) { 28562 if len(fp) == 0 { 28563 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition") 28564 } 28565 if len(fp) == 1 { 28566 switch fp[0] { 28567 case "name": 28568 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName}, nil 28569 case "size_bytes", "sizeBytes", "size-bytes": 28570 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes}, nil 28571 case "mount_point", "mountPoint", "mount-point": 28572 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint}, nil 28573 case "type": 28574 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType}, nil 28575 } 28576 } 28577 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition", fp) 28578 } 28579 28580 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath, error) { 28581 fp, err := gotenobject.ParseRawFieldPath(rawField) 28582 if err != nil { 28583 return nil, err 28584 } 28585 return BuildDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(fp) 28586 } 28587 28588 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath { 28589 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(rawField) 28590 if err != nil { 28591 panic(err) 28592 } 28593 return fp 28594 } 28595 28596 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath struct { 28597 selector DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector 28598 } 28599 28600 var _ DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath)(nil) 28601 28602 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelector { 28603 return fp.selector 28604 } 28605 28606 // String returns path representation in proto convention 28607 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) String() string { 28608 return fp.selector.String() 28609 } 28610 28611 // JSONString returns path representation is JSON convention 28612 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) JSONString() string { 28613 return strcase.ToLowerCamel(fp.String()) 28614 } 28615 28616 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition 28617 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) (values []interface{}) { 28618 if source != nil { 28619 switch fp.selector { 28620 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28621 values = append(values, source.Name) 28622 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28623 values = append(values, source.SizeBytes) 28624 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28625 values = append(values, source.MountPoint) 28626 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28627 values = append(values, source.Type) 28628 default: 28629 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28630 } 28631 } 28632 return 28633 } 28634 28635 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 28636 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 28637 } 28638 28639 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition 28640 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) (interface{}, bool) { 28641 switch fp.selector { 28642 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28643 return source.GetName(), source != nil 28644 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28645 return source.GetSizeBytes(), source != nil 28646 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28647 return source.GetMountPoint(), source != nil 28648 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28649 return source.GetType(), source != nil 28650 default: 28651 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28652 } 28653 } 28654 28655 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 28656 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 28657 } 28658 28659 // GetDefault returns a default value of the field type 28660 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) GetDefault() interface{} { 28661 switch fp.selector { 28662 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28663 return "" 28664 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28665 return int64(0) 28666 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28667 return "" 28668 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28669 return "" 28670 default: 28671 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28672 } 28673 } 28674 28675 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) { 28676 if item != nil { 28677 switch fp.selector { 28678 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28679 item.Name = "" 28680 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28681 item.SizeBytes = int64(0) 28682 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28683 item.MountPoint = "" 28684 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28685 item.Type = "" 28686 default: 28687 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28688 } 28689 } 28690 } 28691 28692 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) ClearValueRaw(item proto.Message) { 28693 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 28694 } 28695 28696 // IsLeaf - whether field path is holds simple value 28697 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) IsLeaf() bool { 28698 return fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName || 28699 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes || 28700 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint || 28701 fp.selector == DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType 28702 } 28703 28704 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 28705 return []gotenobject.FieldPath{fp} 28706 } 28707 28708 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue { 28709 switch fp.selector { 28710 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28711 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, value: value.(string)} 28712 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28713 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, value: value.(int64)} 28714 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28715 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, value: value.(string)} 28716 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28717 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, value: value.(string)} 28718 default: 28719 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28720 } 28721 } 28722 28723 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 28724 return fp.WithIValue(value) 28725 } 28726 28727 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues { 28728 fpaov := &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp} 28729 switch fp.selector { 28730 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28731 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, values: values.([]string)} 28732 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28733 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, values: values.([]int64)} 28734 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28735 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, values: values.([]string)} 28736 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28737 return &DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath: *fp, values: values.([]string)} 28738 default: 28739 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28740 } 28741 return fpaov 28742 } 28743 28744 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 28745 return fp.WithIArrayOfValues(values) 28746 } 28747 28748 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue { 28749 switch fp.selector { 28750 default: 28751 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fp.selector)) 28752 } 28753 } 28754 28755 func (fp *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 28756 return fp.WithIArrayItemValue(value) 28757 } 28758 28759 // DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue allows storing values for Partition fields according to their type 28760 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue interface { 28761 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath 28762 gotenobject.FieldPathValue 28763 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28764 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) (cmp int, comparable bool) 28765 } 28766 28767 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue, error) { 28768 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(pathStr) 28769 if err != nil { 28770 return nil, err 28771 } 28772 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 28773 if err != nil { 28774 return nil, status.Errorf(codes.InvalidArgument, "error parsing Partition field path value from %s: %v", valueStr, err) 28775 } 28776 return fpv.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue), nil 28777 } 28778 28779 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue { 28780 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue(pathStr, valueStr) 28781 if err != nil { 28782 panic(err) 28783 } 28784 return fpv 28785 } 28786 28787 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue struct { 28788 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath 28789 value interface{} 28790 } 28791 28792 var _ DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue)(nil) 28793 28794 // GetRawValue returns raw value stored under selected path for 'Partition' as interface{} 28795 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) GetRawValue() interface{} { 28796 return fpv.value 28797 } 28798 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) AsNameValue() (string, bool) { 28799 res, ok := fpv.value.(string) 28800 return res, ok 28801 } 28802 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) AsSizeBytesValue() (int64, bool) { 28803 res, ok := fpv.value.(int64) 28804 return res, ok 28805 } 28806 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) AsMountPointValue() (string, bool) { 28807 res, ok := fpv.value.(string) 28808 return res, ok 28809 } 28810 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) AsTypeValue() (string, bool) { 28811 res, ok := fpv.value.(string) 28812 return res, ok 28813 } 28814 28815 // SetTo stores value for selected field for object Partition 28816 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) { 28817 if *target == nil { 28818 *target = new(Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28819 } 28820 switch fpv.selector { 28821 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28822 (*target).Name = fpv.value.(string) 28823 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28824 (*target).SizeBytes = fpv.value.(int64) 28825 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28826 (*target).MountPoint = fpv.value.(string) 28827 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28828 (*target).Type = fpv.value.(string) 28829 default: 28830 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fpv.selector)) 28831 } 28832 } 28833 28834 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) SetToRaw(target proto.Message) { 28835 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) 28836 fpv.SetTo(&typedObject) 28837 } 28838 28839 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition'. 28840 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) (int, bool) { 28841 switch fpv.selector { 28842 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28843 leftValue := fpv.value.(string) 28844 rightValue := source.GetName() 28845 if (leftValue) == (rightValue) { 28846 return 0, true 28847 } else if (leftValue) < (rightValue) { 28848 return -1, true 28849 } else { 28850 return 1, true 28851 } 28852 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28853 leftValue := fpv.value.(int64) 28854 rightValue := source.GetSizeBytes() 28855 if (leftValue) == (rightValue) { 28856 return 0, true 28857 } else if (leftValue) < (rightValue) { 28858 return -1, true 28859 } else { 28860 return 1, true 28861 } 28862 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28863 leftValue := fpv.value.(string) 28864 rightValue := source.GetMountPoint() 28865 if (leftValue) == (rightValue) { 28866 return 0, true 28867 } else if (leftValue) < (rightValue) { 28868 return -1, true 28869 } else { 28870 return 1, true 28871 } 28872 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 28873 leftValue := fpv.value.(string) 28874 rightValue := source.GetType() 28875 if (leftValue) == (rightValue) { 28876 return 0, true 28877 } else if (leftValue) < (rightValue) { 28878 return -1, true 28879 } else { 28880 return 1, true 28881 } 28882 default: 28883 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition: %d", fpv.selector)) 28884 } 28885 } 28886 28887 func (fpv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 28888 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 28889 } 28890 28891 // DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue allows storing single item in Path-specific values for Partition according to their type 28892 // Present only for array (repeated) types. 28893 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue interface { 28894 gotenobject.FieldPathArrayItemValue 28895 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath 28896 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) bool 28897 } 28898 28899 // ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 28900 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue, error) { 28901 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(pathStr) 28902 if err != nil { 28903 return nil, err 28904 } 28905 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 28906 if err != nil { 28907 return nil, status.Errorf(codes.InvalidArgument, "error parsing Partition field path array item value from %s: %v", valueStr, err) 28908 } 28909 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue), nil 28910 } 28911 28912 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue { 28913 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue(pathStr, valueStr) 28914 if err != nil { 28915 panic(err) 28916 } 28917 return fpaiv 28918 } 28919 28920 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayItemValue struct { 28921 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath 28922 value interface{} 28923 } 28924 28925 var _ DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayItemValue)(nil) 28926 28927 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition as interface{} 28928 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 28929 return fpaiv.value 28930 } 28931 28932 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) (interface{}, bool) { 28933 return nil, false 28934 } 28935 28936 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 28937 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition)) 28938 } 28939 28940 // Contains returns a boolean indicating if value that is being held is present in given 'Partition' 28941 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Block_Disk_Partition) bool { 28942 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath.Get(source) 28943 for _, v := range slice { 28944 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 28945 if proto.Equal(asProtoMsg, v.(proto.Message)) { 28946 return true 28947 } 28948 } else if reflect.DeepEqual(v, fpaiv.value) { 28949 return true 28950 } 28951 } 28952 return false 28953 } 28954 28955 // DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues allows storing slice of values for Partition fields according to their type 28956 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues interface { 28957 gotenobject.FieldPathArrayOfValues 28958 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath 28959 } 28960 28961 func ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues, error) { 28962 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPath(pathStr) 28963 if err != nil { 28964 return nil, err 28965 } 28966 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 28967 if err != nil { 28968 return nil, status.Errorf(codes.InvalidArgument, "error parsing Partition field path array of values from %s: %v", valuesStr, err) 28969 } 28970 return fpaov.(DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues), nil 28971 } 28972 28973 func MustParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues { 28974 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues(pathStr, valuesStr) 28975 if err != nil { 28976 panic(err) 28977 } 28978 return fpaov 28979 } 28980 28981 type DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues struct { 28982 DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPath 28983 values interface{} 28984 } 28985 28986 var _ DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues)(nil) 28987 28988 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 28989 switch fpaov.selector { 28990 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorName: 28991 for _, v := range fpaov.values.([]string) { 28992 values = append(values, v) 28993 } 28994 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorSizeBytes: 28995 for _, v := range fpaov.values.([]int64) { 28996 values = append(values, v) 28997 } 28998 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorMountPoint: 28999 for _, v := range fpaov.values.([]string) { 29000 values = append(values, v) 29001 } 29002 case DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldPathSelectorType: 29003 for _, v := range fpaov.values.([]string) { 29004 values = append(values, v) 29005 } 29006 } 29007 return 29008 } 29009 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 29010 res, ok := fpaov.values.([]string) 29011 return res, ok 29012 } 29013 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues) AsSizeBytesArrayOfValues() ([]int64, bool) { 29014 res, ok := fpaov.values.([]int64) 29015 return res, ok 29016 } 29017 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues) AsMountPointArrayOfValues() ([]string, bool) { 29018 res, ok := fpaov.values.([]string) 29019 return res, ok 29020 } 29021 func (fpaov *DeviceStatusDeviceInfoHardwareInformationBlockDiskPartition_FieldTerminalPathArrayOfValues) AsTypeArrayOfValues() ([]string, bool) { 29022 res, ok := fpaov.values.([]string) 29023 return res, ok 29024 } 29025 29026 // FieldPath provides implementation to handle 29027 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 29028 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath interface { 29029 gotenobject.FieldPath 29030 Selector() DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector 29031 Get(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) []interface{} 29032 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (interface{}, bool) 29033 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 29034 29035 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue 29036 // (or array of values) and holds passed value. Panics if injected type is incorrect. 29037 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue 29038 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues 29039 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue 29040 } 29041 29042 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector int32 29043 29044 const ( 29045 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 0 29046 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 1 29047 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 2 29048 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 3 29049 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 4 29050 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 5 29051 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 6 29052 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector = 7 29053 ) 29054 29055 func (s DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector) String() string { 29056 switch s { 29057 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29058 return "name" 29059 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29060 return "mac_address" 29061 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29062 return "virtual" 29063 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29064 return "description" 29065 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29066 return "product_name" 29067 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29068 return "vendor" 29069 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29070 return "subvendor" 29071 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29072 return "setting" 29073 default: 29074 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", s)) 29075 } 29076 } 29077 29078 func BuildDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath, error) { 29079 if len(fp) == 0 { 29080 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_Network_NIC") 29081 } 29082 if len(fp) == 1 { 29083 switch fp[0] { 29084 case "name": 29085 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName}, nil 29086 case "mac_address", "macAddress", "mac-address": 29087 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress}, nil 29088 case "virtual": 29089 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual}, nil 29090 case "description": 29091 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription}, nil 29092 case "product_name", "productName", "product-name": 29093 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName}, nil 29094 case "vendor": 29095 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor}, nil 29096 case "subvendor": 29097 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor}, nil 29098 case "setting": 29099 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting}, nil 29100 } 29101 } else { 29102 switch fp[0] { 29103 case "setting": 29104 if len(fp) > 2 { 29105 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object Device_Status_DeviceInfo_HardwareInformation_Network_NIC)", fp) 29106 } 29107 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap{selector: DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting, key: fp[1]}, nil 29108 } 29109 } 29110 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_Network_NIC", fp) 29111 } 29112 29113 func ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath, error) { 29114 fp, err := gotenobject.ParseRawFieldPath(rawField) 29115 if err != nil { 29116 return nil, err 29117 } 29118 return BuildDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(fp) 29119 } 29120 29121 func MustParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath { 29122 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(rawField) 29123 if err != nil { 29124 panic(err) 29125 } 29126 return fp 29127 } 29128 29129 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath struct { 29130 selector DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector 29131 } 29132 29133 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath)(nil) 29134 29135 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector { 29136 return fp.selector 29137 } 29138 29139 // String returns path representation in proto convention 29140 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) String() string { 29141 return fp.selector.String() 29142 } 29143 29144 // JSONString returns path representation is JSON convention 29145 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) JSONString() string { 29146 return strcase.ToLowerCamel(fp.String()) 29147 } 29148 29149 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_Network_NIC 29150 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (values []interface{}) { 29151 if source != nil { 29152 switch fp.selector { 29153 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29154 values = append(values, source.Name) 29155 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29156 values = append(values, source.MacAddress) 29157 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29158 values = append(values, source.Virtual) 29159 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29160 values = append(values, source.Description) 29161 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29162 values = append(values, source.ProductName) 29163 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29164 values = append(values, source.Vendor) 29165 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29166 values = append(values, source.Subvendor) 29167 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29168 values = append(values, source.Setting) 29169 default: 29170 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29171 } 29172 } 29173 return 29174 } 29175 29176 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 29177 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29178 } 29179 29180 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_Network_NIC 29181 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (interface{}, bool) { 29182 switch fp.selector { 29183 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29184 return source.GetName(), source != nil 29185 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29186 return source.GetMacAddress(), source != nil 29187 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29188 return source.GetVirtual(), source != nil 29189 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29190 return source.GetDescription(), source != nil 29191 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29192 return source.GetProductName(), source != nil 29193 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29194 return source.GetVendor(), source != nil 29195 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29196 return source.GetSubvendor(), source != nil 29197 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29198 res := source.GetSetting() 29199 return res, res != nil 29200 default: 29201 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29202 } 29203 } 29204 29205 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 29206 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29207 } 29208 29209 // GetDefault returns a default value of the field type 29210 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) GetDefault() interface{} { 29211 switch fp.selector { 29212 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29213 return "" 29214 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29215 return "" 29216 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29217 return false 29218 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29219 return "" 29220 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29221 return "" 29222 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29223 return "" 29224 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29225 return "" 29226 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29227 return (map[string]string)(nil) 29228 default: 29229 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29230 } 29231 } 29232 29233 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) { 29234 if item != nil { 29235 switch fp.selector { 29236 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29237 item.Name = "" 29238 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29239 item.MacAddress = "" 29240 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29241 item.Virtual = false 29242 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29243 item.Description = "" 29244 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29245 item.ProductName = "" 29246 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29247 item.Vendor = "" 29248 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29249 item.Subvendor = "" 29250 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29251 item.Setting = nil 29252 default: 29253 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29254 } 29255 } 29256 } 29257 29258 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) ClearValueRaw(item proto.Message) { 29259 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29260 } 29261 29262 // IsLeaf - whether field path is holds simple value 29263 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) IsLeaf() bool { 29264 return fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName || 29265 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress || 29266 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual || 29267 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription || 29268 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName || 29269 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor || 29270 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor || 29271 fp.selector == DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting 29272 } 29273 29274 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 29275 return []gotenobject.FieldPath{fp} 29276 } 29277 29278 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue { 29279 switch fp.selector { 29280 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29281 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(string)} 29282 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29283 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(string)} 29284 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29285 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(bool)} 29286 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29287 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(string)} 29288 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29289 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(string)} 29290 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29291 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(string)} 29292 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29293 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(string)} 29294 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29295 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, value: value.(map[string]string)} 29296 default: 29297 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29298 } 29299 } 29300 29301 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 29302 return fp.WithIValue(value) 29303 } 29304 29305 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues { 29306 fpaov := &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp} 29307 switch fp.selector { 29308 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29309 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]string)} 29310 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29311 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]string)} 29312 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29313 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]bool)} 29314 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29315 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]string)} 29316 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29317 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]string)} 29318 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29319 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]string)} 29320 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29321 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]string)} 29322 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29323 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath: *fp, values: values.([]map[string]string)} 29324 default: 29325 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29326 } 29327 return fpaov 29328 } 29329 29330 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 29331 return fp.WithIArrayOfValues(values) 29332 } 29333 29334 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue { 29335 switch fp.selector { 29336 default: 29337 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fp.selector)) 29338 } 29339 } 29340 29341 func (fp *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 29342 return fp.WithIArrayItemValue(value) 29343 } 29344 29345 // FieldPath for map type with additional Key information 29346 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap struct { 29347 key string 29348 selector DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector 29349 } 29350 29351 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap)(nil) 29352 29353 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) Selector() DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelector { 29354 return fpm.selector 29355 } 29356 29357 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) Key() string { 29358 return fpm.key 29359 } 29360 29361 // String returns path representation in proto convention 29362 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) String() string { 29363 return fpm.selector.String() + "." + fpm.key 29364 } 29365 29366 // JSONString returns path representation is JSON convention. Note that map keys are not transformed 29367 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) JSONString() string { 29368 return strcase.ToLowerCamel(fpm.selector.String()) + "." + fpm.key 29369 } 29370 29371 // Get returns all values pointed by selected field map key from source Device_Status_DeviceInfo_HardwareInformation_Network_NIC 29372 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) Get(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (values []interface{}) { 29373 switch fpm.selector { 29374 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29375 if value, ok := source.GetSetting()[fpm.key]; ok { 29376 values = append(values, value) 29377 } 29378 default: 29379 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29380 } 29381 return 29382 } 29383 29384 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) GetRaw(source proto.Message) []interface{} { 29385 return fpm.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29386 } 29387 29388 // GetSingle returns value by selected field map key from source Device_Status_DeviceInfo_HardwareInformation_Network_NIC 29389 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (interface{}, bool) { 29390 switch fpm.selector { 29391 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29392 res, ok := source.GetSetting()[fpm.key] 29393 return res, ok 29394 default: 29395 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29396 } 29397 } 29398 29399 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) GetSingleRaw(source proto.Message) (interface{}, bool) { 29400 return fpm.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29401 } 29402 29403 // GetDefault returns a default value of the field type 29404 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) GetDefault() interface{} { 29405 switch fpm.selector { 29406 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29407 var v string 29408 return v 29409 default: 29410 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29411 } 29412 } 29413 29414 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) { 29415 if item != nil { 29416 switch fpm.selector { 29417 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29418 delete(item.Setting, fpm.key) 29419 default: 29420 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29421 } 29422 } 29423 } 29424 29425 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) ClearValueRaw(item proto.Message) { 29426 fpm.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29427 } 29428 29429 // IsLeaf - whether field path is holds simple value 29430 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) IsLeaf() bool { 29431 switch fpm.selector { 29432 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29433 return true 29434 default: 29435 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29436 } 29437 } 29438 29439 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 29440 return []gotenobject.FieldPath{fpm} 29441 } 29442 29443 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue { 29444 switch fpm.selector { 29445 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29446 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap: *fpm, value: value.(string)} 29447 default: 29448 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29449 } 29450 } 29451 29452 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 29453 return fpm.WithIValue(value) 29454 } 29455 29456 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues { 29457 switch fpm.selector { 29458 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29459 return &DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap: *fpm, values: values.([]string)} 29460 default: 29461 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpm.selector)) 29462 } 29463 } 29464 29465 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 29466 return fpm.WithIArrayOfValues(values) 29467 } 29468 29469 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue { 29470 panic("Cannot create array item value from map fieldpath") 29471 } 29472 29473 func (fpm *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 29474 return fpm.WithIArrayItemValue(value) 29475 } 29476 29477 // DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue allows storing values for NIC fields according to their type 29478 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue interface { 29479 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath 29480 gotenobject.FieldPathValue 29481 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 29482 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (cmp int, comparable bool) 29483 } 29484 29485 func ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue, error) { 29486 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(pathStr) 29487 if err != nil { 29488 return nil, err 29489 } 29490 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 29491 if err != nil { 29492 return nil, status.Errorf(codes.InvalidArgument, "error parsing NIC field path value from %s: %v", valueStr, err) 29493 } 29494 return fpv.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue), nil 29495 } 29496 29497 func MustParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue { 29498 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue(pathStr, valueStr) 29499 if err != nil { 29500 panic(err) 29501 } 29502 return fpv 29503 } 29504 29505 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue struct { 29506 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath 29507 value interface{} 29508 } 29509 29510 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue)(nil) 29511 29512 // GetRawValue returns raw value stored under selected path for 'NIC' as interface{} 29513 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) GetRawValue() interface{} { 29514 return fpv.value 29515 } 29516 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsNameValue() (string, bool) { 29517 res, ok := fpv.value.(string) 29518 return res, ok 29519 } 29520 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsMacAddressValue() (string, bool) { 29521 res, ok := fpv.value.(string) 29522 return res, ok 29523 } 29524 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsVirtualValue() (bool, bool) { 29525 res, ok := fpv.value.(bool) 29526 return res, ok 29527 } 29528 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 29529 res, ok := fpv.value.(string) 29530 return res, ok 29531 } 29532 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsProductNameValue() (string, bool) { 29533 res, ok := fpv.value.(string) 29534 return res, ok 29535 } 29536 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsVendorValue() (string, bool) { 29537 res, ok := fpv.value.(string) 29538 return res, ok 29539 } 29540 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsSubvendorValue() (string, bool) { 29541 res, ok := fpv.value.(string) 29542 return res, ok 29543 } 29544 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) AsSettingValue() (map[string]string, bool) { 29545 res, ok := fpv.value.(map[string]string) 29546 return res, ok 29547 } 29548 29549 // SetTo stores value for selected field for object NIC 29550 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Network_NIC) { 29551 if *target == nil { 29552 *target = new(Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 29553 } 29554 switch fpv.selector { 29555 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29556 (*target).Name = fpv.value.(string) 29557 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29558 (*target).MacAddress = fpv.value.(string) 29559 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29560 (*target).Virtual = fpv.value.(bool) 29561 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29562 (*target).Description = fpv.value.(string) 29563 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29564 (*target).ProductName = fpv.value.(string) 29565 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29566 (*target).Vendor = fpv.value.(string) 29567 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29568 (*target).Subvendor = fpv.value.(string) 29569 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29570 (*target).Setting = fpv.value.(map[string]string) 29571 default: 29572 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpv.selector)) 29573 } 29574 } 29575 29576 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) SetToRaw(target proto.Message) { 29577 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 29578 fpv.SetTo(&typedObject) 29579 } 29580 29581 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Network_NIC'. 29582 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (int, bool) { 29583 switch fpv.selector { 29584 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29585 leftValue := fpv.value.(string) 29586 rightValue := source.GetName() 29587 if (leftValue) == (rightValue) { 29588 return 0, true 29589 } else if (leftValue) < (rightValue) { 29590 return -1, true 29591 } else { 29592 return 1, true 29593 } 29594 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29595 leftValue := fpv.value.(string) 29596 rightValue := source.GetMacAddress() 29597 if (leftValue) == (rightValue) { 29598 return 0, true 29599 } else if (leftValue) < (rightValue) { 29600 return -1, true 29601 } else { 29602 return 1, true 29603 } 29604 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29605 leftValue := fpv.value.(bool) 29606 rightValue := source.GetVirtual() 29607 if (leftValue) == (rightValue) { 29608 return 0, true 29609 } else if !(leftValue) && (rightValue) { 29610 return -1, true 29611 } else { 29612 return 1, true 29613 } 29614 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29615 leftValue := fpv.value.(string) 29616 rightValue := source.GetDescription() 29617 if (leftValue) == (rightValue) { 29618 return 0, true 29619 } else if (leftValue) < (rightValue) { 29620 return -1, true 29621 } else { 29622 return 1, true 29623 } 29624 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29625 leftValue := fpv.value.(string) 29626 rightValue := source.GetProductName() 29627 if (leftValue) == (rightValue) { 29628 return 0, true 29629 } else if (leftValue) < (rightValue) { 29630 return -1, true 29631 } else { 29632 return 1, true 29633 } 29634 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29635 leftValue := fpv.value.(string) 29636 rightValue := source.GetVendor() 29637 if (leftValue) == (rightValue) { 29638 return 0, true 29639 } else if (leftValue) < (rightValue) { 29640 return -1, true 29641 } else { 29642 return 1, true 29643 } 29644 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29645 leftValue := fpv.value.(string) 29646 rightValue := source.GetSubvendor() 29647 if (leftValue) == (rightValue) { 29648 return 0, true 29649 } else if (leftValue) < (rightValue) { 29650 return -1, true 29651 } else { 29652 return 1, true 29653 } 29654 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29655 return 0, false 29656 default: 29657 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpv.selector)) 29658 } 29659 } 29660 29661 func (fpv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 29662 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29663 } 29664 29665 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue struct { 29666 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap 29667 value interface{} 29668 } 29669 29670 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue)(nil) 29671 29672 // GetValue returns value stored under selected field in NIC as interface{} 29673 func (fpmv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue) GetRawValue() interface{} { 29674 return fpmv.value 29675 } 29676 func (fpmv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue) AsSettingElementValue() (string, bool) { 29677 res, ok := fpmv.value.(string) 29678 return res, ok 29679 } 29680 29681 // SetTo stores value for selected field in NIC 29682 func (fpmv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_Network_NIC) { 29683 if *target == nil { 29684 *target = new(Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 29685 } 29686 switch fpmv.selector { 29687 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29688 if (*target).Setting == nil { 29689 (*target).Setting = make(map[string]string) 29690 } 29691 (*target).Setting[fpmv.key] = fpmv.value.(string) 29692 default: 29693 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpmv.selector)) 29694 } 29695 } 29696 29697 func (fpmv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue) SetToRaw(target proto.Message) { 29698 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) 29699 fpmv.SetTo(&typedObject) 29700 } 29701 29702 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_Network_NIC'. 29703 func (fpmv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (int, bool) { 29704 switch fpmv.selector { 29705 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29706 leftValue := fpmv.value.(string) 29707 rightValue := source.GetSetting()[fpmv.key] 29708 if (leftValue) == (rightValue) { 29709 return 0, true 29710 } else if (leftValue) < (rightValue) { 29711 return -1, true 29712 } else { 29713 return 1, true 29714 } 29715 default: 29716 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_Network_NIC: %d", fpmv.selector)) 29717 } 29718 } 29719 29720 func (fpmv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapValue) CompareWithRaw(source proto.Message) (int, bool) { 29721 return fpmv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29722 } 29723 29724 // DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue allows storing single item in Path-specific values for NIC according to their type 29725 // Present only for array (repeated) types. 29726 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue interface { 29727 gotenobject.FieldPathArrayItemValue 29728 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath 29729 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC) bool 29730 } 29731 29732 // ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 29733 func ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue, error) { 29734 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(pathStr) 29735 if err != nil { 29736 return nil, err 29737 } 29738 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 29739 if err != nil { 29740 return nil, status.Errorf(codes.InvalidArgument, "error parsing NIC field path array item value from %s: %v", valueStr, err) 29741 } 29742 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue), nil 29743 } 29744 29745 func MustParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue { 29746 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue(pathStr, valueStr) 29747 if err != nil { 29748 panic(err) 29749 } 29750 return fpaiv 29751 } 29752 29753 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayItemValue struct { 29754 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath 29755 value interface{} 29756 } 29757 29758 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayItemValue)(nil) 29759 29760 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_Network_NIC as interface{} 29761 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 29762 return fpaiv.value 29763 } 29764 29765 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) (interface{}, bool) { 29766 return nil, false 29767 } 29768 29769 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 29770 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_Network_NIC)) 29771 } 29772 29773 // Contains returns a boolean indicating if value that is being held is present in given 'NIC' 29774 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_Network_NIC) bool { 29775 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath.Get(source) 29776 for _, v := range slice { 29777 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 29778 if proto.Equal(asProtoMsg, v.(proto.Message)) { 29779 return true 29780 } 29781 } else if reflect.DeepEqual(v, fpaiv.value) { 29782 return true 29783 } 29784 } 29785 return false 29786 } 29787 29788 // DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues allows storing slice of values for NIC fields according to their type 29789 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues interface { 29790 gotenobject.FieldPathArrayOfValues 29791 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath 29792 } 29793 29794 func ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues, error) { 29795 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPath(pathStr) 29796 if err != nil { 29797 return nil, err 29798 } 29799 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 29800 if err != nil { 29801 return nil, status.Errorf(codes.InvalidArgument, "error parsing NIC field path array of values from %s: %v", valuesStr, err) 29802 } 29803 return fpaov.(DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues), nil 29804 } 29805 29806 func MustParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues { 29807 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues(pathStr, valuesStr) 29808 if err != nil { 29809 panic(err) 29810 } 29811 return fpaov 29812 } 29813 29814 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues struct { 29815 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPath 29816 values interface{} 29817 } 29818 29819 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues)(nil) 29820 29821 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 29822 switch fpaov.selector { 29823 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorName: 29824 for _, v := range fpaov.values.([]string) { 29825 values = append(values, v) 29826 } 29827 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorMacAddress: 29828 for _, v := range fpaov.values.([]string) { 29829 values = append(values, v) 29830 } 29831 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVirtual: 29832 for _, v := range fpaov.values.([]bool) { 29833 values = append(values, v) 29834 } 29835 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorDescription: 29836 for _, v := range fpaov.values.([]string) { 29837 values = append(values, v) 29838 } 29839 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorProductName: 29840 for _, v := range fpaov.values.([]string) { 29841 values = append(values, v) 29842 } 29843 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorVendor: 29844 for _, v := range fpaov.values.([]string) { 29845 values = append(values, v) 29846 } 29847 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSubvendor: 29848 for _, v := range fpaov.values.([]string) { 29849 values = append(values, v) 29850 } 29851 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29852 for _, v := range fpaov.values.([]map[string]string) { 29853 values = append(values, v) 29854 } 29855 } 29856 return 29857 } 29858 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 29859 res, ok := fpaov.values.([]string) 29860 return res, ok 29861 } 29862 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsMacAddressArrayOfValues() ([]string, bool) { 29863 res, ok := fpaov.values.([]string) 29864 return res, ok 29865 } 29866 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsVirtualArrayOfValues() ([]bool, bool) { 29867 res, ok := fpaov.values.([]bool) 29868 return res, ok 29869 } 29870 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 29871 res, ok := fpaov.values.([]string) 29872 return res, ok 29873 } 29874 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsProductNameArrayOfValues() ([]string, bool) { 29875 res, ok := fpaov.values.([]string) 29876 return res, ok 29877 } 29878 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsVendorArrayOfValues() ([]string, bool) { 29879 res, ok := fpaov.values.([]string) 29880 return res, ok 29881 } 29882 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsSubvendorArrayOfValues() ([]string, bool) { 29883 res, ok := fpaov.values.([]string) 29884 return res, ok 29885 } 29886 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldTerminalPathArrayOfValues) AsSettingArrayOfValues() ([]map[string]string, bool) { 29887 res, ok := fpaov.values.([]map[string]string) 29888 return res, ok 29889 } 29890 29891 type DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapArrayOfValues struct { 29892 DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMap 29893 values interface{} 29894 } 29895 29896 var _ DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapArrayOfValues)(nil) 29897 29898 func (fpmaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapArrayOfValues) GetRawValues() (values []interface{}) { 29899 switch fpmaov.selector { 29900 case DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathSelectorSetting: 29901 for _, v := range fpmaov.values.([]string) { 29902 values = append(values, v) 29903 } 29904 } 29905 return 29906 } 29907 func (fpmaov *DeviceStatusDeviceInfoHardwareInformationNetworkNIC_FieldPathMapArrayOfValues) AsSettingArrayOfElementValues() ([]string, bool) { 29908 res, ok := fpmaov.values.([]string) 29909 return res, ok 29910 } 29911 29912 // FieldPath provides implementation to handle 29913 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 29914 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath interface { 29915 gotenobject.FieldPath 29916 Selector() DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector 29917 Get(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) []interface{} 29918 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (interface{}, bool) 29919 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 29920 29921 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue 29922 // (or array of values) and holds passed value. Panics if injected type is incorrect. 29923 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue 29924 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues 29925 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue 29926 } 29927 29928 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector int32 29929 29930 const ( 29931 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector = 0 29932 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector = 1 29933 ) 29934 29935 func (s DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector) String() string { 29936 switch s { 29937 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 29938 return "index" 29939 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 29940 return "device" 29941 default: 29942 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", s)) 29943 } 29944 } 29945 29946 func BuildDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath, error) { 29947 if len(fp) == 0 { 29948 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard") 29949 } 29950 if len(fp) == 1 { 29951 switch fp[0] { 29952 case "index": 29953 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex}, nil 29954 case "device": 29955 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice}, nil 29956 } 29957 } else { 29958 switch fp[0] { 29959 case "device": 29960 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath(fp[1:]); err != nil { 29961 return nil, err 29962 } else { 29963 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice, subPath: subpath}, nil 29964 } 29965 } 29966 } 29967 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard", fp) 29968 } 29969 29970 func ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath, error) { 29971 fp, err := gotenobject.ParseRawFieldPath(rawField) 29972 if err != nil { 29973 return nil, err 29974 } 29975 return BuildDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(fp) 29976 } 29977 29978 func MustParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath { 29979 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(rawField) 29980 if err != nil { 29981 panic(err) 29982 } 29983 return fp 29984 } 29985 29986 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath struct { 29987 selector DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector 29988 } 29989 29990 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath)(nil) 29991 29992 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector { 29993 return fp.selector 29994 } 29995 29996 // String returns path representation in proto convention 29997 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) String() string { 29998 return fp.selector.String() 29999 } 30000 30001 // JSONString returns path representation is JSON convention 30002 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) JSONString() string { 30003 return strcase.ToLowerCamel(fp.String()) 30004 } 30005 30006 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard 30007 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (values []interface{}) { 30008 if source != nil { 30009 switch fp.selector { 30010 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30011 values = append(values, source.Index) 30012 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30013 if source.Device != nil { 30014 values = append(values, source.Device) 30015 } 30016 default: 30017 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30018 } 30019 } 30020 return 30021 } 30022 30023 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 30024 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30025 } 30026 30027 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard 30028 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (interface{}, bool) { 30029 switch fp.selector { 30030 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30031 return source.GetIndex(), source != nil 30032 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30033 res := source.GetDevice() 30034 return res, res != nil 30035 default: 30036 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30037 } 30038 } 30039 30040 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 30041 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30042 } 30043 30044 // GetDefault returns a default value of the field type 30045 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) GetDefault() interface{} { 30046 switch fp.selector { 30047 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30048 return int64(0) 30049 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30050 return (*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)(nil) 30051 default: 30052 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30053 } 30054 } 30055 30056 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) { 30057 if item != nil { 30058 switch fp.selector { 30059 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30060 item.Index = int64(0) 30061 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30062 item.Device = nil 30063 default: 30064 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30065 } 30066 } 30067 } 30068 30069 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) ClearValueRaw(item proto.Message) { 30070 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30071 } 30072 30073 // IsLeaf - whether field path is holds simple value 30074 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) IsLeaf() bool { 30075 return fp.selector == DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex 30076 } 30077 30078 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 30079 return []gotenobject.FieldPath{fp} 30080 } 30081 30082 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue { 30083 switch fp.selector { 30084 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30085 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: *fp, value: value.(int64)} 30086 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30087 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)} 30088 default: 30089 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30090 } 30091 } 30092 30093 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 30094 return fp.WithIValue(value) 30095 } 30096 30097 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues { 30098 fpaov := &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: *fp} 30099 switch fp.selector { 30100 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30101 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: *fp, values: values.([]int64)} 30102 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30103 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_PCIDevice)} 30104 default: 30105 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30106 } 30107 return fpaov 30108 } 30109 30110 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 30111 return fp.WithIArrayOfValues(values) 30112 } 30113 30114 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue { 30115 switch fp.selector { 30116 default: 30117 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fp.selector)) 30118 } 30119 } 30120 30121 func (fp *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 30122 return fp.WithIArrayItemValue(value) 30123 } 30124 30125 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath struct { 30126 selector DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector 30127 subPath gotenobject.FieldPath 30128 } 30129 30130 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath)(nil) 30131 30132 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelector { 30133 return fps.selector 30134 } 30135 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) AsDeviceSubPath() (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath, bool) { 30136 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPath) 30137 return res, ok 30138 } 30139 30140 // String returns path representation in proto convention 30141 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) String() string { 30142 return fps.selector.String() + "." + fps.subPath.String() 30143 } 30144 30145 // JSONString returns path representation is JSON convention 30146 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) JSONString() string { 30147 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 30148 } 30149 30150 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard 30151 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (values []interface{}) { 30152 switch fps.selector { 30153 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30154 values = append(values, fps.subPath.GetRaw(source.GetDevice())...) 30155 default: 30156 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fps.selector)) 30157 } 30158 return 30159 } 30160 30161 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) GetRaw(source proto.Message) []interface{} { 30162 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30163 } 30164 30165 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard 30166 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (interface{}, bool) { 30167 switch fps.selector { 30168 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30169 if source.GetDevice() == nil { 30170 return nil, false 30171 } 30172 return fps.subPath.GetSingleRaw(source.GetDevice()) 30173 default: 30174 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fps.selector)) 30175 } 30176 } 30177 30178 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 30179 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30180 } 30181 30182 // GetDefault returns a default value of the field type 30183 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) GetDefault() interface{} { 30184 return fps.subPath.GetDefault() 30185 } 30186 30187 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) { 30188 if item != nil { 30189 switch fps.selector { 30190 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30191 fps.subPath.ClearValueRaw(item.Device) 30192 default: 30193 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fps.selector)) 30194 } 30195 } 30196 } 30197 30198 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) ClearValueRaw(item proto.Message) { 30199 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30200 } 30201 30202 // IsLeaf - whether field path is holds simple value 30203 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) IsLeaf() bool { 30204 return fps.subPath.IsLeaf() 30205 } 30206 30207 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 30208 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath{selector: fps.selector}} 30209 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 30210 return iPaths 30211 } 30212 30213 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue { 30214 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 30215 } 30216 30217 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 30218 return fps.WithIValue(value) 30219 } 30220 30221 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues { 30222 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 30223 } 30224 30225 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 30226 return fps.WithIArrayOfValues(values) 30227 } 30228 30229 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue { 30230 return &DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 30231 } 30232 30233 func (fps *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 30234 return fps.WithIArrayItemValue(value) 30235 } 30236 30237 // DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue allows storing values for GraphicCard fields according to their type 30238 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue interface { 30239 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 30240 gotenobject.FieldPathValue 30241 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 30242 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (cmp int, comparable bool) 30243 } 30244 30245 func ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue, error) { 30246 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(pathStr) 30247 if err != nil { 30248 return nil, err 30249 } 30250 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 30251 if err != nil { 30252 return nil, status.Errorf(codes.InvalidArgument, "error parsing GraphicCard field path value from %s: %v", valueStr, err) 30253 } 30254 return fpv.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue), nil 30255 } 30256 30257 func MustParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue { 30258 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue(pathStr, valueStr) 30259 if err != nil { 30260 panic(err) 30261 } 30262 return fpv 30263 } 30264 30265 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue struct { 30266 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath 30267 value interface{} 30268 } 30269 30270 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue)(nil) 30271 30272 // GetRawValue returns raw value stored under selected path for 'GraphicCard' as interface{} 30273 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) GetRawValue() interface{} { 30274 return fpv.value 30275 } 30276 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) AsIndexValue() (int64, bool) { 30277 res, ok := fpv.value.(int64) 30278 return res, ok 30279 } 30280 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) AsDeviceValue() (*Device_Status_DeviceInfo_HardwareInformation_PCIDevice, bool) { 30281 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 30282 return res, ok 30283 } 30284 30285 // SetTo stores value for selected field for object GraphicCard 30286 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) { 30287 if *target == nil { 30288 *target = new(Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 30289 } 30290 switch fpv.selector { 30291 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30292 (*target).Index = fpv.value.(int64) 30293 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30294 (*target).Device = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 30295 default: 30296 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fpv.selector)) 30297 } 30298 } 30299 30300 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) SetToRaw(target proto.Message) { 30301 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 30302 fpv.SetTo(&typedObject) 30303 } 30304 30305 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard'. 30306 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (int, bool) { 30307 switch fpv.selector { 30308 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30309 leftValue := fpv.value.(int64) 30310 rightValue := source.GetIndex() 30311 if (leftValue) == (rightValue) { 30312 return 0, true 30313 } else if (leftValue) < (rightValue) { 30314 return -1, true 30315 } else { 30316 return 1, true 30317 } 30318 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30319 return 0, false 30320 default: 30321 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fpv.selector)) 30322 } 30323 } 30324 30325 func (fpv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 30326 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30327 } 30328 30329 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue struct { 30330 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 30331 subPathValue gotenobject.FieldPathValue 30332 } 30333 30334 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue)(nil) 30335 30336 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue) AsDevicePathValue() (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue, bool) { 30337 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue) 30338 return res, ok 30339 } 30340 30341 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) { 30342 if *target == nil { 30343 *target = new(Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 30344 } 30345 switch fpvs.Selector() { 30346 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30347 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue).SetTo(&(*target).Device) 30348 default: 30349 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fpvs.Selector())) 30350 } 30351 } 30352 30353 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue) SetToRaw(target proto.Message) { 30354 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) 30355 fpvs.SetTo(&typedObject) 30356 } 30357 30358 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue) GetRawValue() interface{} { 30359 return fpvs.subPathValue.GetRawValue() 30360 } 30361 30362 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (int, bool) { 30363 switch fpvs.Selector() { 30364 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30365 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathValue).CompareWith(source.GetDevice()) 30366 default: 30367 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fpvs.Selector())) 30368 } 30369 } 30370 30371 func (fpvs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 30372 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30373 } 30374 30375 // DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue allows storing single item in Path-specific values for GraphicCard according to their type 30376 // Present only for array (repeated) types. 30377 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue interface { 30378 gotenobject.FieldPathArrayItemValue 30379 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 30380 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) bool 30381 } 30382 30383 // ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 30384 func ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue, error) { 30385 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(pathStr) 30386 if err != nil { 30387 return nil, err 30388 } 30389 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 30390 if err != nil { 30391 return nil, status.Errorf(codes.InvalidArgument, "error parsing GraphicCard field path array item value from %s: %v", valueStr, err) 30392 } 30393 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue), nil 30394 } 30395 30396 func MustParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue { 30397 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue(pathStr, valueStr) 30398 if err != nil { 30399 panic(err) 30400 } 30401 return fpaiv 30402 } 30403 30404 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayItemValue struct { 30405 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath 30406 value interface{} 30407 } 30408 30409 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayItemValue)(nil) 30410 30411 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard as interface{} 30412 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 30413 return fpaiv.value 30414 } 30415 30416 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) (interface{}, bool) { 30417 return nil, false 30418 } 30419 30420 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 30421 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard)) 30422 } 30423 30424 // Contains returns a boolean indicating if value that is being held is present in given 'GraphicCard' 30425 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) bool { 30426 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath.Get(source) 30427 for _, v := range slice { 30428 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 30429 if proto.Equal(asProtoMsg, v.(proto.Message)) { 30430 return true 30431 } 30432 } else if reflect.DeepEqual(v, fpaiv.value) { 30433 return true 30434 } 30435 } 30436 return false 30437 } 30438 30439 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayItemValue struct { 30440 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 30441 subPathItemValue gotenobject.FieldPathArrayItemValue 30442 } 30443 30444 // GetRawValue returns stored array item value 30445 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 30446 return fpaivs.subPathItemValue.GetRawItemValue() 30447 } 30448 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayItemValue) AsDevicePathItemValue() (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue, bool) { 30449 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue) 30450 return res, ok 30451 } 30452 30453 // Contains returns a boolean indicating if value that is being held is present in given 'GraphicCard' 30454 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard) bool { 30455 switch fpaivs.Selector() { 30456 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30457 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayItemValue).ContainsValue(source.GetDevice()) 30458 default: 30459 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_GPU_GraphicCard: %d", fpaivs.Selector())) 30460 } 30461 } 30462 30463 // DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues allows storing slice of values for GraphicCard fields according to their type 30464 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues interface { 30465 gotenobject.FieldPathArrayOfValues 30466 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 30467 } 30468 30469 func ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues, error) { 30470 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath(pathStr) 30471 if err != nil { 30472 return nil, err 30473 } 30474 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 30475 if err != nil { 30476 return nil, status.Errorf(codes.InvalidArgument, "error parsing GraphicCard field path array of values from %s: %v", valuesStr, err) 30477 } 30478 return fpaov.(DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues), nil 30479 } 30480 30481 func MustParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues { 30482 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues(pathStr, valuesStr) 30483 if err != nil { 30484 panic(err) 30485 } 30486 return fpaov 30487 } 30488 30489 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues struct { 30490 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPath 30491 values interface{} 30492 } 30493 30494 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues)(nil) 30495 30496 func (fpaov *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 30497 switch fpaov.selector { 30498 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorIndex: 30499 for _, v := range fpaov.values.([]int64) { 30500 values = append(values, v) 30501 } 30502 case DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathSelectorDevice: 30503 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) { 30504 values = append(values, v) 30505 } 30506 } 30507 return 30508 } 30509 func (fpaov *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues) AsIndexArrayOfValues() ([]int64, bool) { 30510 res, ok := fpaov.values.([]int64) 30511 return res, ok 30512 } 30513 func (fpaov *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldTerminalPathArrayOfValues) AsDeviceArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_PCIDevice, bool) { 30514 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_PCIDevice) 30515 return res, ok 30516 } 30517 30518 type DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayOfValues struct { 30519 DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPath 30520 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 30521 } 30522 30523 var _ DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayOfValues)(nil) 30524 30525 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 30526 return fpsaov.subPathArrayOfValues.GetRawValues() 30527 } 30528 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationGPUGraphicCard_FieldSubPathArrayOfValues) AsDevicePathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues, bool) { 30529 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationPCIDevice_FieldPathArrayOfValues) 30530 return res, ok 30531 } 30532 30533 // FieldPath provides implementation to handle 30534 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 30535 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath interface { 30536 gotenobject.FieldPath 30537 Selector() DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector 30538 Get(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) []interface{} 30539 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) (interface{}, bool) 30540 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 30541 30542 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue 30543 // (or array of values) and holds passed value. Panics if injected type is incorrect. 30544 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue 30545 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues 30546 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue 30547 } 30548 30549 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector int32 30550 30551 const ( 30552 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 0 30553 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 1 30554 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 2 30555 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 3 30556 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 4 30557 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 5 30558 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 6 30559 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector = 7 30560 ) 30561 30562 func (s DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector) String() string { 30563 switch s { 30564 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30565 return "description" 30566 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30567 return "product" 30568 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30569 return "vendor" 30570 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30571 return "serial" 30572 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30573 return "slot" 30574 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30575 return "size_bytes" 30576 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30577 return "frequency_hz" 30578 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30579 return "width_bits" 30580 default: 30581 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", s)) 30582 } 30583 } 30584 30585 func BuildDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath, error) { 30586 if len(fp) == 0 { 30587 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank") 30588 } 30589 if len(fp) == 1 { 30590 switch fp[0] { 30591 case "description": 30592 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription}, nil 30593 case "product": 30594 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct}, nil 30595 case "vendor": 30596 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor}, nil 30597 case "serial": 30598 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial}, nil 30599 case "slot": 30600 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot}, nil 30601 case "size_bytes", "sizeBytes", "size-bytes": 30602 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes}, nil 30603 case "frequency_hz", "frequencyHz", "frequency-hz": 30604 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz}, nil 30605 case "width_bits", "widthBits", "width-bits": 30606 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits}, nil 30607 } 30608 } 30609 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank", fp) 30610 } 30611 30612 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath, error) { 30613 fp, err := gotenobject.ParseRawFieldPath(rawField) 30614 if err != nil { 30615 return nil, err 30616 } 30617 return BuildDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(fp) 30618 } 30619 30620 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath { 30621 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(rawField) 30622 if err != nil { 30623 panic(err) 30624 } 30625 return fp 30626 } 30627 30628 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath struct { 30629 selector DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector 30630 } 30631 30632 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath)(nil) 30633 30634 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelector { 30635 return fp.selector 30636 } 30637 30638 // String returns path representation in proto convention 30639 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) String() string { 30640 return fp.selector.String() 30641 } 30642 30643 // JSONString returns path representation is JSON convention 30644 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) JSONString() string { 30645 return strcase.ToLowerCamel(fp.String()) 30646 } 30647 30648 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank 30649 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) (values []interface{}) { 30650 if source != nil { 30651 switch fp.selector { 30652 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30653 values = append(values, source.Description) 30654 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30655 values = append(values, source.Product) 30656 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30657 values = append(values, source.Vendor) 30658 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30659 values = append(values, source.Serial) 30660 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30661 values = append(values, source.Slot) 30662 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30663 values = append(values, source.SizeBytes) 30664 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30665 values = append(values, source.FrequencyHz) 30666 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30667 values = append(values, source.WidthBits) 30668 default: 30669 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30670 } 30671 } 30672 return 30673 } 30674 30675 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 30676 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)) 30677 } 30678 30679 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank 30680 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) (interface{}, bool) { 30681 switch fp.selector { 30682 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30683 return source.GetDescription(), source != nil 30684 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30685 return source.GetProduct(), source != nil 30686 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30687 return source.GetVendor(), source != nil 30688 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30689 return source.GetSerial(), source != nil 30690 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30691 return source.GetSlot(), source != nil 30692 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30693 return source.GetSizeBytes(), source != nil 30694 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30695 return source.GetFrequencyHz(), source != nil 30696 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30697 return source.GetWidthBits(), source != nil 30698 default: 30699 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30700 } 30701 } 30702 30703 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 30704 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)) 30705 } 30706 30707 // GetDefault returns a default value of the field type 30708 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) GetDefault() interface{} { 30709 switch fp.selector { 30710 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30711 return "" 30712 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30713 return "" 30714 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30715 return "" 30716 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30717 return "" 30718 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30719 return "" 30720 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30721 return int64(0) 30722 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30723 return int64(0) 30724 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30725 return int32(0) 30726 default: 30727 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30728 } 30729 } 30730 30731 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) { 30732 if item != nil { 30733 switch fp.selector { 30734 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30735 item.Description = "" 30736 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30737 item.Product = "" 30738 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30739 item.Vendor = "" 30740 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30741 item.Serial = "" 30742 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30743 item.Slot = "" 30744 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30745 item.SizeBytes = int64(0) 30746 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30747 item.FrequencyHz = int64(0) 30748 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30749 item.WidthBits = int32(0) 30750 default: 30751 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30752 } 30753 } 30754 } 30755 30756 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) ClearValueRaw(item proto.Message) { 30757 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)) 30758 } 30759 30760 // IsLeaf - whether field path is holds simple value 30761 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) IsLeaf() bool { 30762 return fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription || 30763 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct || 30764 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor || 30765 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial || 30766 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot || 30767 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes || 30768 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz || 30769 fp.selector == DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits 30770 } 30771 30772 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 30773 return []gotenobject.FieldPath{fp} 30774 } 30775 30776 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue { 30777 switch fp.selector { 30778 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30779 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(string)} 30780 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30781 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(string)} 30782 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30783 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(string)} 30784 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30785 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(string)} 30786 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30787 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(string)} 30788 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30789 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(int64)} 30790 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30791 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(int64)} 30792 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30793 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, value: value.(int32)} 30794 default: 30795 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30796 } 30797 } 30798 30799 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 30800 return fp.WithIValue(value) 30801 } 30802 30803 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues { 30804 fpaov := &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp} 30805 switch fp.selector { 30806 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30807 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]string)} 30808 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30809 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]string)} 30810 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30811 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]string)} 30812 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30813 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]string)} 30814 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30815 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]string)} 30816 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30817 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]int64)} 30818 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30819 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]int64)} 30820 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30821 return &DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath: *fp, values: values.([]int32)} 30822 default: 30823 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30824 } 30825 return fpaov 30826 } 30827 30828 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 30829 return fp.WithIArrayOfValues(values) 30830 } 30831 30832 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue { 30833 switch fp.selector { 30834 default: 30835 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fp.selector)) 30836 } 30837 } 30838 30839 func (fp *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 30840 return fp.WithIArrayItemValue(value) 30841 } 30842 30843 // DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue allows storing values for MemoryBank fields according to their type 30844 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue interface { 30845 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath 30846 gotenobject.FieldPathValue 30847 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 30848 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) (cmp int, comparable bool) 30849 } 30850 30851 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue, error) { 30852 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(pathStr) 30853 if err != nil { 30854 return nil, err 30855 } 30856 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 30857 if err != nil { 30858 return nil, status.Errorf(codes.InvalidArgument, "error parsing MemoryBank field path value from %s: %v", valueStr, err) 30859 } 30860 return fpv.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue), nil 30861 } 30862 30863 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue { 30864 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue(pathStr, valueStr) 30865 if err != nil { 30866 panic(err) 30867 } 30868 return fpv 30869 } 30870 30871 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue struct { 30872 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath 30873 value interface{} 30874 } 30875 30876 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue)(nil) 30877 30878 // GetRawValue returns raw value stored under selected path for 'MemoryBank' as interface{} 30879 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) GetRawValue() interface{} { 30880 return fpv.value 30881 } 30882 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 30883 res, ok := fpv.value.(string) 30884 return res, ok 30885 } 30886 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsProductValue() (string, bool) { 30887 res, ok := fpv.value.(string) 30888 return res, ok 30889 } 30890 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsVendorValue() (string, bool) { 30891 res, ok := fpv.value.(string) 30892 return res, ok 30893 } 30894 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsSerialValue() (string, bool) { 30895 res, ok := fpv.value.(string) 30896 return res, ok 30897 } 30898 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsSlotValue() (string, bool) { 30899 res, ok := fpv.value.(string) 30900 return res, ok 30901 } 30902 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsSizeBytesValue() (int64, bool) { 30903 res, ok := fpv.value.(int64) 30904 return res, ok 30905 } 30906 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsFrequencyHzValue() (int64, bool) { 30907 res, ok := fpv.value.(int64) 30908 return res, ok 30909 } 30910 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) AsWidthBitsValue() (int32, bool) { 30911 res, ok := fpv.value.(int32) 30912 return res, ok 30913 } 30914 30915 // SetTo stores value for selected field for object MemoryBank 30916 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) { 30917 if *target == nil { 30918 *target = new(Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 30919 } 30920 switch fpv.selector { 30921 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30922 (*target).Description = fpv.value.(string) 30923 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30924 (*target).Product = fpv.value.(string) 30925 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30926 (*target).Vendor = fpv.value.(string) 30927 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30928 (*target).Serial = fpv.value.(string) 30929 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30930 (*target).Slot = fpv.value.(string) 30931 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 30932 (*target).SizeBytes = fpv.value.(int64) 30933 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 30934 (*target).FrequencyHz = fpv.value.(int64) 30935 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 30936 (*target).WidthBits = fpv.value.(int32) 30937 default: 30938 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fpv.selector)) 30939 } 30940 } 30941 30942 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) SetToRaw(target proto.Message) { 30943 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) 30944 fpv.SetTo(&typedObject) 30945 } 30946 30947 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank'. 30948 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) (int, bool) { 30949 switch fpv.selector { 30950 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 30951 leftValue := fpv.value.(string) 30952 rightValue := source.GetDescription() 30953 if (leftValue) == (rightValue) { 30954 return 0, true 30955 } else if (leftValue) < (rightValue) { 30956 return -1, true 30957 } else { 30958 return 1, true 30959 } 30960 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 30961 leftValue := fpv.value.(string) 30962 rightValue := source.GetProduct() 30963 if (leftValue) == (rightValue) { 30964 return 0, true 30965 } else if (leftValue) < (rightValue) { 30966 return -1, true 30967 } else { 30968 return 1, true 30969 } 30970 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 30971 leftValue := fpv.value.(string) 30972 rightValue := source.GetVendor() 30973 if (leftValue) == (rightValue) { 30974 return 0, true 30975 } else if (leftValue) < (rightValue) { 30976 return -1, true 30977 } else { 30978 return 1, true 30979 } 30980 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 30981 leftValue := fpv.value.(string) 30982 rightValue := source.GetSerial() 30983 if (leftValue) == (rightValue) { 30984 return 0, true 30985 } else if (leftValue) < (rightValue) { 30986 return -1, true 30987 } else { 30988 return 1, true 30989 } 30990 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 30991 leftValue := fpv.value.(string) 30992 rightValue := source.GetSlot() 30993 if (leftValue) == (rightValue) { 30994 return 0, true 30995 } else if (leftValue) < (rightValue) { 30996 return -1, true 30997 } else { 30998 return 1, true 30999 } 31000 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 31001 leftValue := fpv.value.(int64) 31002 rightValue := source.GetSizeBytes() 31003 if (leftValue) == (rightValue) { 31004 return 0, true 31005 } else if (leftValue) < (rightValue) { 31006 return -1, true 31007 } else { 31008 return 1, true 31009 } 31010 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 31011 leftValue := fpv.value.(int64) 31012 rightValue := source.GetFrequencyHz() 31013 if (leftValue) == (rightValue) { 31014 return 0, true 31015 } else if (leftValue) < (rightValue) { 31016 return -1, true 31017 } else { 31018 return 1, true 31019 } 31020 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 31021 leftValue := fpv.value.(int32) 31022 rightValue := source.GetWidthBits() 31023 if (leftValue) == (rightValue) { 31024 return 0, true 31025 } else if (leftValue) < (rightValue) { 31026 return -1, true 31027 } else { 31028 return 1, true 31029 } 31030 default: 31031 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank: %d", fpv.selector)) 31032 } 31033 } 31034 31035 func (fpv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 31036 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)) 31037 } 31038 31039 // DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue allows storing single item in Path-specific values for MemoryBank according to their type 31040 // Present only for array (repeated) types. 31041 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue interface { 31042 gotenobject.FieldPathArrayItemValue 31043 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath 31044 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) bool 31045 } 31046 31047 // ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 31048 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue, error) { 31049 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(pathStr) 31050 if err != nil { 31051 return nil, err 31052 } 31053 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 31054 if err != nil { 31055 return nil, status.Errorf(codes.InvalidArgument, "error parsing MemoryBank field path array item value from %s: %v", valueStr, err) 31056 } 31057 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue), nil 31058 } 31059 31060 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue { 31061 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue(pathStr, valueStr) 31062 if err != nil { 31063 panic(err) 31064 } 31065 return fpaiv 31066 } 31067 31068 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayItemValue struct { 31069 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath 31070 value interface{} 31071 } 31072 31073 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayItemValue)(nil) 31074 31075 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank as interface{} 31076 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 31077 return fpaiv.value 31078 } 31079 31080 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) (interface{}, bool) { 31081 return nil, false 31082 } 31083 31084 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 31085 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank)) 31086 } 31087 31088 // Contains returns a boolean indicating if value that is being held is present in given 'MemoryBank' 31089 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_MemoryInfo_MemoryBank) bool { 31090 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath.Get(source) 31091 for _, v := range slice { 31092 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 31093 if proto.Equal(asProtoMsg, v.(proto.Message)) { 31094 return true 31095 } 31096 } else if reflect.DeepEqual(v, fpaiv.value) { 31097 return true 31098 } 31099 } 31100 return false 31101 } 31102 31103 // DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues allows storing slice of values for MemoryBank fields according to their type 31104 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues interface { 31105 gotenobject.FieldPathArrayOfValues 31106 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath 31107 } 31108 31109 func ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues, error) { 31110 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPath(pathStr) 31111 if err != nil { 31112 return nil, err 31113 } 31114 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 31115 if err != nil { 31116 return nil, status.Errorf(codes.InvalidArgument, "error parsing MemoryBank field path array of values from %s: %v", valuesStr, err) 31117 } 31118 return fpaov.(DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues), nil 31119 } 31120 31121 func MustParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues { 31122 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues(pathStr, valuesStr) 31123 if err != nil { 31124 panic(err) 31125 } 31126 return fpaov 31127 } 31128 31129 type DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues struct { 31130 DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPath 31131 values interface{} 31132 } 31133 31134 var _ DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues)(nil) 31135 31136 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 31137 switch fpaov.selector { 31138 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorDescription: 31139 for _, v := range fpaov.values.([]string) { 31140 values = append(values, v) 31141 } 31142 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorProduct: 31143 for _, v := range fpaov.values.([]string) { 31144 values = append(values, v) 31145 } 31146 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorVendor: 31147 for _, v := range fpaov.values.([]string) { 31148 values = append(values, v) 31149 } 31150 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSerial: 31151 for _, v := range fpaov.values.([]string) { 31152 values = append(values, v) 31153 } 31154 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSlot: 31155 for _, v := range fpaov.values.([]string) { 31156 values = append(values, v) 31157 } 31158 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorSizeBytes: 31159 for _, v := range fpaov.values.([]int64) { 31160 values = append(values, v) 31161 } 31162 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorFrequencyHz: 31163 for _, v := range fpaov.values.([]int64) { 31164 values = append(values, v) 31165 } 31166 case DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldPathSelectorWidthBits: 31167 for _, v := range fpaov.values.([]int32) { 31168 values = append(values, v) 31169 } 31170 } 31171 return 31172 } 31173 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 31174 res, ok := fpaov.values.([]string) 31175 return res, ok 31176 } 31177 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsProductArrayOfValues() ([]string, bool) { 31178 res, ok := fpaov.values.([]string) 31179 return res, ok 31180 } 31181 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsVendorArrayOfValues() ([]string, bool) { 31182 res, ok := fpaov.values.([]string) 31183 return res, ok 31184 } 31185 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsSerialArrayOfValues() ([]string, bool) { 31186 res, ok := fpaov.values.([]string) 31187 return res, ok 31188 } 31189 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsSlotArrayOfValues() ([]string, bool) { 31190 res, ok := fpaov.values.([]string) 31191 return res, ok 31192 } 31193 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsSizeBytesArrayOfValues() ([]int64, bool) { 31194 res, ok := fpaov.values.([]int64) 31195 return res, ok 31196 } 31197 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsFrequencyHzArrayOfValues() ([]int64, bool) { 31198 res, ok := fpaov.values.([]int64) 31199 return res, ok 31200 } 31201 func (fpaov *DeviceStatusDeviceInfoHardwareInformationMemoryInfoMemoryBank_FieldTerminalPathArrayOfValues) AsWidthBitsArrayOfValues() ([]int32, bool) { 31202 res, ok := fpaov.values.([]int32) 31203 return res, ok 31204 } 31205 31206 // FieldPath provides implementation to handle 31207 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 31208 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath interface { 31209 gotenobject.FieldPath 31210 Selector() DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector 31211 Get(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) []interface{} 31212 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) (interface{}, bool) 31213 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 31214 31215 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue 31216 // (or array of values) and holds passed value. Panics if injected type is incorrect. 31217 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue 31218 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues 31219 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue 31220 } 31221 31222 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector int32 31223 31224 const ( 31225 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 0 31226 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 1 31227 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 2 31228 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 3 31229 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 4 31230 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 5 31231 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 6 31232 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 7 31233 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector = 8 31234 ) 31235 31236 func (s DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector) String() string { 31237 switch s { 31238 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31239 return "dev_id" 31240 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31241 return "control_proto_version" 31242 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31243 return "firmware_version" 31244 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31245 return "logger_version" 31246 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31247 return "board_name" 31248 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31249 return "serial_number" 31250 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31251 return "part_number" 31252 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31253 return "product_name" 31254 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31255 return "neural_network_core_clock_rate" 31256 default: 31257 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", s)) 31258 } 31259 } 31260 31261 func BuildDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath, error) { 31262 if len(fp) == 0 { 31263 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo") 31264 } 31265 if len(fp) == 1 { 31266 switch fp[0] { 31267 case "dev_id", "devId", "dev-id": 31268 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId}, nil 31269 case "control_proto_version", "controlProtoVersion", "control-proto-version": 31270 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion}, nil 31271 case "firmware_version", "firmwareVersion", "firmware-version": 31272 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion}, nil 31273 case "logger_version", "loggerVersion", "logger-version": 31274 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion}, nil 31275 case "board_name", "boardName", "board-name": 31276 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName}, nil 31277 case "serial_number", "serialNumber", "serial-number": 31278 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber}, nil 31279 case "part_number", "partNumber", "part-number": 31280 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber}, nil 31281 case "product_name", "productName", "product-name": 31282 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName}, nil 31283 case "neural_network_core_clock_rate", "neuralNetworkCoreClockRate", "neural-network-core-clock-rate": 31284 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate}, nil 31285 } 31286 } 31287 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo", fp) 31288 } 31289 31290 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath, error) { 31291 fp, err := gotenobject.ParseRawFieldPath(rawField) 31292 if err != nil { 31293 return nil, err 31294 } 31295 return BuildDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(fp) 31296 } 31297 31298 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath { 31299 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(rawField) 31300 if err != nil { 31301 panic(err) 31302 } 31303 return fp 31304 } 31305 31306 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath struct { 31307 selector DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector 31308 } 31309 31310 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath)(nil) 31311 31312 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelector { 31313 return fp.selector 31314 } 31315 31316 // String returns path representation in proto convention 31317 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) String() string { 31318 return fp.selector.String() 31319 } 31320 31321 // JSONString returns path representation is JSON convention 31322 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) JSONString() string { 31323 return strcase.ToLowerCamel(fp.String()) 31324 } 31325 31326 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo 31327 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) (values []interface{}) { 31328 if source != nil { 31329 switch fp.selector { 31330 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31331 values = append(values, source.DevId) 31332 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31333 values = append(values, source.ControlProtoVersion) 31334 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31335 values = append(values, source.FirmwareVersion) 31336 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31337 values = append(values, source.LoggerVersion) 31338 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31339 values = append(values, source.BoardName) 31340 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31341 values = append(values, source.SerialNumber) 31342 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31343 values = append(values, source.PartNumber) 31344 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31345 values = append(values, source.ProductName) 31346 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31347 values = append(values, source.NeuralNetworkCoreClockRate) 31348 default: 31349 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31350 } 31351 } 31352 return 31353 } 31354 31355 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 31356 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 31357 } 31358 31359 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo 31360 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) (interface{}, bool) { 31361 switch fp.selector { 31362 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31363 return source.GetDevId(), source != nil 31364 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31365 return source.GetControlProtoVersion(), source != nil 31366 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31367 return source.GetFirmwareVersion(), source != nil 31368 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31369 return source.GetLoggerVersion(), source != nil 31370 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31371 return source.GetBoardName(), source != nil 31372 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31373 return source.GetSerialNumber(), source != nil 31374 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31375 return source.GetPartNumber(), source != nil 31376 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31377 return source.GetProductName(), source != nil 31378 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31379 return source.GetNeuralNetworkCoreClockRate(), source != nil 31380 default: 31381 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31382 } 31383 } 31384 31385 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 31386 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 31387 } 31388 31389 // GetDefault returns a default value of the field type 31390 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) GetDefault() interface{} { 31391 switch fp.selector { 31392 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31393 return "" 31394 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31395 return "" 31396 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31397 return "" 31398 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31399 return "" 31400 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31401 return "" 31402 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31403 return "" 31404 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31405 return "" 31406 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31407 return "" 31408 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31409 return "" 31410 default: 31411 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31412 } 31413 } 31414 31415 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) { 31416 if item != nil { 31417 switch fp.selector { 31418 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31419 item.DevId = "" 31420 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31421 item.ControlProtoVersion = "" 31422 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31423 item.FirmwareVersion = "" 31424 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31425 item.LoggerVersion = "" 31426 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31427 item.BoardName = "" 31428 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31429 item.SerialNumber = "" 31430 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31431 item.PartNumber = "" 31432 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31433 item.ProductName = "" 31434 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31435 item.NeuralNetworkCoreClockRate = "" 31436 default: 31437 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31438 } 31439 } 31440 } 31441 31442 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 31443 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 31444 } 31445 31446 // IsLeaf - whether field path is holds simple value 31447 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) IsLeaf() bool { 31448 return fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId || 31449 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion || 31450 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion || 31451 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion || 31452 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName || 31453 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber || 31454 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber || 31455 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName || 31456 fp.selector == DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate 31457 } 31458 31459 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 31460 return []gotenobject.FieldPath{fp} 31461 } 31462 31463 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue { 31464 switch fp.selector { 31465 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31466 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31467 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31468 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31469 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31470 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31471 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31472 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31473 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31474 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31475 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31476 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31477 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31478 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31479 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31480 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31481 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31482 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, value: value.(string)} 31483 default: 31484 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31485 } 31486 } 31487 31488 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 31489 return fp.WithIValue(value) 31490 } 31491 31492 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues { 31493 fpaov := &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp} 31494 switch fp.selector { 31495 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31496 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31497 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31498 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31499 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31500 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31501 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31502 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31503 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31504 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31505 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31506 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31507 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31508 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31509 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31510 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31511 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31512 return &DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath: *fp, values: values.([]string)} 31513 default: 31514 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31515 } 31516 return fpaov 31517 } 31518 31519 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 31520 return fp.WithIArrayOfValues(values) 31521 } 31522 31523 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue { 31524 switch fp.selector { 31525 default: 31526 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fp.selector)) 31527 } 31528 } 31529 31530 func (fp *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 31531 return fp.WithIArrayItemValue(value) 31532 } 31533 31534 // DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue allows storing values for HailoModuleInfo fields according to their type 31535 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue interface { 31536 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath 31537 gotenobject.FieldPathValue 31538 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 31539 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) (cmp int, comparable bool) 31540 } 31541 31542 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue, error) { 31543 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(pathStr) 31544 if err != nil { 31545 return nil, err 31546 } 31547 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 31548 if err != nil { 31549 return nil, status.Errorf(codes.InvalidArgument, "error parsing HailoModuleInfo field path value from %s: %v", valueStr, err) 31550 } 31551 return fpv.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue), nil 31552 } 31553 31554 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue { 31555 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue(pathStr, valueStr) 31556 if err != nil { 31557 panic(err) 31558 } 31559 return fpv 31560 } 31561 31562 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue struct { 31563 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath 31564 value interface{} 31565 } 31566 31567 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue)(nil) 31568 31569 // GetRawValue returns raw value stored under selected path for 'HailoModuleInfo' as interface{} 31570 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) GetRawValue() interface{} { 31571 return fpv.value 31572 } 31573 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsDevIdValue() (string, bool) { 31574 res, ok := fpv.value.(string) 31575 return res, ok 31576 } 31577 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsControlProtoVersionValue() (string, bool) { 31578 res, ok := fpv.value.(string) 31579 return res, ok 31580 } 31581 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsFirmwareVersionValue() (string, bool) { 31582 res, ok := fpv.value.(string) 31583 return res, ok 31584 } 31585 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsLoggerVersionValue() (string, bool) { 31586 res, ok := fpv.value.(string) 31587 return res, ok 31588 } 31589 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsBoardNameValue() (string, bool) { 31590 res, ok := fpv.value.(string) 31591 return res, ok 31592 } 31593 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsSerialNumberValue() (string, bool) { 31594 res, ok := fpv.value.(string) 31595 return res, ok 31596 } 31597 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsPartNumberValue() (string, bool) { 31598 res, ok := fpv.value.(string) 31599 return res, ok 31600 } 31601 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsProductNameValue() (string, bool) { 31602 res, ok := fpv.value.(string) 31603 return res, ok 31604 } 31605 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) AsNeuralNetworkCoreClockRateValue() (string, bool) { 31606 res, ok := fpv.value.(string) 31607 return res, ok 31608 } 31609 31610 // SetTo stores value for selected field for object HailoModuleInfo 31611 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) { 31612 if *target == nil { 31613 *target = new(Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 31614 } 31615 switch fpv.selector { 31616 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31617 (*target).DevId = fpv.value.(string) 31618 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31619 (*target).ControlProtoVersion = fpv.value.(string) 31620 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31621 (*target).FirmwareVersion = fpv.value.(string) 31622 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31623 (*target).LoggerVersion = fpv.value.(string) 31624 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31625 (*target).BoardName = fpv.value.(string) 31626 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31627 (*target).SerialNumber = fpv.value.(string) 31628 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31629 (*target).PartNumber = fpv.value.(string) 31630 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31631 (*target).ProductName = fpv.value.(string) 31632 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31633 (*target).NeuralNetworkCoreClockRate = fpv.value.(string) 31634 default: 31635 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fpv.selector)) 31636 } 31637 } 31638 31639 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 31640 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) 31641 fpv.SetTo(&typedObject) 31642 } 31643 31644 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo'. 31645 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) (int, bool) { 31646 switch fpv.selector { 31647 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31648 leftValue := fpv.value.(string) 31649 rightValue := source.GetDevId() 31650 if (leftValue) == (rightValue) { 31651 return 0, true 31652 } else if (leftValue) < (rightValue) { 31653 return -1, true 31654 } else { 31655 return 1, true 31656 } 31657 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31658 leftValue := fpv.value.(string) 31659 rightValue := source.GetControlProtoVersion() 31660 if (leftValue) == (rightValue) { 31661 return 0, true 31662 } else if (leftValue) < (rightValue) { 31663 return -1, true 31664 } else { 31665 return 1, true 31666 } 31667 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31668 leftValue := fpv.value.(string) 31669 rightValue := source.GetFirmwareVersion() 31670 if (leftValue) == (rightValue) { 31671 return 0, true 31672 } else if (leftValue) < (rightValue) { 31673 return -1, true 31674 } else { 31675 return 1, true 31676 } 31677 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31678 leftValue := fpv.value.(string) 31679 rightValue := source.GetLoggerVersion() 31680 if (leftValue) == (rightValue) { 31681 return 0, true 31682 } else if (leftValue) < (rightValue) { 31683 return -1, true 31684 } else { 31685 return 1, true 31686 } 31687 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31688 leftValue := fpv.value.(string) 31689 rightValue := source.GetBoardName() 31690 if (leftValue) == (rightValue) { 31691 return 0, true 31692 } else if (leftValue) < (rightValue) { 31693 return -1, true 31694 } else { 31695 return 1, true 31696 } 31697 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31698 leftValue := fpv.value.(string) 31699 rightValue := source.GetSerialNumber() 31700 if (leftValue) == (rightValue) { 31701 return 0, true 31702 } else if (leftValue) < (rightValue) { 31703 return -1, true 31704 } else { 31705 return 1, true 31706 } 31707 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31708 leftValue := fpv.value.(string) 31709 rightValue := source.GetPartNumber() 31710 if (leftValue) == (rightValue) { 31711 return 0, true 31712 } else if (leftValue) < (rightValue) { 31713 return -1, true 31714 } else { 31715 return 1, true 31716 } 31717 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31718 leftValue := fpv.value.(string) 31719 rightValue := source.GetProductName() 31720 if (leftValue) == (rightValue) { 31721 return 0, true 31722 } else if (leftValue) < (rightValue) { 31723 return -1, true 31724 } else { 31725 return 1, true 31726 } 31727 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31728 leftValue := fpv.value.(string) 31729 rightValue := source.GetNeuralNetworkCoreClockRate() 31730 if (leftValue) == (rightValue) { 31731 return 0, true 31732 } else if (leftValue) < (rightValue) { 31733 return -1, true 31734 } else { 31735 return 1, true 31736 } 31737 default: 31738 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo: %d", fpv.selector)) 31739 } 31740 } 31741 31742 func (fpv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 31743 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 31744 } 31745 31746 // DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for HailoModuleInfo according to their type 31747 // Present only for array (repeated) types. 31748 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue interface { 31749 gotenobject.FieldPathArrayItemValue 31750 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath 31751 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) bool 31752 } 31753 31754 // ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 31755 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue, error) { 31756 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(pathStr) 31757 if err != nil { 31758 return nil, err 31759 } 31760 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 31761 if err != nil { 31762 return nil, status.Errorf(codes.InvalidArgument, "error parsing HailoModuleInfo field path array item value from %s: %v", valueStr, err) 31763 } 31764 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue), nil 31765 } 31766 31767 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue { 31768 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue(pathStr, valueStr) 31769 if err != nil { 31770 panic(err) 31771 } 31772 return fpaiv 31773 } 31774 31775 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayItemValue struct { 31776 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath 31777 value interface{} 31778 } 31779 31780 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayItemValue)(nil) 31781 31782 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo as interface{} 31783 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 31784 return fpaiv.value 31785 } 31786 31787 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) (interface{}, bool) { 31788 return nil, false 31789 } 31790 31791 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 31792 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo)) 31793 } 31794 31795 // Contains returns a boolean indicating if value that is being held is present in given 'HailoModuleInfo' 31796 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_HailoInfo_HailoModuleInfo) bool { 31797 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath.Get(source) 31798 for _, v := range slice { 31799 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 31800 if proto.Equal(asProtoMsg, v.(proto.Message)) { 31801 return true 31802 } 31803 } else if reflect.DeepEqual(v, fpaiv.value) { 31804 return true 31805 } 31806 } 31807 return false 31808 } 31809 31810 // DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues allows storing slice of values for HailoModuleInfo fields according to their type 31811 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues interface { 31812 gotenobject.FieldPathArrayOfValues 31813 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath 31814 } 31815 31816 func ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues, error) { 31817 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPath(pathStr) 31818 if err != nil { 31819 return nil, err 31820 } 31821 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 31822 if err != nil { 31823 return nil, status.Errorf(codes.InvalidArgument, "error parsing HailoModuleInfo field path array of values from %s: %v", valuesStr, err) 31824 } 31825 return fpaov.(DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues), nil 31826 } 31827 31828 func MustParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues { 31829 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues(pathStr, valuesStr) 31830 if err != nil { 31831 panic(err) 31832 } 31833 return fpaov 31834 } 31835 31836 type DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues struct { 31837 DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPath 31838 values interface{} 31839 } 31840 31841 var _ DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues)(nil) 31842 31843 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 31844 switch fpaov.selector { 31845 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorDevId: 31846 for _, v := range fpaov.values.([]string) { 31847 values = append(values, v) 31848 } 31849 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorControlProtoVersion: 31850 for _, v := range fpaov.values.([]string) { 31851 values = append(values, v) 31852 } 31853 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorFirmwareVersion: 31854 for _, v := range fpaov.values.([]string) { 31855 values = append(values, v) 31856 } 31857 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorLoggerVersion: 31858 for _, v := range fpaov.values.([]string) { 31859 values = append(values, v) 31860 } 31861 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorBoardName: 31862 for _, v := range fpaov.values.([]string) { 31863 values = append(values, v) 31864 } 31865 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorSerialNumber: 31866 for _, v := range fpaov.values.([]string) { 31867 values = append(values, v) 31868 } 31869 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorPartNumber: 31870 for _, v := range fpaov.values.([]string) { 31871 values = append(values, v) 31872 } 31873 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorProductName: 31874 for _, v := range fpaov.values.([]string) { 31875 values = append(values, v) 31876 } 31877 case DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldPathSelectorNeuralNetworkCoreClockRate: 31878 for _, v := range fpaov.values.([]string) { 31879 values = append(values, v) 31880 } 31881 } 31882 return 31883 } 31884 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsDevIdArrayOfValues() ([]string, bool) { 31885 res, ok := fpaov.values.([]string) 31886 return res, ok 31887 } 31888 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsControlProtoVersionArrayOfValues() ([]string, bool) { 31889 res, ok := fpaov.values.([]string) 31890 return res, ok 31891 } 31892 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsFirmwareVersionArrayOfValues() ([]string, bool) { 31893 res, ok := fpaov.values.([]string) 31894 return res, ok 31895 } 31896 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsLoggerVersionArrayOfValues() ([]string, bool) { 31897 res, ok := fpaov.values.([]string) 31898 return res, ok 31899 } 31900 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsBoardNameArrayOfValues() ([]string, bool) { 31901 res, ok := fpaov.values.([]string) 31902 return res, ok 31903 } 31904 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsSerialNumberArrayOfValues() ([]string, bool) { 31905 res, ok := fpaov.values.([]string) 31906 return res, ok 31907 } 31908 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsPartNumberArrayOfValues() ([]string, bool) { 31909 res, ok := fpaov.values.([]string) 31910 return res, ok 31911 } 31912 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsProductNameArrayOfValues() ([]string, bool) { 31913 res, ok := fpaov.values.([]string) 31914 return res, ok 31915 } 31916 func (fpaov *DeviceStatusDeviceInfoHardwareInformationHailoInfoHailoModuleInfo_FieldTerminalPathArrayOfValues) AsNeuralNetworkCoreClockRateArrayOfValues() ([]string, bool) { 31917 res, ok := fpaov.values.([]string) 31918 return res, ok 31919 } 31920 31921 // FieldPath provides implementation to handle 31922 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 31923 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath interface { 31924 gotenobject.FieldPath 31925 Selector() DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector 31926 Get(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) []interface{} 31927 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) (interface{}, bool) 31928 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 31929 31930 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue 31931 // (or array of values) and holds passed value. Panics if injected type is incorrect. 31932 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue 31933 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues 31934 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue 31935 } 31936 31937 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector int32 31938 31939 const ( 31940 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector = 0 31941 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector = 1 31942 ) 31943 31944 func (s DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector) String() string { 31945 switch s { 31946 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 31947 return "id" 31948 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 31949 return "product_name" 31950 default: 31951 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", s)) 31952 } 31953 } 31954 31955 func BuildDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath, error) { 31956 if len(fp) == 0 { 31957 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo") 31958 } 31959 if len(fp) == 1 { 31960 switch fp[0] { 31961 case "id": 31962 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId}, nil 31963 case "product_name", "productName", "product-name": 31964 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName}, nil 31965 } 31966 } 31967 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo", fp) 31968 } 31969 31970 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath, error) { 31971 fp, err := gotenobject.ParseRawFieldPath(rawField) 31972 if err != nil { 31973 return nil, err 31974 } 31975 return BuildDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(fp) 31976 } 31977 31978 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath { 31979 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(rawField) 31980 if err != nil { 31981 panic(err) 31982 } 31983 return fp 31984 } 31985 31986 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath struct { 31987 selector DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector 31988 } 31989 31990 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath)(nil) 31991 31992 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelector { 31993 return fp.selector 31994 } 31995 31996 // String returns path representation in proto convention 31997 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) String() string { 31998 return fp.selector.String() 31999 } 32000 32001 // JSONString returns path representation is JSON convention 32002 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) JSONString() string { 32003 return strcase.ToLowerCamel(fp.String()) 32004 } 32005 32006 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo 32007 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) (values []interface{}) { 32008 if source != nil { 32009 switch fp.selector { 32010 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32011 values = append(values, source.Id) 32012 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32013 values = append(values, source.ProductName) 32014 default: 32015 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32016 } 32017 } 32018 return 32019 } 32020 32021 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 32022 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 32023 } 32024 32025 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo 32026 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) (interface{}, bool) { 32027 switch fp.selector { 32028 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32029 return source.GetId(), source != nil 32030 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32031 return source.GetProductName(), source != nil 32032 default: 32033 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32034 } 32035 } 32036 32037 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 32038 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 32039 } 32040 32041 // GetDefault returns a default value of the field type 32042 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) GetDefault() interface{} { 32043 switch fp.selector { 32044 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32045 return "" 32046 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32047 return "" 32048 default: 32049 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32050 } 32051 } 32052 32053 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) { 32054 if item != nil { 32055 switch fp.selector { 32056 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32057 item.Id = "" 32058 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32059 item.ProductName = "" 32060 default: 32061 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32062 } 32063 } 32064 } 32065 32066 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 32067 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 32068 } 32069 32070 // IsLeaf - whether field path is holds simple value 32071 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) IsLeaf() bool { 32072 return fp.selector == DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId || 32073 fp.selector == DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName 32074 } 32075 32076 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 32077 return []gotenobject.FieldPath{fp} 32078 } 32079 32080 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue { 32081 switch fp.selector { 32082 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32083 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: *fp, value: value.(string)} 32084 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32085 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: *fp, value: value.(string)} 32086 default: 32087 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32088 } 32089 } 32090 32091 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 32092 return fp.WithIValue(value) 32093 } 32094 32095 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues { 32096 fpaov := &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: *fp} 32097 switch fp.selector { 32098 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32099 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: *fp, values: values.([]string)} 32100 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32101 return &DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath: *fp, values: values.([]string)} 32102 default: 32103 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32104 } 32105 return fpaov 32106 } 32107 32108 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 32109 return fp.WithIArrayOfValues(values) 32110 } 32111 32112 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue { 32113 switch fp.selector { 32114 default: 32115 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fp.selector)) 32116 } 32117 } 32118 32119 func (fp *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 32120 return fp.WithIArrayItemValue(value) 32121 } 32122 32123 // DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue allows storing values for GpuInfo fields according to their type 32124 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue interface { 32125 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath 32126 gotenobject.FieldPathValue 32127 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 32128 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) (cmp int, comparable bool) 32129 } 32130 32131 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue, error) { 32132 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(pathStr) 32133 if err != nil { 32134 return nil, err 32135 } 32136 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 32137 if err != nil { 32138 return nil, status.Errorf(codes.InvalidArgument, "error parsing GpuInfo field path value from %s: %v", valueStr, err) 32139 } 32140 return fpv.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue), nil 32141 } 32142 32143 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue { 32144 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue(pathStr, valueStr) 32145 if err != nil { 32146 panic(err) 32147 } 32148 return fpv 32149 } 32150 32151 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue struct { 32152 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath 32153 value interface{} 32154 } 32155 32156 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue)(nil) 32157 32158 // GetRawValue returns raw value stored under selected path for 'GpuInfo' as interface{} 32159 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) GetRawValue() interface{} { 32160 return fpv.value 32161 } 32162 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) AsIdValue() (string, bool) { 32163 res, ok := fpv.value.(string) 32164 return res, ok 32165 } 32166 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) AsProductNameValue() (string, bool) { 32167 res, ok := fpv.value.(string) 32168 return res, ok 32169 } 32170 32171 // SetTo stores value for selected field for object GpuInfo 32172 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) { 32173 if *target == nil { 32174 *target = new(Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 32175 } 32176 switch fpv.selector { 32177 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32178 (*target).Id = fpv.value.(string) 32179 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32180 (*target).ProductName = fpv.value.(string) 32181 default: 32182 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fpv.selector)) 32183 } 32184 } 32185 32186 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 32187 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) 32188 fpv.SetTo(&typedObject) 32189 } 32190 32191 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo'. 32192 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) (int, bool) { 32193 switch fpv.selector { 32194 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32195 leftValue := fpv.value.(string) 32196 rightValue := source.GetId() 32197 if (leftValue) == (rightValue) { 32198 return 0, true 32199 } else if (leftValue) < (rightValue) { 32200 return -1, true 32201 } else { 32202 return 1, true 32203 } 32204 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32205 leftValue := fpv.value.(string) 32206 rightValue := source.GetProductName() 32207 if (leftValue) == (rightValue) { 32208 return 0, true 32209 } else if (leftValue) < (rightValue) { 32210 return -1, true 32211 } else { 32212 return 1, true 32213 } 32214 default: 32215 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo: %d", fpv.selector)) 32216 } 32217 } 32218 32219 func (fpv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 32220 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 32221 } 32222 32223 // DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for GpuInfo according to their type 32224 // Present only for array (repeated) types. 32225 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue interface { 32226 gotenobject.FieldPathArrayItemValue 32227 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath 32228 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) bool 32229 } 32230 32231 // ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 32232 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue, error) { 32233 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(pathStr) 32234 if err != nil { 32235 return nil, err 32236 } 32237 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 32238 if err != nil { 32239 return nil, status.Errorf(codes.InvalidArgument, "error parsing GpuInfo field path array item value from %s: %v", valueStr, err) 32240 } 32241 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue), nil 32242 } 32243 32244 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue { 32245 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue(pathStr, valueStr) 32246 if err != nil { 32247 panic(err) 32248 } 32249 return fpaiv 32250 } 32251 32252 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayItemValue struct { 32253 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath 32254 value interface{} 32255 } 32256 32257 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayItemValue)(nil) 32258 32259 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo as interface{} 32260 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 32261 return fpaiv.value 32262 } 32263 32264 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) (interface{}, bool) { 32265 return nil, false 32266 } 32267 32268 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 32269 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo)) 32270 } 32271 32272 // Contains returns a boolean indicating if value that is being held is present in given 'GpuInfo' 32273 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_NvidiaInfo_GpuInfo) bool { 32274 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath.Get(source) 32275 for _, v := range slice { 32276 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 32277 if proto.Equal(asProtoMsg, v.(proto.Message)) { 32278 return true 32279 } 32280 } else if reflect.DeepEqual(v, fpaiv.value) { 32281 return true 32282 } 32283 } 32284 return false 32285 } 32286 32287 // DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues allows storing slice of values for GpuInfo fields according to their type 32288 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues interface { 32289 gotenobject.FieldPathArrayOfValues 32290 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath 32291 } 32292 32293 func ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues, error) { 32294 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPath(pathStr) 32295 if err != nil { 32296 return nil, err 32297 } 32298 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 32299 if err != nil { 32300 return nil, status.Errorf(codes.InvalidArgument, "error parsing GpuInfo field path array of values from %s: %v", valuesStr, err) 32301 } 32302 return fpaov.(DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues), nil 32303 } 32304 32305 func MustParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues { 32306 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues(pathStr, valuesStr) 32307 if err != nil { 32308 panic(err) 32309 } 32310 return fpaov 32311 } 32312 32313 type DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues struct { 32314 DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPath 32315 values interface{} 32316 } 32317 32318 var _ DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues)(nil) 32319 32320 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 32321 switch fpaov.selector { 32322 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorId: 32323 for _, v := range fpaov.values.([]string) { 32324 values = append(values, v) 32325 } 32326 case DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldPathSelectorProductName: 32327 for _, v := range fpaov.values.([]string) { 32328 values = append(values, v) 32329 } 32330 } 32331 return 32332 } 32333 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues) AsIdArrayOfValues() ([]string, bool) { 32334 res, ok := fpaov.values.([]string) 32335 return res, ok 32336 } 32337 func (fpaov *DeviceStatusDeviceInfoHardwareInformationNvidiaInfoGpuInfo_FieldTerminalPathArrayOfValues) AsProductNameArrayOfValues() ([]string, bool) { 32338 res, ok := fpaov.values.([]string) 32339 return res, ok 32340 } 32341 32342 // FieldPath provides implementation to handle 32343 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 32344 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath interface { 32345 gotenobject.FieldPath 32346 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector 32347 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) []interface{} 32348 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) (interface{}, bool) 32349 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 32350 32351 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue 32352 // (or array of values) and holds passed value. Panics if injected type is incorrect. 32353 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue 32354 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues 32355 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue 32356 } 32357 32358 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector int32 32359 32360 const ( 32361 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector = 0 32362 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector = 1 32363 ) 32364 32365 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector) String() string { 32366 switch s { 32367 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32368 return "drx_cycle" 32369 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32370 return "mico_mode" 32371 default: 32372 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", s)) 32373 } 32374 } 32375 32376 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath, error) { 32377 if len(fp) == 0 { 32378 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings") 32379 } 32380 if len(fp) == 1 { 32381 switch fp[0] { 32382 case "drx_cycle", "drxCycle", "drx-cycle": 32383 return &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle}, nil 32384 case "mico_mode", "micoMode", "mico-mode": 32385 return &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode}, nil 32386 } 32387 } 32388 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings", fp) 32389 } 32390 32391 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath, error) { 32392 fp, err := gotenobject.ParseRawFieldPath(rawField) 32393 if err != nil { 32394 return nil, err 32395 } 32396 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(fp) 32397 } 32398 32399 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath { 32400 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(rawField) 32401 if err != nil { 32402 panic(err) 32403 } 32404 return fp 32405 } 32406 32407 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath struct { 32408 selector DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector 32409 } 32410 32411 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath)(nil) 32412 32413 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelector { 32414 return fp.selector 32415 } 32416 32417 // String returns path representation in proto convention 32418 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) String() string { 32419 return fp.selector.String() 32420 } 32421 32422 // JSONString returns path representation is JSON convention 32423 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) JSONString() string { 32424 return strcase.ToLowerCamel(fp.String()) 32425 } 32426 32427 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings 32428 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) (values []interface{}) { 32429 if source != nil { 32430 switch fp.selector { 32431 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32432 values = append(values, source.DrxCycle) 32433 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32434 values = append(values, source.MicoMode) 32435 default: 32436 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32437 } 32438 } 32439 return 32440 } 32441 32442 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 32443 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 32444 } 32445 32446 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings 32447 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) (interface{}, bool) { 32448 switch fp.selector { 32449 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32450 return source.GetDrxCycle(), source != nil 32451 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32452 return source.GetMicoMode(), source != nil 32453 default: 32454 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32455 } 32456 } 32457 32458 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 32459 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 32460 } 32461 32462 // GetDefault returns a default value of the field type 32463 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) GetDefault() interface{} { 32464 switch fp.selector { 32465 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32466 return "" 32467 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32468 return "" 32469 default: 32470 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32471 } 32472 } 32473 32474 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) { 32475 if item != nil { 32476 switch fp.selector { 32477 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32478 item.DrxCycle = "" 32479 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32480 item.MicoMode = "" 32481 default: 32482 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32483 } 32484 } 32485 } 32486 32487 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) ClearValueRaw(item proto.Message) { 32488 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 32489 } 32490 32491 // IsLeaf - whether field path is holds simple value 32492 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) IsLeaf() bool { 32493 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle || 32494 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode 32495 } 32496 32497 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 32498 return []gotenobject.FieldPath{fp} 32499 } 32500 32501 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue { 32502 switch fp.selector { 32503 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32504 return &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: *fp, value: value.(string)} 32505 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32506 return &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: *fp, value: value.(string)} 32507 default: 32508 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32509 } 32510 } 32511 32512 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 32513 return fp.WithIValue(value) 32514 } 32515 32516 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues { 32517 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: *fp} 32518 switch fp.selector { 32519 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32520 return &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: *fp, values: values.([]string)} 32521 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32522 return &DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath: *fp, values: values.([]string)} 32523 default: 32524 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32525 } 32526 return fpaov 32527 } 32528 32529 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 32530 return fp.WithIArrayOfValues(values) 32531 } 32532 32533 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue { 32534 switch fp.selector { 32535 default: 32536 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fp.selector)) 32537 } 32538 } 32539 32540 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 32541 return fp.WithIArrayItemValue(value) 32542 } 32543 32544 // DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue allows storing values for RegistrationSettings fields according to their type 32545 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue interface { 32546 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath 32547 gotenobject.FieldPathValue 32548 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 32549 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) (cmp int, comparable bool) 32550 } 32551 32552 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue, error) { 32553 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(pathStr) 32554 if err != nil { 32555 return nil, err 32556 } 32557 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 32558 if err != nil { 32559 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegistrationSettings field path value from %s: %v", valueStr, err) 32560 } 32561 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue), nil 32562 } 32563 32564 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue { 32565 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue(pathStr, valueStr) 32566 if err != nil { 32567 panic(err) 32568 } 32569 return fpv 32570 } 32571 32572 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue struct { 32573 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath 32574 value interface{} 32575 } 32576 32577 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue)(nil) 32578 32579 // GetRawValue returns raw value stored under selected path for 'RegistrationSettings' as interface{} 32580 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) GetRawValue() interface{} { 32581 return fpv.value 32582 } 32583 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) AsDrxCycleValue() (string, bool) { 32584 res, ok := fpv.value.(string) 32585 return res, ok 32586 } 32587 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) AsMicoModeValue() (string, bool) { 32588 res, ok := fpv.value.(string) 32589 return res, ok 32590 } 32591 32592 // SetTo stores value for selected field for object RegistrationSettings 32593 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) { 32594 if *target == nil { 32595 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 32596 } 32597 switch fpv.selector { 32598 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32599 (*target).DrxCycle = fpv.value.(string) 32600 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32601 (*target).MicoMode = fpv.value.(string) 32602 default: 32603 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fpv.selector)) 32604 } 32605 } 32606 32607 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) SetToRaw(target proto.Message) { 32608 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 32609 fpv.SetTo(&typedObject) 32610 } 32611 32612 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings'. 32613 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) (int, bool) { 32614 switch fpv.selector { 32615 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32616 leftValue := fpv.value.(string) 32617 rightValue := source.GetDrxCycle() 32618 if (leftValue) == (rightValue) { 32619 return 0, true 32620 } else if (leftValue) < (rightValue) { 32621 return -1, true 32622 } else { 32623 return 1, true 32624 } 32625 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32626 leftValue := fpv.value.(string) 32627 rightValue := source.GetMicoMode() 32628 if (leftValue) == (rightValue) { 32629 return 0, true 32630 } else if (leftValue) < (rightValue) { 32631 return -1, true 32632 } else { 32633 return 1, true 32634 } 32635 default: 32636 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings: %d", fpv.selector)) 32637 } 32638 } 32639 32640 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 32641 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 32642 } 32643 32644 // DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue allows storing single item in Path-specific values for RegistrationSettings according to their type 32645 // Present only for array (repeated) types. 32646 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue interface { 32647 gotenobject.FieldPathArrayItemValue 32648 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath 32649 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) bool 32650 } 32651 32652 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 32653 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue, error) { 32654 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(pathStr) 32655 if err != nil { 32656 return nil, err 32657 } 32658 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 32659 if err != nil { 32660 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegistrationSettings field path array item value from %s: %v", valueStr, err) 32661 } 32662 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue), nil 32663 } 32664 32665 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue { 32666 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue(pathStr, valueStr) 32667 if err != nil { 32668 panic(err) 32669 } 32670 return fpaiv 32671 } 32672 32673 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayItemValue struct { 32674 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath 32675 value interface{} 32676 } 32677 32678 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayItemValue)(nil) 32679 32680 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings as interface{} 32681 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 32682 return fpaiv.value 32683 } 32684 32685 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) (interface{}, bool) { 32686 return nil, false 32687 } 32688 32689 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 32690 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)) 32691 } 32692 32693 // Contains returns a boolean indicating if value that is being held is present in given 'RegistrationSettings' 32694 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) bool { 32695 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath.Get(source) 32696 for _, v := range slice { 32697 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 32698 if proto.Equal(asProtoMsg, v.(proto.Message)) { 32699 return true 32700 } 32701 } else if reflect.DeepEqual(v, fpaiv.value) { 32702 return true 32703 } 32704 } 32705 return false 32706 } 32707 32708 // DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues allows storing slice of values for RegistrationSettings fields according to their type 32709 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues interface { 32710 gotenobject.FieldPathArrayOfValues 32711 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath 32712 } 32713 32714 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues, error) { 32715 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(pathStr) 32716 if err != nil { 32717 return nil, err 32718 } 32719 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 32720 if err != nil { 32721 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegistrationSettings field path array of values from %s: %v", valuesStr, err) 32722 } 32723 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues), nil 32724 } 32725 32726 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues { 32727 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues(pathStr, valuesStr) 32728 if err != nil { 32729 panic(err) 32730 } 32731 return fpaov 32732 } 32733 32734 type DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues struct { 32735 DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPath 32736 values interface{} 32737 } 32738 32739 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues)(nil) 32740 32741 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 32742 switch fpaov.selector { 32743 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorDrxCycle: 32744 for _, v := range fpaov.values.([]string) { 32745 values = append(values, v) 32746 } 32747 case DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathSelectorMicoMode: 32748 for _, v := range fpaov.values.([]string) { 32749 values = append(values, v) 32750 } 32751 } 32752 return 32753 } 32754 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues) AsDrxCycleArrayOfValues() ([]string, bool) { 32755 res, ok := fpaov.values.([]string) 32756 return res, ok 32757 } 32758 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldTerminalPathArrayOfValues) AsMicoModeArrayOfValues() ([]string, bool) { 32759 res, ok := fpaov.values.([]string) 32760 return res, ok 32761 } 32762 32763 // FieldPath provides implementation to handle 32764 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 32765 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath interface { 32766 gotenobject.FieldPath 32767 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector 32768 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) []interface{} 32769 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (interface{}, bool) 32770 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 32771 32772 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue 32773 // (or array of values) and holds passed value. Panics if injected type is incorrect. 32774 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue 32775 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues 32776 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue 32777 } 32778 32779 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector int32 32780 32781 const ( 32782 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector = 0 32783 ) 32784 32785 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector) String() string { 32786 switch s { 32787 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32788 return "registration_settings" 32789 default: 32790 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", s)) 32791 } 32792 } 32793 32794 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath, error) { 32795 if len(fp) == 0 { 32796 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr") 32797 } 32798 if len(fp) == 1 { 32799 switch fp[0] { 32800 case "registration_settings", "registrationSettings", "registration-settings": 32801 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings}, nil 32802 } 32803 } else { 32804 switch fp[0] { 32805 case "registration_settings", "registrationSettings", "registration-settings": 32806 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath(fp[1:]); err != nil { 32807 return nil, err 32808 } else { 32809 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings, subPath: subpath}, nil 32810 } 32811 } 32812 } 32813 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr", fp) 32814 } 32815 32816 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath, error) { 32817 fp, err := gotenobject.ParseRawFieldPath(rawField) 32818 if err != nil { 32819 return nil, err 32820 } 32821 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(fp) 32822 } 32823 32824 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath { 32825 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(rawField) 32826 if err != nil { 32827 panic(err) 32828 } 32829 return fp 32830 } 32831 32832 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath struct { 32833 selector DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector 32834 } 32835 32836 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath)(nil) 32837 32838 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector { 32839 return fp.selector 32840 } 32841 32842 // String returns path representation in proto convention 32843 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) String() string { 32844 return fp.selector.String() 32845 } 32846 32847 // JSONString returns path representation is JSON convention 32848 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) JSONString() string { 32849 return strcase.ToLowerCamel(fp.String()) 32850 } 32851 32852 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr 32853 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (values []interface{}) { 32854 if source != nil { 32855 switch fp.selector { 32856 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32857 if source.RegistrationSettings != nil { 32858 values = append(values, source.RegistrationSettings) 32859 } 32860 default: 32861 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32862 } 32863 } 32864 return 32865 } 32866 32867 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 32868 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 32869 } 32870 32871 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr 32872 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (interface{}, bool) { 32873 switch fp.selector { 32874 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32875 res := source.GetRegistrationSettings() 32876 return res, res != nil 32877 default: 32878 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32879 } 32880 } 32881 32882 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 32883 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 32884 } 32885 32886 // GetDefault returns a default value of the field type 32887 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) GetDefault() interface{} { 32888 switch fp.selector { 32889 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32890 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)(nil) 32891 default: 32892 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32893 } 32894 } 32895 32896 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) { 32897 if item != nil { 32898 switch fp.selector { 32899 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32900 item.RegistrationSettings = nil 32901 default: 32902 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32903 } 32904 } 32905 } 32906 32907 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) ClearValueRaw(item proto.Message) { 32908 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 32909 } 32910 32911 // IsLeaf - whether field path is holds simple value 32912 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) IsLeaf() bool { 32913 return false 32914 } 32915 32916 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 32917 return []gotenobject.FieldPath{fp} 32918 } 32919 32920 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue { 32921 switch fp.selector { 32922 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32923 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)} 32924 default: 32925 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32926 } 32927 } 32928 32929 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 32930 return fp.WithIValue(value) 32931 } 32932 32933 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues { 32934 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath: *fp} 32935 switch fp.selector { 32936 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32937 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings)} 32938 default: 32939 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32940 } 32941 return fpaov 32942 } 32943 32944 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 32945 return fp.WithIArrayOfValues(values) 32946 } 32947 32948 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue { 32949 switch fp.selector { 32950 default: 32951 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fp.selector)) 32952 } 32953 } 32954 32955 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 32956 return fp.WithIArrayItemValue(value) 32957 } 32958 32959 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath struct { 32960 selector DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector 32961 subPath gotenobject.FieldPath 32962 } 32963 32964 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath)(nil) 32965 32966 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelector { 32967 return fps.selector 32968 } 32969 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) AsRegistrationSettingsSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath, bool) { 32970 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPath) 32971 return res, ok 32972 } 32973 32974 // String returns path representation in proto convention 32975 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) String() string { 32976 return fps.selector.String() + "." + fps.subPath.String() 32977 } 32978 32979 // JSONString returns path representation is JSON convention 32980 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) JSONString() string { 32981 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 32982 } 32983 32984 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr 32985 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (values []interface{}) { 32986 switch fps.selector { 32987 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 32988 values = append(values, fps.subPath.GetRaw(source.GetRegistrationSettings())...) 32989 default: 32990 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fps.selector)) 32991 } 32992 return 32993 } 32994 32995 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) GetRaw(source proto.Message) []interface{} { 32996 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 32997 } 32998 32999 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr 33000 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (interface{}, bool) { 33001 switch fps.selector { 33002 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33003 if source.GetRegistrationSettings() == nil { 33004 return nil, false 33005 } 33006 return fps.subPath.GetSingleRaw(source.GetRegistrationSettings()) 33007 default: 33008 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fps.selector)) 33009 } 33010 } 33011 33012 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 33013 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 33014 } 33015 33016 // GetDefault returns a default value of the field type 33017 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) GetDefault() interface{} { 33018 return fps.subPath.GetDefault() 33019 } 33020 33021 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) { 33022 if item != nil { 33023 switch fps.selector { 33024 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33025 fps.subPath.ClearValueRaw(item.RegistrationSettings) 33026 default: 33027 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fps.selector)) 33028 } 33029 } 33030 } 33031 33032 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) ClearValueRaw(item proto.Message) { 33033 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 33034 } 33035 33036 // IsLeaf - whether field path is holds simple value 33037 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) IsLeaf() bool { 33038 return fps.subPath.IsLeaf() 33039 } 33040 33041 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 33042 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath{selector: fps.selector}} 33043 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 33044 return iPaths 33045 } 33046 33047 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue { 33048 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 33049 } 33050 33051 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 33052 return fps.WithIValue(value) 33053 } 33054 33055 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues { 33056 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 33057 } 33058 33059 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 33060 return fps.WithIArrayOfValues(values) 33061 } 33062 33063 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue { 33064 return &DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 33065 } 33066 33067 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 33068 return fps.WithIArrayItemValue(value) 33069 } 33070 33071 // DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue allows storing values for FiveGNr fields according to their type 33072 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue interface { 33073 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 33074 gotenobject.FieldPathValue 33075 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 33076 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (cmp int, comparable bool) 33077 } 33078 33079 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue, error) { 33080 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(pathStr) 33081 if err != nil { 33082 return nil, err 33083 } 33084 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 33085 if err != nil { 33086 return nil, status.Errorf(codes.InvalidArgument, "error parsing FiveGNr field path value from %s: %v", valueStr, err) 33087 } 33088 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue), nil 33089 } 33090 33091 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue { 33092 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue(pathStr, valueStr) 33093 if err != nil { 33094 panic(err) 33095 } 33096 return fpv 33097 } 33098 33099 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue struct { 33100 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath 33101 value interface{} 33102 } 33103 33104 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue)(nil) 33105 33106 // GetRawValue returns raw value stored under selected path for 'FiveGNr' as interface{} 33107 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue) GetRawValue() interface{} { 33108 return fpv.value 33109 } 33110 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue) AsRegistrationSettingsValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings, bool) { 33111 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 33112 return res, ok 33113 } 33114 33115 // SetTo stores value for selected field for object FiveGNr 33116 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) { 33117 if *target == nil { 33118 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 33119 } 33120 switch fpv.selector { 33121 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33122 (*target).RegistrationSettings = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 33123 default: 33124 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fpv.selector)) 33125 } 33126 } 33127 33128 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue) SetToRaw(target proto.Message) { 33129 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 33130 fpv.SetTo(&typedObject) 33131 } 33132 33133 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr'. 33134 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (int, bool) { 33135 switch fpv.selector { 33136 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33137 return 0, false 33138 default: 33139 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fpv.selector)) 33140 } 33141 } 33142 33143 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 33144 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 33145 } 33146 33147 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue struct { 33148 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 33149 subPathValue gotenobject.FieldPathValue 33150 } 33151 33152 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue)(nil) 33153 33154 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue) AsRegistrationSettingsPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue, bool) { 33155 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue) 33156 return res, ok 33157 } 33158 33159 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) { 33160 if *target == nil { 33161 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 33162 } 33163 switch fpvs.Selector() { 33164 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33165 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue).SetTo(&(*target).RegistrationSettings) 33166 default: 33167 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fpvs.Selector())) 33168 } 33169 } 33170 33171 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue) SetToRaw(target proto.Message) { 33172 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 33173 fpvs.SetTo(&typedObject) 33174 } 33175 33176 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue) GetRawValue() interface{} { 33177 return fpvs.subPathValue.GetRawValue() 33178 } 33179 33180 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (int, bool) { 33181 switch fpvs.Selector() { 33182 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33183 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathValue).CompareWith(source.GetRegistrationSettings()) 33184 default: 33185 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fpvs.Selector())) 33186 } 33187 } 33188 33189 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 33190 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 33191 } 33192 33193 // DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue allows storing single item in Path-specific values for FiveGNr according to their type 33194 // Present only for array (repeated) types. 33195 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue interface { 33196 gotenobject.FieldPathArrayItemValue 33197 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 33198 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) bool 33199 } 33200 33201 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 33202 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue, error) { 33203 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(pathStr) 33204 if err != nil { 33205 return nil, err 33206 } 33207 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 33208 if err != nil { 33209 return nil, status.Errorf(codes.InvalidArgument, "error parsing FiveGNr field path array item value from %s: %v", valueStr, err) 33210 } 33211 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue), nil 33212 } 33213 33214 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue { 33215 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue(pathStr, valueStr) 33216 if err != nil { 33217 panic(err) 33218 } 33219 return fpaiv 33220 } 33221 33222 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayItemValue struct { 33223 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath 33224 value interface{} 33225 } 33226 33227 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayItemValue)(nil) 33228 33229 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr as interface{} 33230 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 33231 return fpaiv.value 33232 } 33233 33234 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) (interface{}, bool) { 33235 return nil, false 33236 } 33237 33238 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 33239 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)) 33240 } 33241 33242 // Contains returns a boolean indicating if value that is being held is present in given 'FiveGNr' 33243 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) bool { 33244 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath.Get(source) 33245 for _, v := range slice { 33246 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 33247 if proto.Equal(asProtoMsg, v.(proto.Message)) { 33248 return true 33249 } 33250 } else if reflect.DeepEqual(v, fpaiv.value) { 33251 return true 33252 } 33253 } 33254 return false 33255 } 33256 33257 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayItemValue struct { 33258 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 33259 subPathItemValue gotenobject.FieldPathArrayItemValue 33260 } 33261 33262 // GetRawValue returns stored array item value 33263 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 33264 return fpaivs.subPathItemValue.GetRawItemValue() 33265 } 33266 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayItemValue) AsRegistrationSettingsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue, bool) { 33267 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue) 33268 return res, ok 33269 } 33270 33271 // Contains returns a boolean indicating if value that is being held is present in given 'FiveGNr' 33272 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) bool { 33273 switch fpaivs.Selector() { 33274 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33275 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayItemValue).ContainsValue(source.GetRegistrationSettings()) 33276 default: 33277 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr: %d", fpaivs.Selector())) 33278 } 33279 } 33280 33281 // DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues allows storing slice of values for FiveGNr fields according to their type 33282 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues interface { 33283 gotenobject.FieldPathArrayOfValues 33284 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 33285 } 33286 33287 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues, error) { 33288 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(pathStr) 33289 if err != nil { 33290 return nil, err 33291 } 33292 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 33293 if err != nil { 33294 return nil, status.Errorf(codes.InvalidArgument, "error parsing FiveGNr field path array of values from %s: %v", valuesStr, err) 33295 } 33296 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues), nil 33297 } 33298 33299 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues { 33300 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues(pathStr, valuesStr) 33301 if err != nil { 33302 panic(err) 33303 } 33304 return fpaov 33305 } 33306 33307 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayOfValues struct { 33308 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPath 33309 values interface{} 33310 } 33311 33312 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayOfValues)(nil) 33313 33314 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 33315 switch fpaov.selector { 33316 case DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathSelectorRegistrationSettings: 33317 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) { 33318 values = append(values, v) 33319 } 33320 } 33321 return 33322 } 33323 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldTerminalPathArrayOfValues) AsRegistrationSettingsArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings, bool) { 33324 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_RegistrationSettings) 33325 return res, ok 33326 } 33327 33328 type DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayOfValues struct { 33329 DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath 33330 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 33331 } 33332 33333 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayOfValues)(nil) 33334 33335 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 33336 return fpsaov.subPathArrayOfValues.GetRawValues() 33337 } 33338 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldSubPathArrayOfValues) AsRegistrationSettingsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues, bool) { 33339 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusRegistrationSettings_FieldPathArrayOfValues) 33340 return res, ok 33341 } 33342 33343 // FieldPath provides implementation to handle 33344 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 33345 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath interface { 33346 gotenobject.FieldPath 33347 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector 33348 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) []interface{} 33349 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) (interface{}, bool) 33350 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 33351 33352 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue 33353 // (or array of values) and holds passed value. Panics if injected type is incorrect. 33354 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue 33355 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues 33356 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue 33357 } 33358 33359 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector int32 33360 33361 const ( 33362 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector = 0 33363 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector = 1 33364 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector = 2 33365 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector = 3 33366 ) 33367 33368 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector) String() string { 33369 switch s { 33370 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33371 return "apn" 33372 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33373 return "ip_type" 33374 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33375 return "password" 33376 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33377 return "user" 33378 default: 33379 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", s)) 33380 } 33381 } 33382 33383 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath, error) { 33384 if len(fp) == 0 { 33385 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings") 33386 } 33387 if len(fp) == 1 { 33388 switch fp[0] { 33389 case "apn": 33390 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn}, nil 33391 case "ip_type", "ipType", "ip-type": 33392 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType}, nil 33393 case "password": 33394 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword}, nil 33395 case "user": 33396 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser}, nil 33397 } 33398 } 33399 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings", fp) 33400 } 33401 33402 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath, error) { 33403 fp, err := gotenobject.ParseRawFieldPath(rawField) 33404 if err != nil { 33405 return nil, err 33406 } 33407 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(fp) 33408 } 33409 33410 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath { 33411 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(rawField) 33412 if err != nil { 33413 panic(err) 33414 } 33415 return fp 33416 } 33417 33418 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath struct { 33419 selector DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector 33420 } 33421 33422 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath)(nil) 33423 33424 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelector { 33425 return fp.selector 33426 } 33427 33428 // String returns path representation in proto convention 33429 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) String() string { 33430 return fp.selector.String() 33431 } 33432 33433 // JSONString returns path representation is JSON convention 33434 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) JSONString() string { 33435 return strcase.ToLowerCamel(fp.String()) 33436 } 33437 33438 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings 33439 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) (values []interface{}) { 33440 if source != nil { 33441 switch fp.selector { 33442 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33443 values = append(values, source.Apn) 33444 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33445 values = append(values, source.IpType) 33446 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33447 values = append(values, source.Password) 33448 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33449 values = append(values, source.User) 33450 default: 33451 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33452 } 33453 } 33454 return 33455 } 33456 33457 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 33458 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 33459 } 33460 33461 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings 33462 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) (interface{}, bool) { 33463 switch fp.selector { 33464 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33465 return source.GetApn(), source != nil 33466 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33467 return source.GetIpType(), source != nil 33468 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33469 return source.GetPassword(), source != nil 33470 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33471 return source.GetUser(), source != nil 33472 default: 33473 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33474 } 33475 } 33476 33477 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 33478 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 33479 } 33480 33481 // GetDefault returns a default value of the field type 33482 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) GetDefault() interface{} { 33483 switch fp.selector { 33484 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33485 return "" 33486 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33487 return "" 33488 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33489 return "" 33490 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33491 return "" 33492 default: 33493 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33494 } 33495 } 33496 33497 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) { 33498 if item != nil { 33499 switch fp.selector { 33500 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33501 item.Apn = "" 33502 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33503 item.IpType = "" 33504 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33505 item.Password = "" 33506 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33507 item.User = "" 33508 default: 33509 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33510 } 33511 } 33512 } 33513 33514 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) ClearValueRaw(item proto.Message) { 33515 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 33516 } 33517 33518 // IsLeaf - whether field path is holds simple value 33519 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) IsLeaf() bool { 33520 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn || 33521 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType || 33522 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword || 33523 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser 33524 } 33525 33526 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 33527 return []gotenobject.FieldPath{fp} 33528 } 33529 33530 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue { 33531 switch fp.selector { 33532 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33533 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, value: value.(string)} 33534 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33535 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, value: value.(string)} 33536 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33537 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, value: value.(string)} 33538 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33539 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, value: value.(string)} 33540 default: 33541 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33542 } 33543 } 33544 33545 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 33546 return fp.WithIValue(value) 33547 } 33548 33549 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues { 33550 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp} 33551 switch fp.selector { 33552 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33553 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, values: values.([]string)} 33554 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33555 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, values: values.([]string)} 33556 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33557 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, values: values.([]string)} 33558 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33559 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath: *fp, values: values.([]string)} 33560 default: 33561 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33562 } 33563 return fpaov 33564 } 33565 33566 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 33567 return fp.WithIArrayOfValues(values) 33568 } 33569 33570 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue { 33571 switch fp.selector { 33572 default: 33573 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fp.selector)) 33574 } 33575 } 33576 33577 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 33578 return fp.WithIArrayItemValue(value) 33579 } 33580 33581 // DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue allows storing values for Settings fields according to their type 33582 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue interface { 33583 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath 33584 gotenobject.FieldPathValue 33585 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 33586 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) (cmp int, comparable bool) 33587 } 33588 33589 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue, error) { 33590 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(pathStr) 33591 if err != nil { 33592 return nil, err 33593 } 33594 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 33595 if err != nil { 33596 return nil, status.Errorf(codes.InvalidArgument, "error parsing Settings field path value from %s: %v", valueStr, err) 33597 } 33598 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue), nil 33599 } 33600 33601 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue { 33602 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue(pathStr, valueStr) 33603 if err != nil { 33604 panic(err) 33605 } 33606 return fpv 33607 } 33608 33609 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue struct { 33610 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath 33611 value interface{} 33612 } 33613 33614 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue)(nil) 33615 33616 // GetRawValue returns raw value stored under selected path for 'Settings' as interface{} 33617 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) GetRawValue() interface{} { 33618 return fpv.value 33619 } 33620 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) AsApnValue() (string, bool) { 33621 res, ok := fpv.value.(string) 33622 return res, ok 33623 } 33624 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) AsIpTypeValue() (string, bool) { 33625 res, ok := fpv.value.(string) 33626 return res, ok 33627 } 33628 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) AsPasswordValue() (string, bool) { 33629 res, ok := fpv.value.(string) 33630 return res, ok 33631 } 33632 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) AsUserValue() (string, bool) { 33633 res, ok := fpv.value.(string) 33634 return res, ok 33635 } 33636 33637 // SetTo stores value for selected field for object Settings 33638 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) { 33639 if *target == nil { 33640 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 33641 } 33642 switch fpv.selector { 33643 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33644 (*target).Apn = fpv.value.(string) 33645 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33646 (*target).IpType = fpv.value.(string) 33647 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33648 (*target).Password = fpv.value.(string) 33649 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33650 (*target).User = fpv.value.(string) 33651 default: 33652 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fpv.selector)) 33653 } 33654 } 33655 33656 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) SetToRaw(target proto.Message) { 33657 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 33658 fpv.SetTo(&typedObject) 33659 } 33660 33661 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings'. 33662 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) (int, bool) { 33663 switch fpv.selector { 33664 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33665 leftValue := fpv.value.(string) 33666 rightValue := source.GetApn() 33667 if (leftValue) == (rightValue) { 33668 return 0, true 33669 } else if (leftValue) < (rightValue) { 33670 return -1, true 33671 } else { 33672 return 1, true 33673 } 33674 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33675 leftValue := fpv.value.(string) 33676 rightValue := source.GetIpType() 33677 if (leftValue) == (rightValue) { 33678 return 0, true 33679 } else if (leftValue) < (rightValue) { 33680 return -1, true 33681 } else { 33682 return 1, true 33683 } 33684 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33685 leftValue := fpv.value.(string) 33686 rightValue := source.GetPassword() 33687 if (leftValue) == (rightValue) { 33688 return 0, true 33689 } else if (leftValue) < (rightValue) { 33690 return -1, true 33691 } else { 33692 return 1, true 33693 } 33694 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33695 leftValue := fpv.value.(string) 33696 rightValue := source.GetUser() 33697 if (leftValue) == (rightValue) { 33698 return 0, true 33699 } else if (leftValue) < (rightValue) { 33700 return -1, true 33701 } else { 33702 return 1, true 33703 } 33704 default: 33705 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings: %d", fpv.selector)) 33706 } 33707 } 33708 33709 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 33710 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 33711 } 33712 33713 // DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue allows storing single item in Path-specific values for Settings according to their type 33714 // Present only for array (repeated) types. 33715 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue interface { 33716 gotenobject.FieldPathArrayItemValue 33717 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath 33718 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) bool 33719 } 33720 33721 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 33722 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue, error) { 33723 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(pathStr) 33724 if err != nil { 33725 return nil, err 33726 } 33727 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 33728 if err != nil { 33729 return nil, status.Errorf(codes.InvalidArgument, "error parsing Settings field path array item value from %s: %v", valueStr, err) 33730 } 33731 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue), nil 33732 } 33733 33734 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue { 33735 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue(pathStr, valueStr) 33736 if err != nil { 33737 panic(err) 33738 } 33739 return fpaiv 33740 } 33741 33742 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayItemValue struct { 33743 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath 33744 value interface{} 33745 } 33746 33747 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayItemValue)(nil) 33748 33749 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings as interface{} 33750 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 33751 return fpaiv.value 33752 } 33753 33754 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) (interface{}, bool) { 33755 return nil, false 33756 } 33757 33758 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 33759 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)) 33760 } 33761 33762 // Contains returns a boolean indicating if value that is being held is present in given 'Settings' 33763 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) bool { 33764 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath.Get(source) 33765 for _, v := range slice { 33766 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 33767 if proto.Equal(asProtoMsg, v.(proto.Message)) { 33768 return true 33769 } 33770 } else if reflect.DeepEqual(v, fpaiv.value) { 33771 return true 33772 } 33773 } 33774 return false 33775 } 33776 33777 // DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues allows storing slice of values for Settings fields according to their type 33778 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues interface { 33779 gotenobject.FieldPathArrayOfValues 33780 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath 33781 } 33782 33783 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues, error) { 33784 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(pathStr) 33785 if err != nil { 33786 return nil, err 33787 } 33788 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 33789 if err != nil { 33790 return nil, status.Errorf(codes.InvalidArgument, "error parsing Settings field path array of values from %s: %v", valuesStr, err) 33791 } 33792 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues), nil 33793 } 33794 33795 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues { 33796 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues(pathStr, valuesStr) 33797 if err != nil { 33798 panic(err) 33799 } 33800 return fpaov 33801 } 33802 33803 type DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues struct { 33804 DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPath 33805 values interface{} 33806 } 33807 33808 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues)(nil) 33809 33810 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 33811 switch fpaov.selector { 33812 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorApn: 33813 for _, v := range fpaov.values.([]string) { 33814 values = append(values, v) 33815 } 33816 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorIpType: 33817 for _, v := range fpaov.values.([]string) { 33818 values = append(values, v) 33819 } 33820 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorPassword: 33821 for _, v := range fpaov.values.([]string) { 33822 values = append(values, v) 33823 } 33824 case DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathSelectorUser: 33825 for _, v := range fpaov.values.([]string) { 33826 values = append(values, v) 33827 } 33828 } 33829 return 33830 } 33831 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues) AsApnArrayOfValues() ([]string, bool) { 33832 res, ok := fpaov.values.([]string) 33833 return res, ok 33834 } 33835 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues) AsIpTypeArrayOfValues() ([]string, bool) { 33836 res, ok := fpaov.values.([]string) 33837 return res, ok 33838 } 33839 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues) AsPasswordArrayOfValues() ([]string, bool) { 33840 res, ok := fpaov.values.([]string) 33841 return res, ok 33842 } 33843 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldTerminalPathArrayOfValues) AsUserArrayOfValues() ([]string, bool) { 33844 res, ok := fpaov.values.([]string) 33845 return res, ok 33846 } 33847 33848 // FieldPath provides implementation to handle 33849 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 33850 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath interface { 33851 gotenobject.FieldPath 33852 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector 33853 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) []interface{} 33854 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (interface{}, bool) 33855 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 33856 33857 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue 33858 // (or array of values) and holds passed value. Panics if injected type is incorrect. 33859 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue 33860 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues 33861 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue 33862 } 33863 33864 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector int32 33865 33866 const ( 33867 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector = 0 33868 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector = 1 33869 ) 33870 33871 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector) String() string { 33872 switch s { 33873 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 33874 return "dbus_path" 33875 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 33876 return "settings" 33877 default: 33878 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", s)) 33879 } 33880 } 33881 33882 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath, error) { 33883 if len(fp) == 0 { 33884 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer") 33885 } 33886 if len(fp) == 1 { 33887 switch fp[0] { 33888 case "dbus_path", "dbusPath", "dbus-path": 33889 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath}, nil 33890 case "settings": 33891 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings}, nil 33892 } 33893 } else { 33894 switch fp[0] { 33895 case "settings": 33896 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath(fp[1:]); err != nil { 33897 return nil, err 33898 } else { 33899 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings, subPath: subpath}, nil 33900 } 33901 } 33902 } 33903 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer", fp) 33904 } 33905 33906 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath, error) { 33907 fp, err := gotenobject.ParseRawFieldPath(rawField) 33908 if err != nil { 33909 return nil, err 33910 } 33911 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(fp) 33912 } 33913 33914 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath { 33915 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(rawField) 33916 if err != nil { 33917 panic(err) 33918 } 33919 return fp 33920 } 33921 33922 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath struct { 33923 selector DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector 33924 } 33925 33926 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath)(nil) 33927 33928 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector { 33929 return fp.selector 33930 } 33931 33932 // String returns path representation in proto convention 33933 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) String() string { 33934 return fp.selector.String() 33935 } 33936 33937 // JSONString returns path representation is JSON convention 33938 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) JSONString() string { 33939 return strcase.ToLowerCamel(fp.String()) 33940 } 33941 33942 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer 33943 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (values []interface{}) { 33944 if source != nil { 33945 switch fp.selector { 33946 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 33947 values = append(values, source.DbusPath) 33948 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 33949 if source.Settings != nil { 33950 values = append(values, source.Settings) 33951 } 33952 default: 33953 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 33954 } 33955 } 33956 return 33957 } 33958 33959 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 33960 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 33961 } 33962 33963 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer 33964 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (interface{}, bool) { 33965 switch fp.selector { 33966 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 33967 return source.GetDbusPath(), source != nil 33968 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 33969 res := source.GetSettings() 33970 return res, res != nil 33971 default: 33972 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 33973 } 33974 } 33975 33976 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 33977 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 33978 } 33979 33980 // GetDefault returns a default value of the field type 33981 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) GetDefault() interface{} { 33982 switch fp.selector { 33983 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 33984 return "" 33985 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 33986 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)(nil) 33987 default: 33988 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 33989 } 33990 } 33991 33992 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) { 33993 if item != nil { 33994 switch fp.selector { 33995 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 33996 item.DbusPath = "" 33997 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 33998 item.Settings = nil 33999 default: 34000 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 34001 } 34002 } 34003 } 34004 34005 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) ClearValueRaw(item proto.Message) { 34006 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34007 } 34008 34009 // IsLeaf - whether field path is holds simple value 34010 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) IsLeaf() bool { 34011 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath 34012 } 34013 34014 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 34015 return []gotenobject.FieldPath{fp} 34016 } 34017 34018 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue { 34019 switch fp.selector { 34020 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 34021 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: *fp, value: value.(string)} 34022 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34023 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)} 34024 default: 34025 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 34026 } 34027 } 34028 34029 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 34030 return fp.WithIValue(value) 34031 } 34032 34033 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues { 34034 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: *fp} 34035 switch fp.selector { 34036 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 34037 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: *fp, values: values.([]string)} 34038 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34039 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings)} 34040 default: 34041 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 34042 } 34043 return fpaov 34044 } 34045 34046 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 34047 return fp.WithIArrayOfValues(values) 34048 } 34049 34050 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue { 34051 switch fp.selector { 34052 default: 34053 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fp.selector)) 34054 } 34055 } 34056 34057 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 34058 return fp.WithIArrayItemValue(value) 34059 } 34060 34061 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath struct { 34062 selector DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector 34063 subPath gotenobject.FieldPath 34064 } 34065 34066 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath)(nil) 34067 34068 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelector { 34069 return fps.selector 34070 } 34071 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) AsSettingsSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath, bool) { 34072 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPath) 34073 return res, ok 34074 } 34075 34076 // String returns path representation in proto convention 34077 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) String() string { 34078 return fps.selector.String() + "." + fps.subPath.String() 34079 } 34080 34081 // JSONString returns path representation is JSON convention 34082 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) JSONString() string { 34083 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 34084 } 34085 34086 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer 34087 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (values []interface{}) { 34088 switch fps.selector { 34089 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34090 values = append(values, fps.subPath.GetRaw(source.GetSettings())...) 34091 default: 34092 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fps.selector)) 34093 } 34094 return 34095 } 34096 34097 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) GetRaw(source proto.Message) []interface{} { 34098 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34099 } 34100 34101 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer 34102 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (interface{}, bool) { 34103 switch fps.selector { 34104 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34105 if source.GetSettings() == nil { 34106 return nil, false 34107 } 34108 return fps.subPath.GetSingleRaw(source.GetSettings()) 34109 default: 34110 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fps.selector)) 34111 } 34112 } 34113 34114 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 34115 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34116 } 34117 34118 // GetDefault returns a default value of the field type 34119 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) GetDefault() interface{} { 34120 return fps.subPath.GetDefault() 34121 } 34122 34123 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) { 34124 if item != nil { 34125 switch fps.selector { 34126 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34127 fps.subPath.ClearValueRaw(item.Settings) 34128 default: 34129 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fps.selector)) 34130 } 34131 } 34132 } 34133 34134 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) ClearValueRaw(item proto.Message) { 34135 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34136 } 34137 34138 // IsLeaf - whether field path is holds simple value 34139 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) IsLeaf() bool { 34140 return fps.subPath.IsLeaf() 34141 } 34142 34143 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 34144 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath{selector: fps.selector}} 34145 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 34146 return iPaths 34147 } 34148 34149 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue { 34150 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 34151 } 34152 34153 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 34154 return fps.WithIValue(value) 34155 } 34156 34157 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues { 34158 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 34159 } 34160 34161 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 34162 return fps.WithIArrayOfValues(values) 34163 } 34164 34165 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue { 34166 return &DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 34167 } 34168 34169 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 34170 return fps.WithIArrayItemValue(value) 34171 } 34172 34173 // DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue allows storing values for InitialBearer fields according to their type 34174 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue interface { 34175 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 34176 gotenobject.FieldPathValue 34177 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34178 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (cmp int, comparable bool) 34179 } 34180 34181 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue, error) { 34182 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(pathStr) 34183 if err != nil { 34184 return nil, err 34185 } 34186 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 34187 if err != nil { 34188 return nil, status.Errorf(codes.InvalidArgument, "error parsing InitialBearer field path value from %s: %v", valueStr, err) 34189 } 34190 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue), nil 34191 } 34192 34193 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue { 34194 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue(pathStr, valueStr) 34195 if err != nil { 34196 panic(err) 34197 } 34198 return fpv 34199 } 34200 34201 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue struct { 34202 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath 34203 value interface{} 34204 } 34205 34206 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue)(nil) 34207 34208 // GetRawValue returns raw value stored under selected path for 'InitialBearer' as interface{} 34209 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) GetRawValue() interface{} { 34210 return fpv.value 34211 } 34212 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) AsDbusPathValue() (string, bool) { 34213 res, ok := fpv.value.(string) 34214 return res, ok 34215 } 34216 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) AsSettingsValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings, bool) { 34217 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 34218 return res, ok 34219 } 34220 34221 // SetTo stores value for selected field for object InitialBearer 34222 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) { 34223 if *target == nil { 34224 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34225 } 34226 switch fpv.selector { 34227 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 34228 (*target).DbusPath = fpv.value.(string) 34229 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34230 (*target).Settings = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 34231 default: 34232 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fpv.selector)) 34233 } 34234 } 34235 34236 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) SetToRaw(target proto.Message) { 34237 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34238 fpv.SetTo(&typedObject) 34239 } 34240 34241 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer'. 34242 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (int, bool) { 34243 switch fpv.selector { 34244 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 34245 leftValue := fpv.value.(string) 34246 rightValue := source.GetDbusPath() 34247 if (leftValue) == (rightValue) { 34248 return 0, true 34249 } else if (leftValue) < (rightValue) { 34250 return -1, true 34251 } else { 34252 return 1, true 34253 } 34254 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34255 return 0, false 34256 default: 34257 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fpv.selector)) 34258 } 34259 } 34260 34261 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 34262 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34263 } 34264 34265 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue struct { 34266 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 34267 subPathValue gotenobject.FieldPathValue 34268 } 34269 34270 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue)(nil) 34271 34272 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue) AsSettingsPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue, bool) { 34273 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue) 34274 return res, ok 34275 } 34276 34277 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) { 34278 if *target == nil { 34279 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34280 } 34281 switch fpvs.Selector() { 34282 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34283 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue).SetTo(&(*target).Settings) 34284 default: 34285 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fpvs.Selector())) 34286 } 34287 } 34288 34289 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue) SetToRaw(target proto.Message) { 34290 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34291 fpvs.SetTo(&typedObject) 34292 } 34293 34294 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue) GetRawValue() interface{} { 34295 return fpvs.subPathValue.GetRawValue() 34296 } 34297 34298 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (int, bool) { 34299 switch fpvs.Selector() { 34300 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34301 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathValue).CompareWith(source.GetSettings()) 34302 default: 34303 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fpvs.Selector())) 34304 } 34305 } 34306 34307 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 34308 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34309 } 34310 34311 // DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue allows storing single item in Path-specific values for InitialBearer according to their type 34312 // Present only for array (repeated) types. 34313 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue interface { 34314 gotenobject.FieldPathArrayItemValue 34315 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 34316 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) bool 34317 } 34318 34319 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 34320 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue, error) { 34321 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(pathStr) 34322 if err != nil { 34323 return nil, err 34324 } 34325 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 34326 if err != nil { 34327 return nil, status.Errorf(codes.InvalidArgument, "error parsing InitialBearer field path array item value from %s: %v", valueStr, err) 34328 } 34329 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue), nil 34330 } 34331 34332 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue { 34333 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue(pathStr, valueStr) 34334 if err != nil { 34335 panic(err) 34336 } 34337 return fpaiv 34338 } 34339 34340 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayItemValue struct { 34341 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath 34342 value interface{} 34343 } 34344 34345 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayItemValue)(nil) 34346 34347 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer as interface{} 34348 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 34349 return fpaiv.value 34350 } 34351 34352 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) (interface{}, bool) { 34353 return nil, false 34354 } 34355 34356 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 34357 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)) 34358 } 34359 34360 // Contains returns a boolean indicating if value that is being held is present in given 'InitialBearer' 34361 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) bool { 34362 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath.Get(source) 34363 for _, v := range slice { 34364 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 34365 if proto.Equal(asProtoMsg, v.(proto.Message)) { 34366 return true 34367 } 34368 } else if reflect.DeepEqual(v, fpaiv.value) { 34369 return true 34370 } 34371 } 34372 return false 34373 } 34374 34375 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayItemValue struct { 34376 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 34377 subPathItemValue gotenobject.FieldPathArrayItemValue 34378 } 34379 34380 // GetRawValue returns stored array item value 34381 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 34382 return fpaivs.subPathItemValue.GetRawItemValue() 34383 } 34384 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayItemValue) AsSettingsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue, bool) { 34385 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue) 34386 return res, ok 34387 } 34388 34389 // Contains returns a boolean indicating if value that is being held is present in given 'InitialBearer' 34390 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) bool { 34391 switch fpaivs.Selector() { 34392 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34393 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayItemValue).ContainsValue(source.GetSettings()) 34394 default: 34395 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer: %d", fpaivs.Selector())) 34396 } 34397 } 34398 34399 // DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues allows storing slice of values for InitialBearer fields according to their type 34400 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues interface { 34401 gotenobject.FieldPathArrayOfValues 34402 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 34403 } 34404 34405 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues, error) { 34406 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(pathStr) 34407 if err != nil { 34408 return nil, err 34409 } 34410 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 34411 if err != nil { 34412 return nil, status.Errorf(codes.InvalidArgument, "error parsing InitialBearer field path array of values from %s: %v", valuesStr, err) 34413 } 34414 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues), nil 34415 } 34416 34417 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues { 34418 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues(pathStr, valuesStr) 34419 if err != nil { 34420 panic(err) 34421 } 34422 return fpaov 34423 } 34424 34425 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues struct { 34426 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPath 34427 values interface{} 34428 } 34429 34430 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues)(nil) 34431 34432 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 34433 switch fpaov.selector { 34434 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorDbusPath: 34435 for _, v := range fpaov.values.([]string) { 34436 values = append(values, v) 34437 } 34438 case DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathSelectorSettings: 34439 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) { 34440 values = append(values, v) 34441 } 34442 } 34443 return 34444 } 34445 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues) AsDbusPathArrayOfValues() ([]string, bool) { 34446 res, ok := fpaov.values.([]string) 34447 return res, ok 34448 } 34449 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldTerminalPathArrayOfValues) AsSettingsArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings, bool) { 34450 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Settings) 34451 return res, ok 34452 } 34453 34454 type DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayOfValues struct { 34455 DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath 34456 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 34457 } 34458 34459 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayOfValues)(nil) 34460 34461 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 34462 return fpsaov.subPathArrayOfValues.GetRawValues() 34463 } 34464 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldSubPathArrayOfValues) AsSettingsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues, bool) { 34465 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusSettings_FieldPathArrayOfValues) 34466 return res, ok 34467 } 34468 34469 // FieldPath provides implementation to handle 34470 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 34471 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath interface { 34472 gotenobject.FieldPath 34473 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector 34474 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) []interface{} 34475 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (interface{}, bool) 34476 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 34477 34478 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue 34479 // (or array of values) and holds passed value. Panics if injected type is incorrect. 34480 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue 34481 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues 34482 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue 34483 } 34484 34485 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector int32 34486 34487 const ( 34488 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector = 0 34489 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector = 1 34490 ) 34491 34492 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector) String() string { 34493 switch s { 34494 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34495 return "initial_bearer" 34496 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34497 return "ue_mode_operation" 34498 default: 34499 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", s)) 34500 } 34501 } 34502 34503 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath, error) { 34504 if len(fp) == 0 { 34505 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps") 34506 } 34507 if len(fp) == 1 { 34508 switch fp[0] { 34509 case "initial_bearer", "initialBearer", "initial-bearer": 34510 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer}, nil 34511 case "ue_mode_operation", "ueModeOperation", "ue-mode-operation": 34512 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation}, nil 34513 } 34514 } else { 34515 switch fp[0] { 34516 case "initial_bearer", "initialBearer", "initial-bearer": 34517 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath(fp[1:]); err != nil { 34518 return nil, err 34519 } else { 34520 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer, subPath: subpath}, nil 34521 } 34522 } 34523 } 34524 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps", fp) 34525 } 34526 34527 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath, error) { 34528 fp, err := gotenobject.ParseRawFieldPath(rawField) 34529 if err != nil { 34530 return nil, err 34531 } 34532 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(fp) 34533 } 34534 34535 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath { 34536 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(rawField) 34537 if err != nil { 34538 panic(err) 34539 } 34540 return fp 34541 } 34542 34543 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath struct { 34544 selector DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector 34545 } 34546 34547 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath)(nil) 34548 34549 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector { 34550 return fp.selector 34551 } 34552 34553 // String returns path representation in proto convention 34554 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) String() string { 34555 return fp.selector.String() 34556 } 34557 34558 // JSONString returns path representation is JSON convention 34559 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) JSONString() string { 34560 return strcase.ToLowerCamel(fp.String()) 34561 } 34562 34563 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps 34564 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (values []interface{}) { 34565 if source != nil { 34566 switch fp.selector { 34567 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34568 if source.InitialBearer != nil { 34569 values = append(values, source.InitialBearer) 34570 } 34571 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34572 values = append(values, source.UeModeOperation) 34573 default: 34574 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34575 } 34576 } 34577 return 34578 } 34579 34580 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 34581 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34582 } 34583 34584 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps 34585 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (interface{}, bool) { 34586 switch fp.selector { 34587 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34588 res := source.GetInitialBearer() 34589 return res, res != nil 34590 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34591 return source.GetUeModeOperation(), source != nil 34592 default: 34593 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34594 } 34595 } 34596 34597 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 34598 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34599 } 34600 34601 // GetDefault returns a default value of the field type 34602 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) GetDefault() interface{} { 34603 switch fp.selector { 34604 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34605 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)(nil) 34606 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34607 return "" 34608 default: 34609 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34610 } 34611 } 34612 34613 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) { 34614 if item != nil { 34615 switch fp.selector { 34616 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34617 item.InitialBearer = nil 34618 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34619 item.UeModeOperation = "" 34620 default: 34621 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34622 } 34623 } 34624 } 34625 34626 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) ClearValueRaw(item proto.Message) { 34627 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34628 } 34629 34630 // IsLeaf - whether field path is holds simple value 34631 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) IsLeaf() bool { 34632 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation 34633 } 34634 34635 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 34636 return []gotenobject.FieldPath{fp} 34637 } 34638 34639 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue { 34640 switch fp.selector { 34641 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34642 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)} 34643 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34644 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: *fp, value: value.(string)} 34645 default: 34646 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34647 } 34648 } 34649 34650 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 34651 return fp.WithIValue(value) 34652 } 34653 34654 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues { 34655 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: *fp} 34656 switch fp.selector { 34657 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34658 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer)} 34659 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34660 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath: *fp, values: values.([]string)} 34661 default: 34662 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34663 } 34664 return fpaov 34665 } 34666 34667 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 34668 return fp.WithIArrayOfValues(values) 34669 } 34670 34671 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue { 34672 switch fp.selector { 34673 default: 34674 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fp.selector)) 34675 } 34676 } 34677 34678 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 34679 return fp.WithIArrayItemValue(value) 34680 } 34681 34682 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath struct { 34683 selector DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector 34684 subPath gotenobject.FieldPath 34685 } 34686 34687 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath)(nil) 34688 34689 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelector { 34690 return fps.selector 34691 } 34692 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) AsInitialBearerSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath, bool) { 34693 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPath) 34694 return res, ok 34695 } 34696 34697 // String returns path representation in proto convention 34698 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) String() string { 34699 return fps.selector.String() + "." + fps.subPath.String() 34700 } 34701 34702 // JSONString returns path representation is JSON convention 34703 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) JSONString() string { 34704 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 34705 } 34706 34707 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps 34708 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (values []interface{}) { 34709 switch fps.selector { 34710 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34711 values = append(values, fps.subPath.GetRaw(source.GetInitialBearer())...) 34712 default: 34713 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fps.selector)) 34714 } 34715 return 34716 } 34717 34718 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) GetRaw(source proto.Message) []interface{} { 34719 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34720 } 34721 34722 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps 34723 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (interface{}, bool) { 34724 switch fps.selector { 34725 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34726 if source.GetInitialBearer() == nil { 34727 return nil, false 34728 } 34729 return fps.subPath.GetSingleRaw(source.GetInitialBearer()) 34730 default: 34731 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fps.selector)) 34732 } 34733 } 34734 34735 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 34736 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34737 } 34738 34739 // GetDefault returns a default value of the field type 34740 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) GetDefault() interface{} { 34741 return fps.subPath.GetDefault() 34742 } 34743 34744 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) { 34745 if item != nil { 34746 switch fps.selector { 34747 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34748 fps.subPath.ClearValueRaw(item.InitialBearer) 34749 default: 34750 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fps.selector)) 34751 } 34752 } 34753 } 34754 34755 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) ClearValueRaw(item proto.Message) { 34756 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34757 } 34758 34759 // IsLeaf - whether field path is holds simple value 34760 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) IsLeaf() bool { 34761 return fps.subPath.IsLeaf() 34762 } 34763 34764 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 34765 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath{selector: fps.selector}} 34766 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 34767 return iPaths 34768 } 34769 34770 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue { 34771 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 34772 } 34773 34774 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 34775 return fps.WithIValue(value) 34776 } 34777 34778 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues { 34779 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 34780 } 34781 34782 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 34783 return fps.WithIArrayOfValues(values) 34784 } 34785 34786 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue { 34787 return &DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 34788 } 34789 34790 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 34791 return fps.WithIArrayItemValue(value) 34792 } 34793 34794 // DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue allows storing values for Eps fields according to their type 34795 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue interface { 34796 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 34797 gotenobject.FieldPathValue 34798 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 34799 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (cmp int, comparable bool) 34800 } 34801 34802 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue, error) { 34803 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(pathStr) 34804 if err != nil { 34805 return nil, err 34806 } 34807 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 34808 if err != nil { 34809 return nil, status.Errorf(codes.InvalidArgument, "error parsing Eps field path value from %s: %v", valueStr, err) 34810 } 34811 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue), nil 34812 } 34813 34814 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue { 34815 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue(pathStr, valueStr) 34816 if err != nil { 34817 panic(err) 34818 } 34819 return fpv 34820 } 34821 34822 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue struct { 34823 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath 34824 value interface{} 34825 } 34826 34827 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue)(nil) 34828 34829 // GetRawValue returns raw value stored under selected path for 'Eps' as interface{} 34830 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) GetRawValue() interface{} { 34831 return fpv.value 34832 } 34833 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) AsInitialBearerValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer, bool) { 34834 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34835 return res, ok 34836 } 34837 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) AsUeModeOperationValue() (string, bool) { 34838 res, ok := fpv.value.(string) 34839 return res, ok 34840 } 34841 34842 // SetTo stores value for selected field for object Eps 34843 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) { 34844 if *target == nil { 34845 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 34846 } 34847 switch fpv.selector { 34848 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34849 (*target).InitialBearer = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 34850 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34851 (*target).UeModeOperation = fpv.value.(string) 34852 default: 34853 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fpv.selector)) 34854 } 34855 } 34856 34857 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) SetToRaw(target proto.Message) { 34858 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 34859 fpv.SetTo(&typedObject) 34860 } 34861 34862 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps'. 34863 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (int, bool) { 34864 switch fpv.selector { 34865 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34866 return 0, false 34867 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 34868 leftValue := fpv.value.(string) 34869 rightValue := source.GetUeModeOperation() 34870 if (leftValue) == (rightValue) { 34871 return 0, true 34872 } else if (leftValue) < (rightValue) { 34873 return -1, true 34874 } else { 34875 return 1, true 34876 } 34877 default: 34878 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fpv.selector)) 34879 } 34880 } 34881 34882 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 34883 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34884 } 34885 34886 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue struct { 34887 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 34888 subPathValue gotenobject.FieldPathValue 34889 } 34890 34891 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue)(nil) 34892 34893 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue) AsInitialBearerPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue, bool) { 34894 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue) 34895 return res, ok 34896 } 34897 34898 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) { 34899 if *target == nil { 34900 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 34901 } 34902 switch fpvs.Selector() { 34903 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34904 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue).SetTo(&(*target).InitialBearer) 34905 default: 34906 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fpvs.Selector())) 34907 } 34908 } 34909 34910 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue) SetToRaw(target proto.Message) { 34911 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 34912 fpvs.SetTo(&typedObject) 34913 } 34914 34915 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue) GetRawValue() interface{} { 34916 return fpvs.subPathValue.GetRawValue() 34917 } 34918 34919 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (int, bool) { 34920 switch fpvs.Selector() { 34921 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 34922 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathValue).CompareWith(source.GetInitialBearer()) 34923 default: 34924 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fpvs.Selector())) 34925 } 34926 } 34927 34928 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 34929 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34930 } 34931 34932 // DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue allows storing single item in Path-specific values for Eps according to their type 34933 // Present only for array (repeated) types. 34934 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue interface { 34935 gotenobject.FieldPathArrayItemValue 34936 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 34937 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) bool 34938 } 34939 34940 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 34941 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue, error) { 34942 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(pathStr) 34943 if err != nil { 34944 return nil, err 34945 } 34946 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 34947 if err != nil { 34948 return nil, status.Errorf(codes.InvalidArgument, "error parsing Eps field path array item value from %s: %v", valueStr, err) 34949 } 34950 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue), nil 34951 } 34952 34953 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue { 34954 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue(pathStr, valueStr) 34955 if err != nil { 34956 panic(err) 34957 } 34958 return fpaiv 34959 } 34960 34961 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayItemValue struct { 34962 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath 34963 value interface{} 34964 } 34965 34966 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayItemValue)(nil) 34967 34968 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps as interface{} 34969 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 34970 return fpaiv.value 34971 } 34972 34973 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) (interface{}, bool) { 34974 return nil, false 34975 } 34976 34977 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 34978 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)) 34979 } 34980 34981 // Contains returns a boolean indicating if value that is being held is present in given 'Eps' 34982 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) bool { 34983 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath.Get(source) 34984 for _, v := range slice { 34985 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 34986 if proto.Equal(asProtoMsg, v.(proto.Message)) { 34987 return true 34988 } 34989 } else if reflect.DeepEqual(v, fpaiv.value) { 34990 return true 34991 } 34992 } 34993 return false 34994 } 34995 34996 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayItemValue struct { 34997 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 34998 subPathItemValue gotenobject.FieldPathArrayItemValue 34999 } 35000 35001 // GetRawValue returns stored array item value 35002 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 35003 return fpaivs.subPathItemValue.GetRawItemValue() 35004 } 35005 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayItemValue) AsInitialBearerPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue, bool) { 35006 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue) 35007 return res, ok 35008 } 35009 35010 // Contains returns a boolean indicating if value that is being held is present in given 'Eps' 35011 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) bool { 35012 switch fpaivs.Selector() { 35013 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 35014 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayItemValue).ContainsValue(source.GetInitialBearer()) 35015 default: 35016 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps: %d", fpaivs.Selector())) 35017 } 35018 } 35019 35020 // DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues allows storing slice of values for Eps fields according to their type 35021 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues interface { 35022 gotenobject.FieldPathArrayOfValues 35023 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 35024 } 35025 35026 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues, error) { 35027 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(pathStr) 35028 if err != nil { 35029 return nil, err 35030 } 35031 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 35032 if err != nil { 35033 return nil, status.Errorf(codes.InvalidArgument, "error parsing Eps field path array of values from %s: %v", valuesStr, err) 35034 } 35035 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues), nil 35036 } 35037 35038 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues { 35039 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues(pathStr, valuesStr) 35040 if err != nil { 35041 panic(err) 35042 } 35043 return fpaov 35044 } 35045 35046 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues struct { 35047 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPath 35048 values interface{} 35049 } 35050 35051 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues)(nil) 35052 35053 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 35054 switch fpaov.selector { 35055 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorInitialBearer: 35056 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) { 35057 values = append(values, v) 35058 } 35059 case DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathSelectorUeModeOperation: 35060 for _, v := range fpaov.values.([]string) { 35061 values = append(values, v) 35062 } 35063 } 35064 return 35065 } 35066 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues) AsInitialBearerArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer, bool) { 35067 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_InitialBearer) 35068 return res, ok 35069 } 35070 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldTerminalPathArrayOfValues) AsUeModeOperationArrayOfValues() ([]string, bool) { 35071 res, ok := fpaov.values.([]string) 35072 return res, ok 35073 } 35074 35075 type DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayOfValues struct { 35076 DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath 35077 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 35078 } 35079 35080 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayOfValues)(nil) 35081 35082 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 35083 return fpsaov.subPathArrayOfValues.GetRawValues() 35084 } 35085 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldSubPathArrayOfValues) AsInitialBearerPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues, bool) { 35086 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusInitialBearer_FieldPathArrayOfValues) 35087 return res, ok 35088 } 35089 35090 // FieldPath provides implementation to handle 35091 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 35092 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath interface { 35093 gotenobject.FieldPath 35094 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector 35095 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) []interface{} 35096 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (interface{}, bool) 35097 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 35098 35099 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue 35100 // (or array of values) and holds passed value. Panics if injected type is incorrect. 35101 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue 35102 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues 35103 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue 35104 } 35105 35106 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector int32 35107 35108 const ( 35109 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 0 35110 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 1 35111 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 2 35112 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 3 35113 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 4 35114 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 5 35115 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 6 35116 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 7 35117 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector = 8 35118 ) 35119 35120 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector) String() string { 35121 switch s { 35122 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35123 return "fiveg_nr" 35124 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35125 return "enabled_locks" 35126 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35127 return "eps" 35128 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35129 return "imei" 35130 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35131 return "operator_code" 35132 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35133 return "operator_name" 35134 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35135 return "packet_service_state" 35136 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35137 return "pco" 35138 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35139 return "registration_state" 35140 default: 35141 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", s)) 35142 } 35143 } 35144 35145 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath, error) { 35146 if len(fp) == 0 { 35147 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp") 35148 } 35149 if len(fp) == 1 { 35150 switch fp[0] { 35151 case "fiveg_nr", "fivegNr", "fiveg-nr": 35152 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr}, nil 35153 case "enabled_locks", "enabledLocks", "enabled-locks": 35154 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks}, nil 35155 case "eps": 35156 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps}, nil 35157 case "imei": 35158 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei}, nil 35159 case "operator_code", "operatorCode", "operator-code": 35160 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode}, nil 35161 case "operator_name", "operatorName", "operator-name": 35162 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName}, nil 35163 case "packet_service_state", "packetServiceState", "packet-service-state": 35164 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState}, nil 35165 case "pco": 35166 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco}, nil 35167 case "registration_state", "registrationState", "registration-state": 35168 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState}, nil 35169 } 35170 } else { 35171 switch fp[0] { 35172 case "fiveg_nr", "fivegNr", "fiveg-nr": 35173 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath(fp[1:]); err != nil { 35174 return nil, err 35175 } else { 35176 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr, subPath: subpath}, nil 35177 } 35178 case "eps": 35179 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath(fp[1:]); err != nil { 35180 return nil, err 35181 } else { 35182 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps, subPath: subpath}, nil 35183 } 35184 } 35185 } 35186 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp", fp) 35187 } 35188 35189 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath, error) { 35190 fp, err := gotenobject.ParseRawFieldPath(rawField) 35191 if err != nil { 35192 return nil, err 35193 } 35194 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(fp) 35195 } 35196 35197 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath { 35198 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(rawField) 35199 if err != nil { 35200 panic(err) 35201 } 35202 return fp 35203 } 35204 35205 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath struct { 35206 selector DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector 35207 } 35208 35209 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath)(nil) 35210 35211 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector { 35212 return fp.selector 35213 } 35214 35215 // String returns path representation in proto convention 35216 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) String() string { 35217 return fp.selector.String() 35218 } 35219 35220 // JSONString returns path representation is JSON convention 35221 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) JSONString() string { 35222 return strcase.ToLowerCamel(fp.String()) 35223 } 35224 35225 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp 35226 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (values []interface{}) { 35227 if source != nil { 35228 switch fp.selector { 35229 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35230 if source.FivegNr != nil { 35231 values = append(values, source.FivegNr) 35232 } 35233 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35234 for _, value := range source.GetEnabledLocks() { 35235 values = append(values, value) 35236 } 35237 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35238 if source.Eps != nil { 35239 values = append(values, source.Eps) 35240 } 35241 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35242 values = append(values, source.Imei) 35243 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35244 values = append(values, source.OperatorCode) 35245 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35246 values = append(values, source.OperatorName) 35247 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35248 values = append(values, source.PacketServiceState) 35249 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35250 values = append(values, source.Pco) 35251 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35252 values = append(values, source.RegistrationState) 35253 default: 35254 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35255 } 35256 } 35257 return 35258 } 35259 35260 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 35261 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35262 } 35263 35264 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp 35265 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (interface{}, bool) { 35266 switch fp.selector { 35267 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35268 res := source.GetFivegNr() 35269 return res, res != nil 35270 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35271 res := source.GetEnabledLocks() 35272 return res, res != nil 35273 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35274 res := source.GetEps() 35275 return res, res != nil 35276 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35277 return source.GetImei(), source != nil 35278 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35279 return source.GetOperatorCode(), source != nil 35280 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35281 return source.GetOperatorName(), source != nil 35282 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35283 return source.GetPacketServiceState(), source != nil 35284 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35285 return source.GetPco(), source != nil 35286 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35287 return source.GetRegistrationState(), source != nil 35288 default: 35289 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35290 } 35291 } 35292 35293 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 35294 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35295 } 35296 35297 // GetDefault returns a default value of the field type 35298 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) GetDefault() interface{} { 35299 switch fp.selector { 35300 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35301 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)(nil) 35302 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35303 return ([]string)(nil) 35304 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35305 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)(nil) 35306 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35307 return "" 35308 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35309 return "" 35310 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35311 return "" 35312 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35313 return "" 35314 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35315 return "" 35316 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35317 return "" 35318 default: 35319 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35320 } 35321 } 35322 35323 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) { 35324 if item != nil { 35325 switch fp.selector { 35326 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35327 item.FivegNr = nil 35328 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35329 item.EnabledLocks = nil 35330 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35331 item.Eps = nil 35332 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35333 item.Imei = "" 35334 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35335 item.OperatorCode = "" 35336 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35337 item.OperatorName = "" 35338 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35339 item.PacketServiceState = "" 35340 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35341 item.Pco = "" 35342 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35343 item.RegistrationState = "" 35344 default: 35345 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35346 } 35347 } 35348 } 35349 35350 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) ClearValueRaw(item proto.Message) { 35351 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35352 } 35353 35354 // IsLeaf - whether field path is holds simple value 35355 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) IsLeaf() bool { 35356 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks || 35357 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei || 35358 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode || 35359 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName || 35360 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState || 35361 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco || 35362 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState 35363 } 35364 35365 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 35366 return []gotenobject.FieldPath{fp} 35367 } 35368 35369 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue { 35370 switch fp.selector { 35371 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35372 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)} 35373 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35374 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.([]string)} 35375 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35376 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)} 35377 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35378 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35379 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35380 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35381 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35382 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35383 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35384 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35385 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35386 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35387 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35388 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35389 default: 35390 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35391 } 35392 } 35393 35394 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 35395 return fp.WithIValue(value) 35396 } 35397 35398 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues { 35399 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp} 35400 switch fp.selector { 35401 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35402 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr)} 35403 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35404 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([][]string)} 35405 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35406 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps)} 35407 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35408 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]string)} 35409 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35410 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]string)} 35411 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35412 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]string)} 35413 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35414 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]string)} 35415 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35416 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]string)} 35417 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35418 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, values: values.([]string)} 35419 default: 35420 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35421 } 35422 return fpaov 35423 } 35424 35425 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 35426 return fp.WithIArrayOfValues(values) 35427 } 35428 35429 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue { 35430 switch fp.selector { 35431 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35432 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath: *fp, value: value.(string)} 35433 default: 35434 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fp.selector)) 35435 } 35436 } 35437 35438 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 35439 return fp.WithIArrayItemValue(value) 35440 } 35441 35442 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath struct { 35443 selector DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector 35444 subPath gotenobject.FieldPath 35445 } 35446 35447 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath)(nil) 35448 35449 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelector { 35450 return fps.selector 35451 } 35452 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) AsFivegNrSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath, bool) { 35453 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPath) 35454 return res, ok 35455 } 35456 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) AsEpsSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath, bool) { 35457 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPath) 35458 return res, ok 35459 } 35460 35461 // String returns path representation in proto convention 35462 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) String() string { 35463 return fps.selector.String() + "." + fps.subPath.String() 35464 } 35465 35466 // JSONString returns path representation is JSON convention 35467 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) JSONString() string { 35468 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 35469 } 35470 35471 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp 35472 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (values []interface{}) { 35473 switch fps.selector { 35474 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35475 values = append(values, fps.subPath.GetRaw(source.GetFivegNr())...) 35476 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35477 values = append(values, fps.subPath.GetRaw(source.GetEps())...) 35478 default: 35479 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fps.selector)) 35480 } 35481 return 35482 } 35483 35484 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) GetRaw(source proto.Message) []interface{} { 35485 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35486 } 35487 35488 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp 35489 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (interface{}, bool) { 35490 switch fps.selector { 35491 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35492 if source.GetFivegNr() == nil { 35493 return nil, false 35494 } 35495 return fps.subPath.GetSingleRaw(source.GetFivegNr()) 35496 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35497 if source.GetEps() == nil { 35498 return nil, false 35499 } 35500 return fps.subPath.GetSingleRaw(source.GetEps()) 35501 default: 35502 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fps.selector)) 35503 } 35504 } 35505 35506 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 35507 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35508 } 35509 35510 // GetDefault returns a default value of the field type 35511 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) GetDefault() interface{} { 35512 return fps.subPath.GetDefault() 35513 } 35514 35515 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) { 35516 if item != nil { 35517 switch fps.selector { 35518 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35519 fps.subPath.ClearValueRaw(item.FivegNr) 35520 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35521 fps.subPath.ClearValueRaw(item.Eps) 35522 default: 35523 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fps.selector)) 35524 } 35525 } 35526 } 35527 35528 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) ClearValueRaw(item proto.Message) { 35529 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35530 } 35531 35532 // IsLeaf - whether field path is holds simple value 35533 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) IsLeaf() bool { 35534 return fps.subPath.IsLeaf() 35535 } 35536 35537 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 35538 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath{selector: fps.selector}} 35539 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 35540 return iPaths 35541 } 35542 35543 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue { 35544 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 35545 } 35546 35547 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 35548 return fps.WithIValue(value) 35549 } 35550 35551 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues { 35552 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 35553 } 35554 35555 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 35556 return fps.WithIArrayOfValues(values) 35557 } 35558 35559 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue { 35560 return &DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 35561 } 35562 35563 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 35564 return fps.WithIArrayItemValue(value) 35565 } 35566 35567 // DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue allows storing values for ThreeGpp fields according to their type 35568 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue interface { 35569 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 35570 gotenobject.FieldPathValue 35571 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 35572 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (cmp int, comparable bool) 35573 } 35574 35575 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue, error) { 35576 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(pathStr) 35577 if err != nil { 35578 return nil, err 35579 } 35580 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 35581 if err != nil { 35582 return nil, status.Errorf(codes.InvalidArgument, "error parsing ThreeGpp field path value from %s: %v", valueStr, err) 35583 } 35584 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue), nil 35585 } 35586 35587 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue { 35588 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue(pathStr, valueStr) 35589 if err != nil { 35590 panic(err) 35591 } 35592 return fpv 35593 } 35594 35595 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue struct { 35596 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath 35597 value interface{} 35598 } 35599 35600 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue)(nil) 35601 35602 // GetRawValue returns raw value stored under selected path for 'ThreeGpp' as interface{} 35603 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) GetRawValue() interface{} { 35604 return fpv.value 35605 } 35606 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsFivegNrValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr, bool) { 35607 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 35608 return res, ok 35609 } 35610 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsEnabledLocksValue() ([]string, bool) { 35611 res, ok := fpv.value.([]string) 35612 return res, ok 35613 } 35614 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsEpsValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps, bool) { 35615 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 35616 return res, ok 35617 } 35618 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsImeiValue() (string, bool) { 35619 res, ok := fpv.value.(string) 35620 return res, ok 35621 } 35622 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsOperatorCodeValue() (string, bool) { 35623 res, ok := fpv.value.(string) 35624 return res, ok 35625 } 35626 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsOperatorNameValue() (string, bool) { 35627 res, ok := fpv.value.(string) 35628 return res, ok 35629 } 35630 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsPacketServiceStateValue() (string, bool) { 35631 res, ok := fpv.value.(string) 35632 return res, ok 35633 } 35634 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsPcoValue() (string, bool) { 35635 res, ok := fpv.value.(string) 35636 return res, ok 35637 } 35638 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) AsRegistrationStateValue() (string, bool) { 35639 res, ok := fpv.value.(string) 35640 return res, ok 35641 } 35642 35643 // SetTo stores value for selected field for object ThreeGpp 35644 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) { 35645 if *target == nil { 35646 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 35647 } 35648 switch fpv.selector { 35649 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35650 (*target).FivegNr = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 35651 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35652 (*target).EnabledLocks = fpv.value.([]string) 35653 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35654 (*target).Eps = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 35655 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35656 (*target).Imei = fpv.value.(string) 35657 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35658 (*target).OperatorCode = fpv.value.(string) 35659 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35660 (*target).OperatorName = fpv.value.(string) 35661 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35662 (*target).PacketServiceState = fpv.value.(string) 35663 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35664 (*target).Pco = fpv.value.(string) 35665 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35666 (*target).RegistrationState = fpv.value.(string) 35667 default: 35668 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fpv.selector)) 35669 } 35670 } 35671 35672 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) SetToRaw(target proto.Message) { 35673 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 35674 fpv.SetTo(&typedObject) 35675 } 35676 35677 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp'. 35678 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (int, bool) { 35679 switch fpv.selector { 35680 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35681 return 0, false 35682 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35683 return 0, false 35684 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35685 return 0, false 35686 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35687 leftValue := fpv.value.(string) 35688 rightValue := source.GetImei() 35689 if (leftValue) == (rightValue) { 35690 return 0, true 35691 } else if (leftValue) < (rightValue) { 35692 return -1, true 35693 } else { 35694 return 1, true 35695 } 35696 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35697 leftValue := fpv.value.(string) 35698 rightValue := source.GetOperatorCode() 35699 if (leftValue) == (rightValue) { 35700 return 0, true 35701 } else if (leftValue) < (rightValue) { 35702 return -1, true 35703 } else { 35704 return 1, true 35705 } 35706 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35707 leftValue := fpv.value.(string) 35708 rightValue := source.GetOperatorName() 35709 if (leftValue) == (rightValue) { 35710 return 0, true 35711 } else if (leftValue) < (rightValue) { 35712 return -1, true 35713 } else { 35714 return 1, true 35715 } 35716 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35717 leftValue := fpv.value.(string) 35718 rightValue := source.GetPacketServiceState() 35719 if (leftValue) == (rightValue) { 35720 return 0, true 35721 } else if (leftValue) < (rightValue) { 35722 return -1, true 35723 } else { 35724 return 1, true 35725 } 35726 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35727 leftValue := fpv.value.(string) 35728 rightValue := source.GetPco() 35729 if (leftValue) == (rightValue) { 35730 return 0, true 35731 } else if (leftValue) < (rightValue) { 35732 return -1, true 35733 } else { 35734 return 1, true 35735 } 35736 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35737 leftValue := fpv.value.(string) 35738 rightValue := source.GetRegistrationState() 35739 if (leftValue) == (rightValue) { 35740 return 0, true 35741 } else if (leftValue) < (rightValue) { 35742 return -1, true 35743 } else { 35744 return 1, true 35745 } 35746 default: 35747 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fpv.selector)) 35748 } 35749 } 35750 35751 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 35752 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35753 } 35754 35755 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue struct { 35756 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 35757 subPathValue gotenobject.FieldPathValue 35758 } 35759 35760 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue)(nil) 35761 35762 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) AsFivegNrPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue, bool) { 35763 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue) 35764 return res, ok 35765 } 35766 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) AsEpsPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue, bool) { 35767 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue) 35768 return res, ok 35769 } 35770 35771 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) { 35772 if *target == nil { 35773 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 35774 } 35775 switch fpvs.Selector() { 35776 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35777 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue).SetTo(&(*target).FivegNr) 35778 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35779 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue).SetTo(&(*target).Eps) 35780 default: 35781 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fpvs.Selector())) 35782 } 35783 } 35784 35785 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) SetToRaw(target proto.Message) { 35786 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 35787 fpvs.SetTo(&typedObject) 35788 } 35789 35790 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) GetRawValue() interface{} { 35791 return fpvs.subPathValue.GetRawValue() 35792 } 35793 35794 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (int, bool) { 35795 switch fpvs.Selector() { 35796 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35797 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathValue).CompareWith(source.GetFivegNr()) 35798 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35799 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathValue).CompareWith(source.GetEps()) 35800 default: 35801 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fpvs.Selector())) 35802 } 35803 } 35804 35805 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 35806 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35807 } 35808 35809 // DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue allows storing single item in Path-specific values for ThreeGpp according to their type 35810 // Present only for array (repeated) types. 35811 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue interface { 35812 gotenobject.FieldPathArrayItemValue 35813 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 35814 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) bool 35815 } 35816 35817 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 35818 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue, error) { 35819 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(pathStr) 35820 if err != nil { 35821 return nil, err 35822 } 35823 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 35824 if err != nil { 35825 return nil, status.Errorf(codes.InvalidArgument, "error parsing ThreeGpp field path array item value from %s: %v", valueStr, err) 35826 } 35827 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue), nil 35828 } 35829 35830 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue { 35831 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue(pathStr, valueStr) 35832 if err != nil { 35833 panic(err) 35834 } 35835 return fpaiv 35836 } 35837 35838 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue struct { 35839 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath 35840 value interface{} 35841 } 35842 35843 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue)(nil) 35844 35845 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp as interface{} 35846 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 35847 return fpaiv.value 35848 } 35849 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue) AsEnabledLocksItemValue() (string, bool) { 35850 res, ok := fpaiv.value.(string) 35851 return res, ok 35852 } 35853 35854 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) (interface{}, bool) { 35855 return nil, false 35856 } 35857 35858 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 35859 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)) 35860 } 35861 35862 // Contains returns a boolean indicating if value that is being held is present in given 'ThreeGpp' 35863 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) bool { 35864 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath.Get(source) 35865 for _, v := range slice { 35866 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 35867 if proto.Equal(asProtoMsg, v.(proto.Message)) { 35868 return true 35869 } 35870 } else if reflect.DeepEqual(v, fpaiv.value) { 35871 return true 35872 } 35873 } 35874 return false 35875 } 35876 35877 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayItemValue struct { 35878 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 35879 subPathItemValue gotenobject.FieldPathArrayItemValue 35880 } 35881 35882 // GetRawValue returns stored array item value 35883 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 35884 return fpaivs.subPathItemValue.GetRawItemValue() 35885 } 35886 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayItemValue) AsFivegNrPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue, bool) { 35887 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue) 35888 return res, ok 35889 } 35890 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayItemValue) AsEpsPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue, bool) { 35891 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue) 35892 return res, ok 35893 } 35894 35895 // Contains returns a boolean indicating if value that is being held is present in given 'ThreeGpp' 35896 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) bool { 35897 switch fpaivs.Selector() { 35898 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35899 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayItemValue).ContainsValue(source.GetFivegNr()) 35900 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35901 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayItemValue).ContainsValue(source.GetEps()) 35902 default: 35903 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp: %d", fpaivs.Selector())) 35904 } 35905 } 35906 35907 // DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues allows storing slice of values for ThreeGpp fields according to their type 35908 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues interface { 35909 gotenobject.FieldPathArrayOfValues 35910 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 35911 } 35912 35913 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues, error) { 35914 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(pathStr) 35915 if err != nil { 35916 return nil, err 35917 } 35918 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 35919 if err != nil { 35920 return nil, status.Errorf(codes.InvalidArgument, "error parsing ThreeGpp field path array of values from %s: %v", valuesStr, err) 35921 } 35922 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues), nil 35923 } 35924 35925 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues { 35926 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues(pathStr, valuesStr) 35927 if err != nil { 35928 panic(err) 35929 } 35930 return fpaov 35931 } 35932 35933 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues struct { 35934 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPath 35935 values interface{} 35936 } 35937 35938 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues)(nil) 35939 35940 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 35941 switch fpaov.selector { 35942 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorFivegNr: 35943 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) { 35944 values = append(values, v) 35945 } 35946 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEnabledLocks: 35947 for _, v := range fpaov.values.([][]string) { 35948 values = append(values, v) 35949 } 35950 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorEps: 35951 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) { 35952 values = append(values, v) 35953 } 35954 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorImei: 35955 for _, v := range fpaov.values.([]string) { 35956 values = append(values, v) 35957 } 35958 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorCode: 35959 for _, v := range fpaov.values.([]string) { 35960 values = append(values, v) 35961 } 35962 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorOperatorName: 35963 for _, v := range fpaov.values.([]string) { 35964 values = append(values, v) 35965 } 35966 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPacketServiceState: 35967 for _, v := range fpaov.values.([]string) { 35968 values = append(values, v) 35969 } 35970 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorPco: 35971 for _, v := range fpaov.values.([]string) { 35972 values = append(values, v) 35973 } 35974 case DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathSelectorRegistrationState: 35975 for _, v := range fpaov.values.([]string) { 35976 values = append(values, v) 35977 } 35978 } 35979 return 35980 } 35981 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsFivegNrArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr, bool) { 35982 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_FiveGNr) 35983 return res, ok 35984 } 35985 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsEnabledLocksArrayOfValues() ([][]string, bool) { 35986 res, ok := fpaov.values.([][]string) 35987 return res, ok 35988 } 35989 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsEpsArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps, bool) { 35990 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Eps) 35991 return res, ok 35992 } 35993 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsImeiArrayOfValues() ([]string, bool) { 35994 res, ok := fpaov.values.([]string) 35995 return res, ok 35996 } 35997 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsOperatorCodeArrayOfValues() ([]string, bool) { 35998 res, ok := fpaov.values.([]string) 35999 return res, ok 36000 } 36001 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsOperatorNameArrayOfValues() ([]string, bool) { 36002 res, ok := fpaov.values.([]string) 36003 return res, ok 36004 } 36005 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsPacketServiceStateArrayOfValues() ([]string, bool) { 36006 res, ok := fpaov.values.([]string) 36007 return res, ok 36008 } 36009 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsPcoArrayOfValues() ([]string, bool) { 36010 res, ok := fpaov.values.([]string) 36011 return res, ok 36012 } 36013 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldTerminalPathArrayOfValues) AsRegistrationStateArrayOfValues() ([]string, bool) { 36014 res, ok := fpaov.values.([]string) 36015 return res, ok 36016 } 36017 36018 type DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayOfValues struct { 36019 DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath 36020 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 36021 } 36022 36023 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayOfValues)(nil) 36024 36025 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 36026 return fpsaov.subPathArrayOfValues.GetRawValues() 36027 } 36028 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayOfValues) AsFivegNrPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues, bool) { 36029 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusFiveGNr_FieldPathArrayOfValues) 36030 return res, ok 36031 } 36032 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldSubPathArrayOfValues) AsEpsPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues, bool) { 36033 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusEps_FieldPathArrayOfValues) 36034 return res, ok 36035 } 36036 36037 // FieldPath provides implementation to handle 36038 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 36039 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath interface { 36040 gotenobject.FieldPath 36041 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector 36042 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) []interface{} 36043 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) (interface{}, bool) 36044 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 36045 36046 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue 36047 // (or array of values) and holds passed value. Panics if injected type is incorrect. 36048 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue 36049 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues 36050 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue 36051 } 36052 36053 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector int32 36054 36055 const ( 36056 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 0 36057 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 1 36058 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 2 36059 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 3 36060 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 4 36061 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 5 36062 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector = 6 36063 ) 36064 36065 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector) String() string { 36066 switch s { 36067 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36068 return "activation_state" 36069 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36070 return "cdma1x_registration_state" 36071 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36072 return "esn" 36073 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36074 return "evdo_registration_state" 36075 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36076 return "meid" 36077 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36078 return "nid" 36079 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36080 return "sid" 36081 default: 36082 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", s)) 36083 } 36084 } 36085 36086 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath, error) { 36087 if len(fp) == 0 { 36088 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma") 36089 } 36090 if len(fp) == 1 { 36091 switch fp[0] { 36092 case "activation_state", "activationState", "activation-state": 36093 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState}, nil 36094 case "cdma1x_registration_state", "cdma1xRegistrationState", "cdma1x-registration-state": 36095 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState}, nil 36096 case "esn": 36097 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn}, nil 36098 case "evdo_registration_state", "evdoRegistrationState", "evdo-registration-state": 36099 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState}, nil 36100 case "meid": 36101 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid}, nil 36102 case "nid": 36103 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid}, nil 36104 case "sid": 36105 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid}, nil 36106 } 36107 } 36108 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma", fp) 36109 } 36110 36111 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath, error) { 36112 fp, err := gotenobject.ParseRawFieldPath(rawField) 36113 if err != nil { 36114 return nil, err 36115 } 36116 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(fp) 36117 } 36118 36119 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath { 36120 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(rawField) 36121 if err != nil { 36122 panic(err) 36123 } 36124 return fp 36125 } 36126 36127 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath struct { 36128 selector DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector 36129 } 36130 36131 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath)(nil) 36132 36133 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelector { 36134 return fp.selector 36135 } 36136 36137 // String returns path representation in proto convention 36138 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) String() string { 36139 return fp.selector.String() 36140 } 36141 36142 // JSONString returns path representation is JSON convention 36143 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) JSONString() string { 36144 return strcase.ToLowerCamel(fp.String()) 36145 } 36146 36147 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma 36148 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) (values []interface{}) { 36149 if source != nil { 36150 switch fp.selector { 36151 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36152 values = append(values, source.ActivationState) 36153 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36154 values = append(values, source.Cdma1XRegistrationState) 36155 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36156 values = append(values, source.Esn) 36157 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36158 values = append(values, source.EvdoRegistrationState) 36159 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36160 values = append(values, source.Meid) 36161 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36162 values = append(values, source.Nid) 36163 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36164 values = append(values, source.Sid) 36165 default: 36166 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36167 } 36168 } 36169 return 36170 } 36171 36172 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 36173 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 36174 } 36175 36176 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma 36177 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) (interface{}, bool) { 36178 switch fp.selector { 36179 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36180 return source.GetActivationState(), source != nil 36181 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36182 return source.GetCdma1XRegistrationState(), source != nil 36183 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36184 return source.GetEsn(), source != nil 36185 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36186 return source.GetEvdoRegistrationState(), source != nil 36187 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36188 return source.GetMeid(), source != nil 36189 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36190 return source.GetNid(), source != nil 36191 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36192 return source.GetSid(), source != nil 36193 default: 36194 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36195 } 36196 } 36197 36198 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 36199 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 36200 } 36201 36202 // GetDefault returns a default value of the field type 36203 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) GetDefault() interface{} { 36204 switch fp.selector { 36205 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36206 return "" 36207 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36208 return "" 36209 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36210 return "" 36211 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36212 return "" 36213 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36214 return "" 36215 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36216 return "" 36217 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36218 return "" 36219 default: 36220 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36221 } 36222 } 36223 36224 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) { 36225 if item != nil { 36226 switch fp.selector { 36227 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36228 item.ActivationState = "" 36229 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36230 item.Cdma1XRegistrationState = "" 36231 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36232 item.Esn = "" 36233 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36234 item.EvdoRegistrationState = "" 36235 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36236 item.Meid = "" 36237 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36238 item.Nid = "" 36239 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36240 item.Sid = "" 36241 default: 36242 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36243 } 36244 } 36245 } 36246 36247 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) ClearValueRaw(item proto.Message) { 36248 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 36249 } 36250 36251 // IsLeaf - whether field path is holds simple value 36252 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) IsLeaf() bool { 36253 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState || 36254 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState || 36255 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn || 36256 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState || 36257 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid || 36258 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid || 36259 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid 36260 } 36261 36262 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 36263 return []gotenobject.FieldPath{fp} 36264 } 36265 36266 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue { 36267 switch fp.selector { 36268 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36269 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36270 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36271 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36272 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36273 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36274 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36275 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36276 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36277 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36278 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36279 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36280 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36281 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, value: value.(string)} 36282 default: 36283 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36284 } 36285 } 36286 36287 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 36288 return fp.WithIValue(value) 36289 } 36290 36291 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues { 36292 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp} 36293 switch fp.selector { 36294 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36295 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36296 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36297 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36298 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36299 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36300 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36301 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36302 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36303 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36304 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36305 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36306 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36307 return &DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath: *fp, values: values.([]string)} 36308 default: 36309 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36310 } 36311 return fpaov 36312 } 36313 36314 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 36315 return fp.WithIArrayOfValues(values) 36316 } 36317 36318 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue { 36319 switch fp.selector { 36320 default: 36321 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fp.selector)) 36322 } 36323 } 36324 36325 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 36326 return fp.WithIArrayItemValue(value) 36327 } 36328 36329 // DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue allows storing values for Cdma fields according to their type 36330 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue interface { 36331 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath 36332 gotenobject.FieldPathValue 36333 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 36334 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) (cmp int, comparable bool) 36335 } 36336 36337 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue, error) { 36338 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(pathStr) 36339 if err != nil { 36340 return nil, err 36341 } 36342 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 36343 if err != nil { 36344 return nil, status.Errorf(codes.InvalidArgument, "error parsing Cdma field path value from %s: %v", valueStr, err) 36345 } 36346 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue), nil 36347 } 36348 36349 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue { 36350 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue(pathStr, valueStr) 36351 if err != nil { 36352 panic(err) 36353 } 36354 return fpv 36355 } 36356 36357 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue struct { 36358 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath 36359 value interface{} 36360 } 36361 36362 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue)(nil) 36363 36364 // GetRawValue returns raw value stored under selected path for 'Cdma' as interface{} 36365 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) GetRawValue() interface{} { 36366 return fpv.value 36367 } 36368 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsActivationStateValue() (string, bool) { 36369 res, ok := fpv.value.(string) 36370 return res, ok 36371 } 36372 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsCdma1xRegistrationStateValue() (string, bool) { 36373 res, ok := fpv.value.(string) 36374 return res, ok 36375 } 36376 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsEsnValue() (string, bool) { 36377 res, ok := fpv.value.(string) 36378 return res, ok 36379 } 36380 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsEvdoRegistrationStateValue() (string, bool) { 36381 res, ok := fpv.value.(string) 36382 return res, ok 36383 } 36384 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsMeidValue() (string, bool) { 36385 res, ok := fpv.value.(string) 36386 return res, ok 36387 } 36388 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsNidValue() (string, bool) { 36389 res, ok := fpv.value.(string) 36390 return res, ok 36391 } 36392 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) AsSidValue() (string, bool) { 36393 res, ok := fpv.value.(string) 36394 return res, ok 36395 } 36396 36397 // SetTo stores value for selected field for object Cdma 36398 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) { 36399 if *target == nil { 36400 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 36401 } 36402 switch fpv.selector { 36403 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36404 (*target).ActivationState = fpv.value.(string) 36405 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36406 (*target).Cdma1XRegistrationState = fpv.value.(string) 36407 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36408 (*target).Esn = fpv.value.(string) 36409 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36410 (*target).EvdoRegistrationState = fpv.value.(string) 36411 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36412 (*target).Meid = fpv.value.(string) 36413 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36414 (*target).Nid = fpv.value.(string) 36415 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36416 (*target).Sid = fpv.value.(string) 36417 default: 36418 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fpv.selector)) 36419 } 36420 } 36421 36422 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) SetToRaw(target proto.Message) { 36423 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 36424 fpv.SetTo(&typedObject) 36425 } 36426 36427 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma'. 36428 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) (int, bool) { 36429 switch fpv.selector { 36430 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36431 leftValue := fpv.value.(string) 36432 rightValue := source.GetActivationState() 36433 if (leftValue) == (rightValue) { 36434 return 0, true 36435 } else if (leftValue) < (rightValue) { 36436 return -1, true 36437 } else { 36438 return 1, true 36439 } 36440 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36441 leftValue := fpv.value.(string) 36442 rightValue := source.GetCdma1XRegistrationState() 36443 if (leftValue) == (rightValue) { 36444 return 0, true 36445 } else if (leftValue) < (rightValue) { 36446 return -1, true 36447 } else { 36448 return 1, true 36449 } 36450 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36451 leftValue := fpv.value.(string) 36452 rightValue := source.GetEsn() 36453 if (leftValue) == (rightValue) { 36454 return 0, true 36455 } else if (leftValue) < (rightValue) { 36456 return -1, true 36457 } else { 36458 return 1, true 36459 } 36460 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36461 leftValue := fpv.value.(string) 36462 rightValue := source.GetEvdoRegistrationState() 36463 if (leftValue) == (rightValue) { 36464 return 0, true 36465 } else if (leftValue) < (rightValue) { 36466 return -1, true 36467 } else { 36468 return 1, true 36469 } 36470 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36471 leftValue := fpv.value.(string) 36472 rightValue := source.GetMeid() 36473 if (leftValue) == (rightValue) { 36474 return 0, true 36475 } else if (leftValue) < (rightValue) { 36476 return -1, true 36477 } else { 36478 return 1, true 36479 } 36480 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36481 leftValue := fpv.value.(string) 36482 rightValue := source.GetNid() 36483 if (leftValue) == (rightValue) { 36484 return 0, true 36485 } else if (leftValue) < (rightValue) { 36486 return -1, true 36487 } else { 36488 return 1, true 36489 } 36490 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36491 leftValue := fpv.value.(string) 36492 rightValue := source.GetSid() 36493 if (leftValue) == (rightValue) { 36494 return 0, true 36495 } else if (leftValue) < (rightValue) { 36496 return -1, true 36497 } else { 36498 return 1, true 36499 } 36500 default: 36501 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma: %d", fpv.selector)) 36502 } 36503 } 36504 36505 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 36506 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 36507 } 36508 36509 // DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue allows storing single item in Path-specific values for Cdma according to their type 36510 // Present only for array (repeated) types. 36511 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue interface { 36512 gotenobject.FieldPathArrayItemValue 36513 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath 36514 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) bool 36515 } 36516 36517 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 36518 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue, error) { 36519 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(pathStr) 36520 if err != nil { 36521 return nil, err 36522 } 36523 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 36524 if err != nil { 36525 return nil, status.Errorf(codes.InvalidArgument, "error parsing Cdma field path array item value from %s: %v", valueStr, err) 36526 } 36527 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue), nil 36528 } 36529 36530 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue { 36531 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue(pathStr, valueStr) 36532 if err != nil { 36533 panic(err) 36534 } 36535 return fpaiv 36536 } 36537 36538 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayItemValue struct { 36539 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath 36540 value interface{} 36541 } 36542 36543 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayItemValue)(nil) 36544 36545 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma as interface{} 36546 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 36547 return fpaiv.value 36548 } 36549 36550 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) (interface{}, bool) { 36551 return nil, false 36552 } 36553 36554 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 36555 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)) 36556 } 36557 36558 // Contains returns a boolean indicating if value that is being held is present in given 'Cdma' 36559 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) bool { 36560 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath.Get(source) 36561 for _, v := range slice { 36562 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 36563 if proto.Equal(asProtoMsg, v.(proto.Message)) { 36564 return true 36565 } 36566 } else if reflect.DeepEqual(v, fpaiv.value) { 36567 return true 36568 } 36569 } 36570 return false 36571 } 36572 36573 // DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues allows storing slice of values for Cdma fields according to their type 36574 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues interface { 36575 gotenobject.FieldPathArrayOfValues 36576 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath 36577 } 36578 36579 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues, error) { 36580 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(pathStr) 36581 if err != nil { 36582 return nil, err 36583 } 36584 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 36585 if err != nil { 36586 return nil, status.Errorf(codes.InvalidArgument, "error parsing Cdma field path array of values from %s: %v", valuesStr, err) 36587 } 36588 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues), nil 36589 } 36590 36591 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues { 36592 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues(pathStr, valuesStr) 36593 if err != nil { 36594 panic(err) 36595 } 36596 return fpaov 36597 } 36598 36599 type DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues struct { 36600 DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPath 36601 values interface{} 36602 } 36603 36604 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues)(nil) 36605 36606 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 36607 switch fpaov.selector { 36608 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorActivationState: 36609 for _, v := range fpaov.values.([]string) { 36610 values = append(values, v) 36611 } 36612 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorCdma1xRegistrationState: 36613 for _, v := range fpaov.values.([]string) { 36614 values = append(values, v) 36615 } 36616 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEsn: 36617 for _, v := range fpaov.values.([]string) { 36618 values = append(values, v) 36619 } 36620 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorEvdoRegistrationState: 36621 for _, v := range fpaov.values.([]string) { 36622 values = append(values, v) 36623 } 36624 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorMeid: 36625 for _, v := range fpaov.values.([]string) { 36626 values = append(values, v) 36627 } 36628 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorNid: 36629 for _, v := range fpaov.values.([]string) { 36630 values = append(values, v) 36631 } 36632 case DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathSelectorSid: 36633 for _, v := range fpaov.values.([]string) { 36634 values = append(values, v) 36635 } 36636 } 36637 return 36638 } 36639 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsActivationStateArrayOfValues() ([]string, bool) { 36640 res, ok := fpaov.values.([]string) 36641 return res, ok 36642 } 36643 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsCdma1xRegistrationStateArrayOfValues() ([]string, bool) { 36644 res, ok := fpaov.values.([]string) 36645 return res, ok 36646 } 36647 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsEsnArrayOfValues() ([]string, bool) { 36648 res, ok := fpaov.values.([]string) 36649 return res, ok 36650 } 36651 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsEvdoRegistrationStateArrayOfValues() ([]string, bool) { 36652 res, ok := fpaov.values.([]string) 36653 return res, ok 36654 } 36655 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsMeidArrayOfValues() ([]string, bool) { 36656 res, ok := fpaov.values.([]string) 36657 return res, ok 36658 } 36659 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsNidArrayOfValues() ([]string, bool) { 36660 res, ok := fpaov.values.([]string) 36661 return res, ok 36662 } 36663 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldTerminalPathArrayOfValues) AsSidArrayOfValues() ([]string, bool) { 36664 res, ok := fpaov.values.([]string) 36665 return res, ok 36666 } 36667 36668 // FieldPath provides implementation to handle 36669 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 36670 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath interface { 36671 gotenobject.FieldPath 36672 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector 36673 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) []interface{} 36674 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) (interface{}, bool) 36675 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 36676 36677 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue 36678 // (or array of values) and holds passed value. Panics if injected type is incorrect. 36679 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue 36680 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues 36681 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue 36682 } 36683 36684 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector int32 36685 36686 const ( 36687 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector = 0 36688 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector = 1 36689 ) 36690 36691 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector) String() string { 36692 switch s { 36693 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36694 return "recent" 36695 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36696 return "value" 36697 default: 36698 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", s)) 36699 } 36700 } 36701 36702 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath, error) { 36703 if len(fp) == 0 { 36704 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality") 36705 } 36706 if len(fp) == 1 { 36707 switch fp[0] { 36708 case "recent": 36709 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent}, nil 36710 case "value": 36711 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue}, nil 36712 } 36713 } 36714 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality", fp) 36715 } 36716 36717 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath, error) { 36718 fp, err := gotenobject.ParseRawFieldPath(rawField) 36719 if err != nil { 36720 return nil, err 36721 } 36722 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(fp) 36723 } 36724 36725 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath { 36726 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(rawField) 36727 if err != nil { 36728 panic(err) 36729 } 36730 return fp 36731 } 36732 36733 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath struct { 36734 selector DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector 36735 } 36736 36737 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath)(nil) 36738 36739 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelector { 36740 return fp.selector 36741 } 36742 36743 // String returns path representation in proto convention 36744 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) String() string { 36745 return fp.selector.String() 36746 } 36747 36748 // JSONString returns path representation is JSON convention 36749 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) JSONString() string { 36750 return strcase.ToLowerCamel(fp.String()) 36751 } 36752 36753 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality 36754 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) (values []interface{}) { 36755 if source != nil { 36756 switch fp.selector { 36757 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36758 values = append(values, source.Recent) 36759 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36760 values = append(values, source.Value) 36761 default: 36762 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36763 } 36764 } 36765 return 36766 } 36767 36768 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 36769 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 36770 } 36771 36772 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality 36773 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) (interface{}, bool) { 36774 switch fp.selector { 36775 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36776 return source.GetRecent(), source != nil 36777 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36778 return source.GetValue(), source != nil 36779 default: 36780 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36781 } 36782 } 36783 36784 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 36785 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 36786 } 36787 36788 // GetDefault returns a default value of the field type 36789 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) GetDefault() interface{} { 36790 switch fp.selector { 36791 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36792 return "" 36793 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36794 return "" 36795 default: 36796 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36797 } 36798 } 36799 36800 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) { 36801 if item != nil { 36802 switch fp.selector { 36803 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36804 item.Recent = "" 36805 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36806 item.Value = "" 36807 default: 36808 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36809 } 36810 } 36811 } 36812 36813 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) ClearValueRaw(item proto.Message) { 36814 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 36815 } 36816 36817 // IsLeaf - whether field path is holds simple value 36818 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) IsLeaf() bool { 36819 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent || 36820 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue 36821 } 36822 36823 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 36824 return []gotenobject.FieldPath{fp} 36825 } 36826 36827 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue { 36828 switch fp.selector { 36829 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36830 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: *fp, value: value.(string)} 36831 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36832 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: *fp, value: value.(string)} 36833 default: 36834 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36835 } 36836 } 36837 36838 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 36839 return fp.WithIValue(value) 36840 } 36841 36842 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues { 36843 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: *fp} 36844 switch fp.selector { 36845 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36846 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: *fp, values: values.([]string)} 36847 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36848 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath: *fp, values: values.([]string)} 36849 default: 36850 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36851 } 36852 return fpaov 36853 } 36854 36855 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 36856 return fp.WithIArrayOfValues(values) 36857 } 36858 36859 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue { 36860 switch fp.selector { 36861 default: 36862 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fp.selector)) 36863 } 36864 } 36865 36866 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 36867 return fp.WithIArrayItemValue(value) 36868 } 36869 36870 // DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue allows storing values for SignalQuality fields according to their type 36871 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue interface { 36872 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath 36873 gotenobject.FieldPathValue 36874 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 36875 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) (cmp int, comparable bool) 36876 } 36877 36878 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue, error) { 36879 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(pathStr) 36880 if err != nil { 36881 return nil, err 36882 } 36883 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 36884 if err != nil { 36885 return nil, status.Errorf(codes.InvalidArgument, "error parsing SignalQuality field path value from %s: %v", valueStr, err) 36886 } 36887 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue), nil 36888 } 36889 36890 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue { 36891 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue(pathStr, valueStr) 36892 if err != nil { 36893 panic(err) 36894 } 36895 return fpv 36896 } 36897 36898 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue struct { 36899 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath 36900 value interface{} 36901 } 36902 36903 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue)(nil) 36904 36905 // GetRawValue returns raw value stored under selected path for 'SignalQuality' as interface{} 36906 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) GetRawValue() interface{} { 36907 return fpv.value 36908 } 36909 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) AsRecentValue() (string, bool) { 36910 res, ok := fpv.value.(string) 36911 return res, ok 36912 } 36913 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) AsValueValue() (string, bool) { 36914 res, ok := fpv.value.(string) 36915 return res, ok 36916 } 36917 36918 // SetTo stores value for selected field for object SignalQuality 36919 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) { 36920 if *target == nil { 36921 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 36922 } 36923 switch fpv.selector { 36924 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36925 (*target).Recent = fpv.value.(string) 36926 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36927 (*target).Value = fpv.value.(string) 36928 default: 36929 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fpv.selector)) 36930 } 36931 } 36932 36933 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) SetToRaw(target proto.Message) { 36934 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 36935 fpv.SetTo(&typedObject) 36936 } 36937 36938 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality'. 36939 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) (int, bool) { 36940 switch fpv.selector { 36941 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 36942 leftValue := fpv.value.(string) 36943 rightValue := source.GetRecent() 36944 if (leftValue) == (rightValue) { 36945 return 0, true 36946 } else if (leftValue) < (rightValue) { 36947 return -1, true 36948 } else { 36949 return 1, true 36950 } 36951 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 36952 leftValue := fpv.value.(string) 36953 rightValue := source.GetValue() 36954 if (leftValue) == (rightValue) { 36955 return 0, true 36956 } else if (leftValue) < (rightValue) { 36957 return -1, true 36958 } else { 36959 return 1, true 36960 } 36961 default: 36962 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality: %d", fpv.selector)) 36963 } 36964 } 36965 36966 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 36967 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 36968 } 36969 36970 // DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue allows storing single item in Path-specific values for SignalQuality according to their type 36971 // Present only for array (repeated) types. 36972 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue interface { 36973 gotenobject.FieldPathArrayItemValue 36974 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath 36975 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) bool 36976 } 36977 36978 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 36979 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue, error) { 36980 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(pathStr) 36981 if err != nil { 36982 return nil, err 36983 } 36984 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 36985 if err != nil { 36986 return nil, status.Errorf(codes.InvalidArgument, "error parsing SignalQuality field path array item value from %s: %v", valueStr, err) 36987 } 36988 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue), nil 36989 } 36990 36991 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue { 36992 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue(pathStr, valueStr) 36993 if err != nil { 36994 panic(err) 36995 } 36996 return fpaiv 36997 } 36998 36999 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayItemValue struct { 37000 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath 37001 value interface{} 37002 } 37003 37004 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayItemValue)(nil) 37005 37006 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality as interface{} 37007 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 37008 return fpaiv.value 37009 } 37010 37011 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) (interface{}, bool) { 37012 return nil, false 37013 } 37014 37015 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 37016 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)) 37017 } 37018 37019 // Contains returns a boolean indicating if value that is being held is present in given 'SignalQuality' 37020 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) bool { 37021 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath.Get(source) 37022 for _, v := range slice { 37023 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 37024 if proto.Equal(asProtoMsg, v.(proto.Message)) { 37025 return true 37026 } 37027 } else if reflect.DeepEqual(v, fpaiv.value) { 37028 return true 37029 } 37030 } 37031 return false 37032 } 37033 37034 // DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues allows storing slice of values for SignalQuality fields according to their type 37035 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues interface { 37036 gotenobject.FieldPathArrayOfValues 37037 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath 37038 } 37039 37040 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues, error) { 37041 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(pathStr) 37042 if err != nil { 37043 return nil, err 37044 } 37045 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 37046 if err != nil { 37047 return nil, status.Errorf(codes.InvalidArgument, "error parsing SignalQuality field path array of values from %s: %v", valuesStr, err) 37048 } 37049 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues), nil 37050 } 37051 37052 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues { 37053 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues(pathStr, valuesStr) 37054 if err != nil { 37055 panic(err) 37056 } 37057 return fpaov 37058 } 37059 37060 type DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues struct { 37061 DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPath 37062 values interface{} 37063 } 37064 37065 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues)(nil) 37066 37067 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 37068 switch fpaov.selector { 37069 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorRecent: 37070 for _, v := range fpaov.values.([]string) { 37071 values = append(values, v) 37072 } 37073 case DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathSelectorValue: 37074 for _, v := range fpaov.values.([]string) { 37075 values = append(values, v) 37076 } 37077 } 37078 return 37079 } 37080 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues) AsRecentArrayOfValues() ([]string, bool) { 37081 res, ok := fpaov.values.([]string) 37082 return res, ok 37083 } 37084 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldTerminalPathArrayOfValues) AsValueArrayOfValues() ([]string, bool) { 37085 res, ok := fpaov.values.([]string) 37086 return res, ok 37087 } 37088 37089 // FieldPath provides implementation to handle 37090 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 37091 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath interface { 37092 gotenobject.FieldPath 37093 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector 37094 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) []interface{} 37095 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (interface{}, bool) 37096 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 37097 37098 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue 37099 // (or array of values) and holds passed value. Panics if injected type is incorrect. 37100 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue 37101 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues 37102 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue 37103 } 37104 37105 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector int32 37106 37107 const ( 37108 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 0 37109 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 1 37110 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 2 37111 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 3 37112 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 4 37113 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 5 37114 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 6 37115 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 7 37116 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 8 37117 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 9 37118 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 10 37119 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 11 37120 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 12 37121 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 13 37122 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 14 37123 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 15 37124 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 16 37125 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 17 37126 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 18 37127 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 19 37128 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 20 37129 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 21 37130 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 22 37131 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 23 37132 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 24 37133 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 25 37134 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 26 37135 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 27 37136 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 28 37137 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 29 37138 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 30 37139 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector = 31 37140 ) 37141 37142 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector) String() string { 37143 switch s { 37144 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37145 return "access_technologies" 37146 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37147 return "bearers" 37148 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37149 return "carrier_configuration" 37150 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37151 return "carrier_configuration_revision" 37152 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37153 return "current_bands" 37154 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37155 return "current_capabilities" 37156 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37157 return "current_modes" 37158 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37159 return "device" 37160 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37161 return "device_identifier" 37162 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37163 return "drivers" 37164 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37165 return "equipment_identifier" 37166 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37167 return "hardware_revision" 37168 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37169 return "manufacturer" 37170 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37171 return "model" 37172 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37173 return "own_numbers" 37174 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37175 return "plugin" 37176 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37177 return "ports" 37178 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37179 return "power_state" 37180 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37181 return "primary_port" 37182 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37183 return "primary_sim_slot" 37184 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37185 return "revision" 37186 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37187 return "signal_quality" 37188 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37189 return "sim" 37190 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37191 return "sim_slots" 37192 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37193 return "state" 37194 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37195 return "state_failed_reason" 37196 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37197 return "supported_bands" 37198 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37199 return "supported_capabilities" 37200 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37201 return "supported_ip_families" 37202 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37203 return "supported_modes" 37204 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37205 return "unlock_required" 37206 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37207 return "unlock_retries" 37208 default: 37209 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", s)) 37210 } 37211 } 37212 37213 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath, error) { 37214 if len(fp) == 0 { 37215 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic") 37216 } 37217 if len(fp) == 1 { 37218 switch fp[0] { 37219 case "access_technologies", "accessTechnologies", "access-technologies": 37220 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies}, nil 37221 case "bearers": 37222 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers}, nil 37223 case "carrier_configuration", "carrierConfiguration", "carrier-configuration": 37224 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration}, nil 37225 case "carrier_configuration_revision", "carrierConfigurationRevision", "carrier-configuration-revision": 37226 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision}, nil 37227 case "current_bands", "currentBands", "current-bands": 37228 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands}, nil 37229 case "current_capabilities", "currentCapabilities", "current-capabilities": 37230 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities}, nil 37231 case "current_modes", "currentModes", "current-modes": 37232 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes}, nil 37233 case "device": 37234 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice}, nil 37235 case "device_identifier", "deviceIdentifier", "device-identifier": 37236 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier}, nil 37237 case "drivers": 37238 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers}, nil 37239 case "equipment_identifier", "equipmentIdentifier", "equipment-identifier": 37240 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier}, nil 37241 case "hardware_revision", "hardwareRevision", "hardware-revision": 37242 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision}, nil 37243 case "manufacturer": 37244 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer}, nil 37245 case "model": 37246 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel}, nil 37247 case "own_numbers", "ownNumbers", "own-numbers": 37248 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers}, nil 37249 case "plugin": 37250 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin}, nil 37251 case "ports": 37252 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts}, nil 37253 case "power_state", "powerState", "power-state": 37254 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState}, nil 37255 case "primary_port", "primaryPort", "primary-port": 37256 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort}, nil 37257 case "primary_sim_slot", "primarySimSlot", "primary-sim-slot": 37258 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot}, nil 37259 case "revision": 37260 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision}, nil 37261 case "signal_quality", "signalQuality", "signal-quality": 37262 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality}, nil 37263 case "sim": 37264 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim}, nil 37265 case "sim_slots", "simSlots", "sim-slots": 37266 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots}, nil 37267 case "state": 37268 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState}, nil 37269 case "state_failed_reason", "stateFailedReason", "state-failed-reason": 37270 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason}, nil 37271 case "supported_bands", "supportedBands", "supported-bands": 37272 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands}, nil 37273 case "supported_capabilities", "supportedCapabilities", "supported-capabilities": 37274 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities}, nil 37275 case "supported_ip_families", "supportedIpFamilies", "supported-ip-families": 37276 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies}, nil 37277 case "supported_modes", "supportedModes", "supported-modes": 37278 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes}, nil 37279 case "unlock_required", "unlockRequired", "unlock-required": 37280 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired}, nil 37281 case "unlock_retries", "unlockRetries", "unlock-retries": 37282 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries}, nil 37283 } 37284 } else { 37285 switch fp[0] { 37286 case "signal_quality", "signalQuality", "signal-quality": 37287 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath(fp[1:]); err != nil { 37288 return nil, err 37289 } else { 37290 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality, subPath: subpath}, nil 37291 } 37292 } 37293 } 37294 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic", fp) 37295 } 37296 37297 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath, error) { 37298 fp, err := gotenobject.ParseRawFieldPath(rawField) 37299 if err != nil { 37300 return nil, err 37301 } 37302 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(fp) 37303 } 37304 37305 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath { 37306 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(rawField) 37307 if err != nil { 37308 panic(err) 37309 } 37310 return fp 37311 } 37312 37313 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath struct { 37314 selector DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector 37315 } 37316 37317 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath)(nil) 37318 37319 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector { 37320 return fp.selector 37321 } 37322 37323 // String returns path representation in proto convention 37324 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) String() string { 37325 return fp.selector.String() 37326 } 37327 37328 // JSONString returns path representation is JSON convention 37329 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) JSONString() string { 37330 return strcase.ToLowerCamel(fp.String()) 37331 } 37332 37333 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic 37334 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (values []interface{}) { 37335 if source != nil { 37336 switch fp.selector { 37337 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37338 for _, value := range source.GetAccessTechnologies() { 37339 values = append(values, value) 37340 } 37341 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37342 for _, value := range source.GetBearers() { 37343 values = append(values, value) 37344 } 37345 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37346 values = append(values, source.CarrierConfiguration) 37347 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37348 values = append(values, source.CarrierConfigurationRevision) 37349 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37350 for _, value := range source.GetCurrentBands() { 37351 values = append(values, value) 37352 } 37353 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37354 for _, value := range source.GetCurrentCapabilities() { 37355 values = append(values, value) 37356 } 37357 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37358 values = append(values, source.CurrentModes) 37359 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37360 values = append(values, source.Device) 37361 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37362 values = append(values, source.DeviceIdentifier) 37363 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37364 for _, value := range source.GetDrivers() { 37365 values = append(values, value) 37366 } 37367 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37368 values = append(values, source.EquipmentIdentifier) 37369 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37370 values = append(values, source.HardwareRevision) 37371 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37372 values = append(values, source.Manufacturer) 37373 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37374 values = append(values, source.Model) 37375 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37376 for _, value := range source.GetOwnNumbers() { 37377 values = append(values, value) 37378 } 37379 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37380 values = append(values, source.Plugin) 37381 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37382 for _, value := range source.GetPorts() { 37383 values = append(values, value) 37384 } 37385 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37386 values = append(values, source.PowerState) 37387 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37388 values = append(values, source.PrimaryPort) 37389 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37390 values = append(values, source.PrimarySimSlot) 37391 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37392 values = append(values, source.Revision) 37393 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37394 if source.SignalQuality != nil { 37395 values = append(values, source.SignalQuality) 37396 } 37397 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37398 values = append(values, source.Sim) 37399 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37400 for _, value := range source.GetSimSlots() { 37401 values = append(values, value) 37402 } 37403 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37404 values = append(values, source.State) 37405 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37406 values = append(values, source.StateFailedReason) 37407 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37408 for _, value := range source.GetSupportedBands() { 37409 values = append(values, value) 37410 } 37411 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37412 for _, value := range source.GetSupportedCapabilities() { 37413 values = append(values, value) 37414 } 37415 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37416 for _, value := range source.GetSupportedIpFamilies() { 37417 values = append(values, value) 37418 } 37419 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37420 for _, value := range source.GetSupportedModes() { 37421 values = append(values, value) 37422 } 37423 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37424 values = append(values, source.UnlockRequired) 37425 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37426 for _, value := range source.GetUnlockRetries() { 37427 values = append(values, value) 37428 } 37429 default: 37430 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37431 } 37432 } 37433 return 37434 } 37435 37436 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 37437 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 37438 } 37439 37440 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic 37441 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (interface{}, bool) { 37442 switch fp.selector { 37443 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37444 res := source.GetAccessTechnologies() 37445 return res, res != nil 37446 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37447 res := source.GetBearers() 37448 return res, res != nil 37449 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37450 return source.GetCarrierConfiguration(), source != nil 37451 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37452 return source.GetCarrierConfigurationRevision(), source != nil 37453 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37454 res := source.GetCurrentBands() 37455 return res, res != nil 37456 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37457 res := source.GetCurrentCapabilities() 37458 return res, res != nil 37459 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37460 return source.GetCurrentModes(), source != nil 37461 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37462 return source.GetDevice(), source != nil 37463 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37464 return source.GetDeviceIdentifier(), source != nil 37465 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37466 res := source.GetDrivers() 37467 return res, res != nil 37468 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37469 return source.GetEquipmentIdentifier(), source != nil 37470 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37471 return source.GetHardwareRevision(), source != nil 37472 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37473 return source.GetManufacturer(), source != nil 37474 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37475 return source.GetModel(), source != nil 37476 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37477 res := source.GetOwnNumbers() 37478 return res, res != nil 37479 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37480 return source.GetPlugin(), source != nil 37481 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37482 res := source.GetPorts() 37483 return res, res != nil 37484 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37485 return source.GetPowerState(), source != nil 37486 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37487 return source.GetPrimaryPort(), source != nil 37488 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37489 return source.GetPrimarySimSlot(), source != nil 37490 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37491 return source.GetRevision(), source != nil 37492 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37493 res := source.GetSignalQuality() 37494 return res, res != nil 37495 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37496 return source.GetSim(), source != nil 37497 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37498 res := source.GetSimSlots() 37499 return res, res != nil 37500 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37501 return source.GetState(), source != nil 37502 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37503 return source.GetStateFailedReason(), source != nil 37504 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37505 res := source.GetSupportedBands() 37506 return res, res != nil 37507 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37508 res := source.GetSupportedCapabilities() 37509 return res, res != nil 37510 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37511 res := source.GetSupportedIpFamilies() 37512 return res, res != nil 37513 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37514 res := source.GetSupportedModes() 37515 return res, res != nil 37516 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37517 return source.GetUnlockRequired(), source != nil 37518 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37519 res := source.GetUnlockRetries() 37520 return res, res != nil 37521 default: 37522 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37523 } 37524 } 37525 37526 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 37527 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 37528 } 37529 37530 // GetDefault returns a default value of the field type 37531 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) GetDefault() interface{} { 37532 switch fp.selector { 37533 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37534 return ([]string)(nil) 37535 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37536 return ([]string)(nil) 37537 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37538 return "" 37539 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37540 return "" 37541 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37542 return ([]string)(nil) 37543 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37544 return ([]string)(nil) 37545 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37546 return "" 37547 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37548 return "" 37549 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37550 return "" 37551 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37552 return ([]string)(nil) 37553 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37554 return "" 37555 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37556 return "" 37557 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37558 return "" 37559 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37560 return "" 37561 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37562 return ([]string)(nil) 37563 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37564 return "" 37565 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37566 return ([]string)(nil) 37567 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37568 return "" 37569 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37570 return "" 37571 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37572 return "" 37573 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37574 return "" 37575 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37576 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)(nil) 37577 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37578 return "" 37579 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37580 return ([]string)(nil) 37581 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37582 return "" 37583 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37584 return "" 37585 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37586 return ([]string)(nil) 37587 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37588 return ([]string)(nil) 37589 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37590 return ([]string)(nil) 37591 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37592 return ([]string)(nil) 37593 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37594 return "" 37595 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37596 return ([]string)(nil) 37597 default: 37598 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37599 } 37600 } 37601 37602 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) { 37603 if item != nil { 37604 switch fp.selector { 37605 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37606 item.AccessTechnologies = nil 37607 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37608 item.Bearers = nil 37609 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37610 item.CarrierConfiguration = "" 37611 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37612 item.CarrierConfigurationRevision = "" 37613 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37614 item.CurrentBands = nil 37615 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37616 item.CurrentCapabilities = nil 37617 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37618 item.CurrentModes = "" 37619 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37620 item.Device = "" 37621 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37622 item.DeviceIdentifier = "" 37623 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37624 item.Drivers = nil 37625 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37626 item.EquipmentIdentifier = "" 37627 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37628 item.HardwareRevision = "" 37629 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37630 item.Manufacturer = "" 37631 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37632 item.Model = "" 37633 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37634 item.OwnNumbers = nil 37635 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37636 item.Plugin = "" 37637 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37638 item.Ports = nil 37639 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37640 item.PowerState = "" 37641 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37642 item.PrimaryPort = "" 37643 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37644 item.PrimarySimSlot = "" 37645 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37646 item.Revision = "" 37647 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37648 item.SignalQuality = nil 37649 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37650 item.Sim = "" 37651 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37652 item.SimSlots = nil 37653 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37654 item.State = "" 37655 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37656 item.StateFailedReason = "" 37657 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37658 item.SupportedBands = nil 37659 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37660 item.SupportedCapabilities = nil 37661 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37662 item.SupportedIpFamilies = nil 37663 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37664 item.SupportedModes = nil 37665 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37666 item.UnlockRequired = "" 37667 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37668 item.UnlockRetries = nil 37669 default: 37670 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37671 } 37672 } 37673 } 37674 37675 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) ClearValueRaw(item proto.Message) { 37676 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 37677 } 37678 37679 // IsLeaf - whether field path is holds simple value 37680 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) IsLeaf() bool { 37681 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies || 37682 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers || 37683 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration || 37684 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision || 37685 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands || 37686 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities || 37687 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes || 37688 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice || 37689 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier || 37690 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers || 37691 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier || 37692 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision || 37693 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer || 37694 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel || 37695 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers || 37696 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin || 37697 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts || 37698 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState || 37699 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort || 37700 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot || 37701 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision || 37702 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim || 37703 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots || 37704 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState || 37705 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason || 37706 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands || 37707 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities || 37708 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies || 37709 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes || 37710 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired || 37711 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries 37712 } 37713 37714 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 37715 return []gotenobject.FieldPath{fp} 37716 } 37717 37718 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue { 37719 switch fp.selector { 37720 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37721 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37722 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37723 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37724 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37725 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37726 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37727 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37728 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37729 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37730 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37731 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37732 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37733 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37734 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37735 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37736 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37737 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37738 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37739 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37740 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37741 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37742 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37743 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37744 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37745 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37746 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37747 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37748 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37749 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37750 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37751 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37752 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37753 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37754 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37755 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37756 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37757 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37758 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37759 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37760 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37761 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37762 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37763 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)} 37764 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37765 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37766 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37767 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37768 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37769 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37770 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37771 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37772 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37773 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37774 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37775 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37776 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37777 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37778 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37779 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37780 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37781 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37782 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37783 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.([]string)} 37784 default: 37785 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37786 } 37787 } 37788 37789 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 37790 return fp.WithIValue(value) 37791 } 37792 37793 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues { 37794 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp} 37795 switch fp.selector { 37796 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37797 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37798 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37799 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37800 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 37801 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37802 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 37803 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37804 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37805 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37806 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37807 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37808 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 37809 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37810 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 37811 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37812 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 37813 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37814 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37815 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37816 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 37817 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37818 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 37819 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37820 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 37821 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37822 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 37823 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37824 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37825 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37826 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 37827 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37828 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37829 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37830 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 37831 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37832 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 37833 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37834 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 37835 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37836 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 37837 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37838 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37839 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality)} 37840 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 37841 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37842 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37843 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37844 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 37845 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37846 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 37847 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37848 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37849 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37850 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37851 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37852 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37853 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37854 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37855 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37856 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 37857 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([]string)} 37858 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37859 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, values: values.([][]string)} 37860 default: 37861 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37862 } 37863 return fpaov 37864 } 37865 37866 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 37867 return fp.WithIArrayOfValues(values) 37868 } 37869 37870 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue { 37871 switch fp.selector { 37872 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 37873 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37874 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 37875 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37876 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 37877 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37878 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 37879 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37880 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 37881 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37882 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 37883 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37884 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 37885 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37886 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 37887 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37888 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 37889 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37890 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 37891 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37892 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 37893 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37894 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 37895 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37896 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 37897 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath: *fp, value: value.(string)} 37898 default: 37899 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fp.selector)) 37900 } 37901 } 37902 37903 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 37904 return fp.WithIArrayItemValue(value) 37905 } 37906 37907 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath struct { 37908 selector DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector 37909 subPath gotenobject.FieldPath 37910 } 37911 37912 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath)(nil) 37913 37914 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelector { 37915 return fps.selector 37916 } 37917 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) AsSignalQualitySubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath, bool) { 37918 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPath) 37919 return res, ok 37920 } 37921 37922 // String returns path representation in proto convention 37923 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) String() string { 37924 return fps.selector.String() + "." + fps.subPath.String() 37925 } 37926 37927 // JSONString returns path representation is JSON convention 37928 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) JSONString() string { 37929 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 37930 } 37931 37932 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic 37933 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (values []interface{}) { 37934 switch fps.selector { 37935 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37936 values = append(values, fps.subPath.GetRaw(source.GetSignalQuality())...) 37937 default: 37938 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fps.selector)) 37939 } 37940 return 37941 } 37942 37943 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) GetRaw(source proto.Message) []interface{} { 37944 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 37945 } 37946 37947 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic 37948 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (interface{}, bool) { 37949 switch fps.selector { 37950 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37951 if source.GetSignalQuality() == nil { 37952 return nil, false 37953 } 37954 return fps.subPath.GetSingleRaw(source.GetSignalQuality()) 37955 default: 37956 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fps.selector)) 37957 } 37958 } 37959 37960 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 37961 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 37962 } 37963 37964 // GetDefault returns a default value of the field type 37965 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) GetDefault() interface{} { 37966 return fps.subPath.GetDefault() 37967 } 37968 37969 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) { 37970 if item != nil { 37971 switch fps.selector { 37972 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 37973 fps.subPath.ClearValueRaw(item.SignalQuality) 37974 default: 37975 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fps.selector)) 37976 } 37977 } 37978 } 37979 37980 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) ClearValueRaw(item proto.Message) { 37981 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 37982 } 37983 37984 // IsLeaf - whether field path is holds simple value 37985 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) IsLeaf() bool { 37986 return fps.subPath.IsLeaf() 37987 } 37988 37989 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 37990 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath{selector: fps.selector}} 37991 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 37992 return iPaths 37993 } 37994 37995 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue { 37996 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 37997 } 37998 37999 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 38000 return fps.WithIValue(value) 38001 } 38002 38003 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues { 38004 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 38005 } 38006 38007 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 38008 return fps.WithIArrayOfValues(values) 38009 } 38010 38011 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue { 38012 return &DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 38013 } 38014 38015 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 38016 return fps.WithIArrayItemValue(value) 38017 } 38018 38019 // DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue allows storing values for Generic fields according to their type 38020 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue interface { 38021 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 38022 gotenobject.FieldPathValue 38023 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 38024 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (cmp int, comparable bool) 38025 } 38026 38027 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue, error) { 38028 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(pathStr) 38029 if err != nil { 38030 return nil, err 38031 } 38032 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 38033 if err != nil { 38034 return nil, status.Errorf(codes.InvalidArgument, "error parsing Generic field path value from %s: %v", valueStr, err) 38035 } 38036 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue), nil 38037 } 38038 38039 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue { 38040 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue(pathStr, valueStr) 38041 if err != nil { 38042 panic(err) 38043 } 38044 return fpv 38045 } 38046 38047 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue struct { 38048 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath 38049 value interface{} 38050 } 38051 38052 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue)(nil) 38053 38054 // GetRawValue returns raw value stored under selected path for 'Generic' as interface{} 38055 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) GetRawValue() interface{} { 38056 return fpv.value 38057 } 38058 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsAccessTechnologiesValue() ([]string, bool) { 38059 res, ok := fpv.value.([]string) 38060 return res, ok 38061 } 38062 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsBearersValue() ([]string, bool) { 38063 res, ok := fpv.value.([]string) 38064 return res, ok 38065 } 38066 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsCarrierConfigurationValue() (string, bool) { 38067 res, ok := fpv.value.(string) 38068 return res, ok 38069 } 38070 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsCarrierConfigurationRevisionValue() (string, bool) { 38071 res, ok := fpv.value.(string) 38072 return res, ok 38073 } 38074 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsCurrentBandsValue() ([]string, bool) { 38075 res, ok := fpv.value.([]string) 38076 return res, ok 38077 } 38078 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsCurrentCapabilitiesValue() ([]string, bool) { 38079 res, ok := fpv.value.([]string) 38080 return res, ok 38081 } 38082 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsCurrentModesValue() (string, bool) { 38083 res, ok := fpv.value.(string) 38084 return res, ok 38085 } 38086 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsDeviceValue() (string, bool) { 38087 res, ok := fpv.value.(string) 38088 return res, ok 38089 } 38090 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsDeviceIdentifierValue() (string, bool) { 38091 res, ok := fpv.value.(string) 38092 return res, ok 38093 } 38094 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsDriversValue() ([]string, bool) { 38095 res, ok := fpv.value.([]string) 38096 return res, ok 38097 } 38098 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsEquipmentIdentifierValue() (string, bool) { 38099 res, ok := fpv.value.(string) 38100 return res, ok 38101 } 38102 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsHardwareRevisionValue() (string, bool) { 38103 res, ok := fpv.value.(string) 38104 return res, ok 38105 } 38106 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsManufacturerValue() (string, bool) { 38107 res, ok := fpv.value.(string) 38108 return res, ok 38109 } 38110 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsModelValue() (string, bool) { 38111 res, ok := fpv.value.(string) 38112 return res, ok 38113 } 38114 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsOwnNumbersValue() ([]string, bool) { 38115 res, ok := fpv.value.([]string) 38116 return res, ok 38117 } 38118 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsPluginValue() (string, bool) { 38119 res, ok := fpv.value.(string) 38120 return res, ok 38121 } 38122 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsPortsValue() ([]string, bool) { 38123 res, ok := fpv.value.([]string) 38124 return res, ok 38125 } 38126 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsPowerStateValue() (string, bool) { 38127 res, ok := fpv.value.(string) 38128 return res, ok 38129 } 38130 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsPrimaryPortValue() (string, bool) { 38131 res, ok := fpv.value.(string) 38132 return res, ok 38133 } 38134 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsPrimarySimSlotValue() (string, bool) { 38135 res, ok := fpv.value.(string) 38136 return res, ok 38137 } 38138 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsRevisionValue() (string, bool) { 38139 res, ok := fpv.value.(string) 38140 return res, ok 38141 } 38142 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSignalQualityValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality, bool) { 38143 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 38144 return res, ok 38145 } 38146 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSimValue() (string, bool) { 38147 res, ok := fpv.value.(string) 38148 return res, ok 38149 } 38150 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSimSlotsValue() ([]string, bool) { 38151 res, ok := fpv.value.([]string) 38152 return res, ok 38153 } 38154 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsStateValue() (string, bool) { 38155 res, ok := fpv.value.(string) 38156 return res, ok 38157 } 38158 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsStateFailedReasonValue() (string, bool) { 38159 res, ok := fpv.value.(string) 38160 return res, ok 38161 } 38162 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSupportedBandsValue() ([]string, bool) { 38163 res, ok := fpv.value.([]string) 38164 return res, ok 38165 } 38166 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSupportedCapabilitiesValue() ([]string, bool) { 38167 res, ok := fpv.value.([]string) 38168 return res, ok 38169 } 38170 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSupportedIpFamiliesValue() ([]string, bool) { 38171 res, ok := fpv.value.([]string) 38172 return res, ok 38173 } 38174 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsSupportedModesValue() ([]string, bool) { 38175 res, ok := fpv.value.([]string) 38176 return res, ok 38177 } 38178 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsUnlockRequiredValue() (string, bool) { 38179 res, ok := fpv.value.(string) 38180 return res, ok 38181 } 38182 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) AsUnlockRetriesValue() ([]string, bool) { 38183 res, ok := fpv.value.([]string) 38184 return res, ok 38185 } 38186 38187 // SetTo stores value for selected field for object Generic 38188 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) { 38189 if *target == nil { 38190 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 38191 } 38192 switch fpv.selector { 38193 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 38194 (*target).AccessTechnologies = fpv.value.([]string) 38195 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 38196 (*target).Bearers = fpv.value.([]string) 38197 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 38198 (*target).CarrierConfiguration = fpv.value.(string) 38199 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 38200 (*target).CarrierConfigurationRevision = fpv.value.(string) 38201 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 38202 (*target).CurrentBands = fpv.value.([]string) 38203 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 38204 (*target).CurrentCapabilities = fpv.value.([]string) 38205 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 38206 (*target).CurrentModes = fpv.value.(string) 38207 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 38208 (*target).Device = fpv.value.(string) 38209 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 38210 (*target).DeviceIdentifier = fpv.value.(string) 38211 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 38212 (*target).Drivers = fpv.value.([]string) 38213 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 38214 (*target).EquipmentIdentifier = fpv.value.(string) 38215 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 38216 (*target).HardwareRevision = fpv.value.(string) 38217 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 38218 (*target).Manufacturer = fpv.value.(string) 38219 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 38220 (*target).Model = fpv.value.(string) 38221 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 38222 (*target).OwnNumbers = fpv.value.([]string) 38223 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 38224 (*target).Plugin = fpv.value.(string) 38225 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 38226 (*target).Ports = fpv.value.([]string) 38227 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 38228 (*target).PowerState = fpv.value.(string) 38229 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 38230 (*target).PrimaryPort = fpv.value.(string) 38231 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 38232 (*target).PrimarySimSlot = fpv.value.(string) 38233 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 38234 (*target).Revision = fpv.value.(string) 38235 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 38236 (*target).SignalQuality = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 38237 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 38238 (*target).Sim = fpv.value.(string) 38239 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 38240 (*target).SimSlots = fpv.value.([]string) 38241 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 38242 (*target).State = fpv.value.(string) 38243 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 38244 (*target).StateFailedReason = fpv.value.(string) 38245 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 38246 (*target).SupportedBands = fpv.value.([]string) 38247 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 38248 (*target).SupportedCapabilities = fpv.value.([]string) 38249 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 38250 (*target).SupportedIpFamilies = fpv.value.([]string) 38251 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 38252 (*target).SupportedModes = fpv.value.([]string) 38253 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 38254 (*target).UnlockRequired = fpv.value.(string) 38255 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 38256 (*target).UnlockRetries = fpv.value.([]string) 38257 default: 38258 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fpv.selector)) 38259 } 38260 } 38261 38262 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) SetToRaw(target proto.Message) { 38263 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 38264 fpv.SetTo(&typedObject) 38265 } 38266 38267 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic'. 38268 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (int, bool) { 38269 switch fpv.selector { 38270 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 38271 return 0, false 38272 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 38273 return 0, false 38274 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 38275 leftValue := fpv.value.(string) 38276 rightValue := source.GetCarrierConfiguration() 38277 if (leftValue) == (rightValue) { 38278 return 0, true 38279 } else if (leftValue) < (rightValue) { 38280 return -1, true 38281 } else { 38282 return 1, true 38283 } 38284 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 38285 leftValue := fpv.value.(string) 38286 rightValue := source.GetCarrierConfigurationRevision() 38287 if (leftValue) == (rightValue) { 38288 return 0, true 38289 } else if (leftValue) < (rightValue) { 38290 return -1, true 38291 } else { 38292 return 1, true 38293 } 38294 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 38295 return 0, false 38296 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 38297 return 0, false 38298 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 38299 leftValue := fpv.value.(string) 38300 rightValue := source.GetCurrentModes() 38301 if (leftValue) == (rightValue) { 38302 return 0, true 38303 } else if (leftValue) < (rightValue) { 38304 return -1, true 38305 } else { 38306 return 1, true 38307 } 38308 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 38309 leftValue := fpv.value.(string) 38310 rightValue := source.GetDevice() 38311 if (leftValue) == (rightValue) { 38312 return 0, true 38313 } else if (leftValue) < (rightValue) { 38314 return -1, true 38315 } else { 38316 return 1, true 38317 } 38318 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 38319 leftValue := fpv.value.(string) 38320 rightValue := source.GetDeviceIdentifier() 38321 if (leftValue) == (rightValue) { 38322 return 0, true 38323 } else if (leftValue) < (rightValue) { 38324 return -1, true 38325 } else { 38326 return 1, true 38327 } 38328 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 38329 return 0, false 38330 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 38331 leftValue := fpv.value.(string) 38332 rightValue := source.GetEquipmentIdentifier() 38333 if (leftValue) == (rightValue) { 38334 return 0, true 38335 } else if (leftValue) < (rightValue) { 38336 return -1, true 38337 } else { 38338 return 1, true 38339 } 38340 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 38341 leftValue := fpv.value.(string) 38342 rightValue := source.GetHardwareRevision() 38343 if (leftValue) == (rightValue) { 38344 return 0, true 38345 } else if (leftValue) < (rightValue) { 38346 return -1, true 38347 } else { 38348 return 1, true 38349 } 38350 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 38351 leftValue := fpv.value.(string) 38352 rightValue := source.GetManufacturer() 38353 if (leftValue) == (rightValue) { 38354 return 0, true 38355 } else if (leftValue) < (rightValue) { 38356 return -1, true 38357 } else { 38358 return 1, true 38359 } 38360 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 38361 leftValue := fpv.value.(string) 38362 rightValue := source.GetModel() 38363 if (leftValue) == (rightValue) { 38364 return 0, true 38365 } else if (leftValue) < (rightValue) { 38366 return -1, true 38367 } else { 38368 return 1, true 38369 } 38370 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 38371 return 0, false 38372 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 38373 leftValue := fpv.value.(string) 38374 rightValue := source.GetPlugin() 38375 if (leftValue) == (rightValue) { 38376 return 0, true 38377 } else if (leftValue) < (rightValue) { 38378 return -1, true 38379 } else { 38380 return 1, true 38381 } 38382 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 38383 return 0, false 38384 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 38385 leftValue := fpv.value.(string) 38386 rightValue := source.GetPowerState() 38387 if (leftValue) == (rightValue) { 38388 return 0, true 38389 } else if (leftValue) < (rightValue) { 38390 return -1, true 38391 } else { 38392 return 1, true 38393 } 38394 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 38395 leftValue := fpv.value.(string) 38396 rightValue := source.GetPrimaryPort() 38397 if (leftValue) == (rightValue) { 38398 return 0, true 38399 } else if (leftValue) < (rightValue) { 38400 return -1, true 38401 } else { 38402 return 1, true 38403 } 38404 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 38405 leftValue := fpv.value.(string) 38406 rightValue := source.GetPrimarySimSlot() 38407 if (leftValue) == (rightValue) { 38408 return 0, true 38409 } else if (leftValue) < (rightValue) { 38410 return -1, true 38411 } else { 38412 return 1, true 38413 } 38414 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 38415 leftValue := fpv.value.(string) 38416 rightValue := source.GetRevision() 38417 if (leftValue) == (rightValue) { 38418 return 0, true 38419 } else if (leftValue) < (rightValue) { 38420 return -1, true 38421 } else { 38422 return 1, true 38423 } 38424 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 38425 return 0, false 38426 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 38427 leftValue := fpv.value.(string) 38428 rightValue := source.GetSim() 38429 if (leftValue) == (rightValue) { 38430 return 0, true 38431 } else if (leftValue) < (rightValue) { 38432 return -1, true 38433 } else { 38434 return 1, true 38435 } 38436 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 38437 return 0, false 38438 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 38439 leftValue := fpv.value.(string) 38440 rightValue := source.GetState() 38441 if (leftValue) == (rightValue) { 38442 return 0, true 38443 } else if (leftValue) < (rightValue) { 38444 return -1, true 38445 } else { 38446 return 1, true 38447 } 38448 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 38449 leftValue := fpv.value.(string) 38450 rightValue := source.GetStateFailedReason() 38451 if (leftValue) == (rightValue) { 38452 return 0, true 38453 } else if (leftValue) < (rightValue) { 38454 return -1, true 38455 } else { 38456 return 1, true 38457 } 38458 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 38459 return 0, false 38460 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 38461 return 0, false 38462 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 38463 return 0, false 38464 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 38465 return 0, false 38466 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 38467 leftValue := fpv.value.(string) 38468 rightValue := source.GetUnlockRequired() 38469 if (leftValue) == (rightValue) { 38470 return 0, true 38471 } else if (leftValue) < (rightValue) { 38472 return -1, true 38473 } else { 38474 return 1, true 38475 } 38476 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 38477 return 0, false 38478 default: 38479 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fpv.selector)) 38480 } 38481 } 38482 38483 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 38484 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 38485 } 38486 38487 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue struct { 38488 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 38489 subPathValue gotenobject.FieldPathValue 38490 } 38491 38492 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue)(nil) 38493 38494 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue) AsSignalQualityPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue, bool) { 38495 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue) 38496 return res, ok 38497 } 38498 38499 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) { 38500 if *target == nil { 38501 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 38502 } 38503 switch fpvs.Selector() { 38504 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 38505 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue).SetTo(&(*target).SignalQuality) 38506 default: 38507 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fpvs.Selector())) 38508 } 38509 } 38510 38511 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue) SetToRaw(target proto.Message) { 38512 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 38513 fpvs.SetTo(&typedObject) 38514 } 38515 38516 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue) GetRawValue() interface{} { 38517 return fpvs.subPathValue.GetRawValue() 38518 } 38519 38520 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (int, bool) { 38521 switch fpvs.Selector() { 38522 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 38523 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathValue).CompareWith(source.GetSignalQuality()) 38524 default: 38525 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fpvs.Selector())) 38526 } 38527 } 38528 38529 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 38530 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 38531 } 38532 38533 // DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue allows storing single item in Path-specific values for Generic according to their type 38534 // Present only for array (repeated) types. 38535 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue interface { 38536 gotenobject.FieldPathArrayItemValue 38537 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 38538 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) bool 38539 } 38540 38541 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 38542 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue, error) { 38543 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(pathStr) 38544 if err != nil { 38545 return nil, err 38546 } 38547 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 38548 if err != nil { 38549 return nil, status.Errorf(codes.InvalidArgument, "error parsing Generic field path array item value from %s: %v", valueStr, err) 38550 } 38551 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue), nil 38552 } 38553 38554 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue { 38555 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue(pathStr, valueStr) 38556 if err != nil { 38557 panic(err) 38558 } 38559 return fpaiv 38560 } 38561 38562 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue struct { 38563 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath 38564 value interface{} 38565 } 38566 38567 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue)(nil) 38568 38569 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic as interface{} 38570 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 38571 return fpaiv.value 38572 } 38573 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsAccessTechnologiesItemValue() (string, bool) { 38574 res, ok := fpaiv.value.(string) 38575 return res, ok 38576 } 38577 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsBearersItemValue() (string, bool) { 38578 res, ok := fpaiv.value.(string) 38579 return res, ok 38580 } 38581 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsCurrentBandsItemValue() (string, bool) { 38582 res, ok := fpaiv.value.(string) 38583 return res, ok 38584 } 38585 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsCurrentCapabilitiesItemValue() (string, bool) { 38586 res, ok := fpaiv.value.(string) 38587 return res, ok 38588 } 38589 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsDriversItemValue() (string, bool) { 38590 res, ok := fpaiv.value.(string) 38591 return res, ok 38592 } 38593 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsOwnNumbersItemValue() (string, bool) { 38594 res, ok := fpaiv.value.(string) 38595 return res, ok 38596 } 38597 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsPortsItemValue() (string, bool) { 38598 res, ok := fpaiv.value.(string) 38599 return res, ok 38600 } 38601 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsSimSlotsItemValue() (string, bool) { 38602 res, ok := fpaiv.value.(string) 38603 return res, ok 38604 } 38605 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsSupportedBandsItemValue() (string, bool) { 38606 res, ok := fpaiv.value.(string) 38607 return res, ok 38608 } 38609 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsSupportedCapabilitiesItemValue() (string, bool) { 38610 res, ok := fpaiv.value.(string) 38611 return res, ok 38612 } 38613 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsSupportedIpFamiliesItemValue() (string, bool) { 38614 res, ok := fpaiv.value.(string) 38615 return res, ok 38616 } 38617 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsSupportedModesItemValue() (string, bool) { 38618 res, ok := fpaiv.value.(string) 38619 return res, ok 38620 } 38621 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) AsUnlockRetriesItemValue() (string, bool) { 38622 res, ok := fpaiv.value.(string) 38623 return res, ok 38624 } 38625 38626 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) (interface{}, bool) { 38627 return nil, false 38628 } 38629 38630 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 38631 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)) 38632 } 38633 38634 // Contains returns a boolean indicating if value that is being held is present in given 'Generic' 38635 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) bool { 38636 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath.Get(source) 38637 for _, v := range slice { 38638 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 38639 if proto.Equal(asProtoMsg, v.(proto.Message)) { 38640 return true 38641 } 38642 } else if reflect.DeepEqual(v, fpaiv.value) { 38643 return true 38644 } 38645 } 38646 return false 38647 } 38648 38649 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayItemValue struct { 38650 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 38651 subPathItemValue gotenobject.FieldPathArrayItemValue 38652 } 38653 38654 // GetRawValue returns stored array item value 38655 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 38656 return fpaivs.subPathItemValue.GetRawItemValue() 38657 } 38658 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayItemValue) AsSignalQualityPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue, bool) { 38659 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue) 38660 return res, ok 38661 } 38662 38663 // Contains returns a boolean indicating if value that is being held is present in given 'Generic' 38664 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) bool { 38665 switch fpaivs.Selector() { 38666 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 38667 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayItemValue).ContainsValue(source.GetSignalQuality()) 38668 default: 38669 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic: %d", fpaivs.Selector())) 38670 } 38671 } 38672 38673 // DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues allows storing slice of values for Generic fields according to their type 38674 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues interface { 38675 gotenobject.FieldPathArrayOfValues 38676 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 38677 } 38678 38679 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues, error) { 38680 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(pathStr) 38681 if err != nil { 38682 return nil, err 38683 } 38684 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 38685 if err != nil { 38686 return nil, status.Errorf(codes.InvalidArgument, "error parsing Generic field path array of values from %s: %v", valuesStr, err) 38687 } 38688 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues), nil 38689 } 38690 38691 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues { 38692 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues(pathStr, valuesStr) 38693 if err != nil { 38694 panic(err) 38695 } 38696 return fpaov 38697 } 38698 38699 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues struct { 38700 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPath 38701 values interface{} 38702 } 38703 38704 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues)(nil) 38705 38706 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 38707 switch fpaov.selector { 38708 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorAccessTechnologies: 38709 for _, v := range fpaov.values.([][]string) { 38710 values = append(values, v) 38711 } 38712 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorBearers: 38713 for _, v := range fpaov.values.([][]string) { 38714 values = append(values, v) 38715 } 38716 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfiguration: 38717 for _, v := range fpaov.values.([]string) { 38718 values = append(values, v) 38719 } 38720 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCarrierConfigurationRevision: 38721 for _, v := range fpaov.values.([]string) { 38722 values = append(values, v) 38723 } 38724 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentBands: 38725 for _, v := range fpaov.values.([][]string) { 38726 values = append(values, v) 38727 } 38728 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentCapabilities: 38729 for _, v := range fpaov.values.([][]string) { 38730 values = append(values, v) 38731 } 38732 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorCurrentModes: 38733 for _, v := range fpaov.values.([]string) { 38734 values = append(values, v) 38735 } 38736 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDevice: 38737 for _, v := range fpaov.values.([]string) { 38738 values = append(values, v) 38739 } 38740 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDeviceIdentifier: 38741 for _, v := range fpaov.values.([]string) { 38742 values = append(values, v) 38743 } 38744 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorDrivers: 38745 for _, v := range fpaov.values.([][]string) { 38746 values = append(values, v) 38747 } 38748 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorEquipmentIdentifier: 38749 for _, v := range fpaov.values.([]string) { 38750 values = append(values, v) 38751 } 38752 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorHardwareRevision: 38753 for _, v := range fpaov.values.([]string) { 38754 values = append(values, v) 38755 } 38756 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorManufacturer: 38757 for _, v := range fpaov.values.([]string) { 38758 values = append(values, v) 38759 } 38760 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorModel: 38761 for _, v := range fpaov.values.([]string) { 38762 values = append(values, v) 38763 } 38764 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorOwnNumbers: 38765 for _, v := range fpaov.values.([][]string) { 38766 values = append(values, v) 38767 } 38768 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPlugin: 38769 for _, v := range fpaov.values.([]string) { 38770 values = append(values, v) 38771 } 38772 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPorts: 38773 for _, v := range fpaov.values.([][]string) { 38774 values = append(values, v) 38775 } 38776 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPowerState: 38777 for _, v := range fpaov.values.([]string) { 38778 values = append(values, v) 38779 } 38780 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimaryPort: 38781 for _, v := range fpaov.values.([]string) { 38782 values = append(values, v) 38783 } 38784 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorPrimarySimSlot: 38785 for _, v := range fpaov.values.([]string) { 38786 values = append(values, v) 38787 } 38788 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorRevision: 38789 for _, v := range fpaov.values.([]string) { 38790 values = append(values, v) 38791 } 38792 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSignalQuality: 38793 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) { 38794 values = append(values, v) 38795 } 38796 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSim: 38797 for _, v := range fpaov.values.([]string) { 38798 values = append(values, v) 38799 } 38800 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSimSlots: 38801 for _, v := range fpaov.values.([][]string) { 38802 values = append(values, v) 38803 } 38804 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorState: 38805 for _, v := range fpaov.values.([]string) { 38806 values = append(values, v) 38807 } 38808 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorStateFailedReason: 38809 for _, v := range fpaov.values.([]string) { 38810 values = append(values, v) 38811 } 38812 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedBands: 38813 for _, v := range fpaov.values.([][]string) { 38814 values = append(values, v) 38815 } 38816 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedCapabilities: 38817 for _, v := range fpaov.values.([][]string) { 38818 values = append(values, v) 38819 } 38820 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedIpFamilies: 38821 for _, v := range fpaov.values.([][]string) { 38822 values = append(values, v) 38823 } 38824 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorSupportedModes: 38825 for _, v := range fpaov.values.([][]string) { 38826 values = append(values, v) 38827 } 38828 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRequired: 38829 for _, v := range fpaov.values.([]string) { 38830 values = append(values, v) 38831 } 38832 case DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathSelectorUnlockRetries: 38833 for _, v := range fpaov.values.([][]string) { 38834 values = append(values, v) 38835 } 38836 } 38837 return 38838 } 38839 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsAccessTechnologiesArrayOfValues() ([][]string, bool) { 38840 res, ok := fpaov.values.([][]string) 38841 return res, ok 38842 } 38843 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsBearersArrayOfValues() ([][]string, bool) { 38844 res, ok := fpaov.values.([][]string) 38845 return res, ok 38846 } 38847 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsCarrierConfigurationArrayOfValues() ([]string, bool) { 38848 res, ok := fpaov.values.([]string) 38849 return res, ok 38850 } 38851 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsCarrierConfigurationRevisionArrayOfValues() ([]string, bool) { 38852 res, ok := fpaov.values.([]string) 38853 return res, ok 38854 } 38855 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsCurrentBandsArrayOfValues() ([][]string, bool) { 38856 res, ok := fpaov.values.([][]string) 38857 return res, ok 38858 } 38859 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsCurrentCapabilitiesArrayOfValues() ([][]string, bool) { 38860 res, ok := fpaov.values.([][]string) 38861 return res, ok 38862 } 38863 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsCurrentModesArrayOfValues() ([]string, bool) { 38864 res, ok := fpaov.values.([]string) 38865 return res, ok 38866 } 38867 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsDeviceArrayOfValues() ([]string, bool) { 38868 res, ok := fpaov.values.([]string) 38869 return res, ok 38870 } 38871 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsDeviceIdentifierArrayOfValues() ([]string, bool) { 38872 res, ok := fpaov.values.([]string) 38873 return res, ok 38874 } 38875 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsDriversArrayOfValues() ([][]string, bool) { 38876 res, ok := fpaov.values.([][]string) 38877 return res, ok 38878 } 38879 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsEquipmentIdentifierArrayOfValues() ([]string, bool) { 38880 res, ok := fpaov.values.([]string) 38881 return res, ok 38882 } 38883 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsHardwareRevisionArrayOfValues() ([]string, bool) { 38884 res, ok := fpaov.values.([]string) 38885 return res, ok 38886 } 38887 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsManufacturerArrayOfValues() ([]string, bool) { 38888 res, ok := fpaov.values.([]string) 38889 return res, ok 38890 } 38891 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsModelArrayOfValues() ([]string, bool) { 38892 res, ok := fpaov.values.([]string) 38893 return res, ok 38894 } 38895 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsOwnNumbersArrayOfValues() ([][]string, bool) { 38896 res, ok := fpaov.values.([][]string) 38897 return res, ok 38898 } 38899 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsPluginArrayOfValues() ([]string, bool) { 38900 res, ok := fpaov.values.([]string) 38901 return res, ok 38902 } 38903 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsPortsArrayOfValues() ([][]string, bool) { 38904 res, ok := fpaov.values.([][]string) 38905 return res, ok 38906 } 38907 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsPowerStateArrayOfValues() ([]string, bool) { 38908 res, ok := fpaov.values.([]string) 38909 return res, ok 38910 } 38911 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsPrimaryPortArrayOfValues() ([]string, bool) { 38912 res, ok := fpaov.values.([]string) 38913 return res, ok 38914 } 38915 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsPrimarySimSlotArrayOfValues() ([]string, bool) { 38916 res, ok := fpaov.values.([]string) 38917 return res, ok 38918 } 38919 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsRevisionArrayOfValues() ([]string, bool) { 38920 res, ok := fpaov.values.([]string) 38921 return res, ok 38922 } 38923 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSignalQualityArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality, bool) { 38924 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SignalQuality) 38925 return res, ok 38926 } 38927 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSimArrayOfValues() ([]string, bool) { 38928 res, ok := fpaov.values.([]string) 38929 return res, ok 38930 } 38931 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSimSlotsArrayOfValues() ([][]string, bool) { 38932 res, ok := fpaov.values.([][]string) 38933 return res, ok 38934 } 38935 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsStateArrayOfValues() ([]string, bool) { 38936 res, ok := fpaov.values.([]string) 38937 return res, ok 38938 } 38939 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsStateFailedReasonArrayOfValues() ([]string, bool) { 38940 res, ok := fpaov.values.([]string) 38941 return res, ok 38942 } 38943 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSupportedBandsArrayOfValues() ([][]string, bool) { 38944 res, ok := fpaov.values.([][]string) 38945 return res, ok 38946 } 38947 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSupportedCapabilitiesArrayOfValues() ([][]string, bool) { 38948 res, ok := fpaov.values.([][]string) 38949 return res, ok 38950 } 38951 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSupportedIpFamiliesArrayOfValues() ([][]string, bool) { 38952 res, ok := fpaov.values.([][]string) 38953 return res, ok 38954 } 38955 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsSupportedModesArrayOfValues() ([][]string, bool) { 38956 res, ok := fpaov.values.([][]string) 38957 return res, ok 38958 } 38959 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsUnlockRequiredArrayOfValues() ([]string, bool) { 38960 res, ok := fpaov.values.([]string) 38961 return res, ok 38962 } 38963 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldTerminalPathArrayOfValues) AsUnlockRetriesArrayOfValues() ([][]string, bool) { 38964 res, ok := fpaov.values.([][]string) 38965 return res, ok 38966 } 38967 38968 type DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayOfValues struct { 38969 DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath 38970 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 38971 } 38972 38973 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayOfValues)(nil) 38974 38975 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 38976 return fpsaov.subPathArrayOfValues.GetRawValues() 38977 } 38978 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldSubPathArrayOfValues) AsSignalQualityPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues, bool) { 38979 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusSignalQuality_FieldPathArrayOfValues) 38980 return res, ok 38981 } 38982 38983 // FieldPath provides implementation to handle 38984 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 38985 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath interface { 38986 gotenobject.FieldPath 38987 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector 38988 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) []interface{} 38989 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) (interface{}, bool) 38990 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 38991 38992 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue 38993 // (or array of values) and holds passed value. Panics if injected type is incorrect. 38994 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue 38995 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues 38996 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue 38997 } 38998 38999 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector int32 39000 39001 const ( 39002 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 0 39003 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 1 39004 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 2 39005 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 3 39006 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 4 39007 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 5 39008 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 6 39009 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 7 39010 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 8 39011 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 9 39012 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 10 39013 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 11 39014 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector = 12 39015 ) 39016 39017 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector) String() string { 39018 switch s { 39019 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39020 return "dbus_path" 39021 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39022 return "active" 39023 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39024 return "eid" 39025 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39026 return "emergency_numbers" 39027 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39028 return "esim_status" 39029 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39030 return "gid1" 39031 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39032 return "gid2" 39033 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39034 return "iccid" 39035 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39036 return "imsi" 39037 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39038 return "operator_code" 39039 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39040 return "operator_name" 39041 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39042 return "removability" 39043 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39044 return "sim_type" 39045 default: 39046 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", s)) 39047 } 39048 } 39049 39050 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath, error) { 39051 if len(fp) == 0 { 39052 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus") 39053 } 39054 if len(fp) == 1 { 39055 switch fp[0] { 39056 case "dbus_path", "dbusPath", "dbus-path": 39057 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath}, nil 39058 case "active": 39059 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive}, nil 39060 case "eid": 39061 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid}, nil 39062 case "emergency_numbers", "emergencyNumbers", "emergency-numbers": 39063 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers}, nil 39064 case "esim_status", "esimStatus", "esim-status": 39065 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus}, nil 39066 case "gid1", "gid_1", "gid-1": 39067 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1}, nil 39068 case "gid2", "gid_2", "gid-2": 39069 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2}, nil 39070 case "iccid": 39071 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid}, nil 39072 case "imsi": 39073 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi}, nil 39074 case "operator_code", "operatorCode", "operator-code": 39075 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode}, nil 39076 case "operator_name", "operatorName", "operator-name": 39077 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName}, nil 39078 case "removability": 39079 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability}, nil 39080 case "sim_type", "simType", "sim-type": 39081 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType}, nil 39082 } 39083 } 39084 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus", fp) 39085 } 39086 39087 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath, error) { 39088 fp, err := gotenobject.ParseRawFieldPath(rawField) 39089 if err != nil { 39090 return nil, err 39091 } 39092 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(fp) 39093 } 39094 39095 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath { 39096 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(rawField) 39097 if err != nil { 39098 panic(err) 39099 } 39100 return fp 39101 } 39102 39103 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath struct { 39104 selector DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector 39105 } 39106 39107 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath)(nil) 39108 39109 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelector { 39110 return fp.selector 39111 } 39112 39113 // String returns path representation in proto convention 39114 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) String() string { 39115 return fp.selector.String() 39116 } 39117 39118 // JSONString returns path representation is JSON convention 39119 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) JSONString() string { 39120 return strcase.ToLowerCamel(fp.String()) 39121 } 39122 39123 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus 39124 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) (values []interface{}) { 39125 if source != nil { 39126 switch fp.selector { 39127 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39128 values = append(values, source.DbusPath) 39129 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39130 values = append(values, source.Active) 39131 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39132 values = append(values, source.Eid) 39133 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39134 for _, value := range source.GetEmergencyNumbers() { 39135 values = append(values, value) 39136 } 39137 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39138 values = append(values, source.EsimStatus) 39139 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39140 values = append(values, source.Gid1) 39141 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39142 values = append(values, source.Gid2) 39143 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39144 values = append(values, source.Iccid) 39145 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39146 values = append(values, source.Imsi) 39147 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39148 values = append(values, source.OperatorCode) 39149 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39150 values = append(values, source.OperatorName) 39151 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39152 values = append(values, source.Removability) 39153 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39154 values = append(values, source.SimType) 39155 default: 39156 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39157 } 39158 } 39159 return 39160 } 39161 39162 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 39163 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 39164 } 39165 39166 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus 39167 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) (interface{}, bool) { 39168 switch fp.selector { 39169 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39170 return source.GetDbusPath(), source != nil 39171 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39172 return source.GetActive(), source != nil 39173 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39174 return source.GetEid(), source != nil 39175 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39176 res := source.GetEmergencyNumbers() 39177 return res, res != nil 39178 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39179 return source.GetEsimStatus(), source != nil 39180 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39181 return source.GetGid1(), source != nil 39182 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39183 return source.GetGid2(), source != nil 39184 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39185 return source.GetIccid(), source != nil 39186 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39187 return source.GetImsi(), source != nil 39188 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39189 return source.GetOperatorCode(), source != nil 39190 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39191 return source.GetOperatorName(), source != nil 39192 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39193 return source.GetRemovability(), source != nil 39194 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39195 return source.GetSimType(), source != nil 39196 default: 39197 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39198 } 39199 } 39200 39201 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 39202 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 39203 } 39204 39205 // GetDefault returns a default value of the field type 39206 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) GetDefault() interface{} { 39207 switch fp.selector { 39208 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39209 return "" 39210 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39211 return "" 39212 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39213 return "" 39214 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39215 return ([]string)(nil) 39216 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39217 return "" 39218 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39219 return "" 39220 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39221 return "" 39222 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39223 return "" 39224 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39225 return "" 39226 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39227 return "" 39228 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39229 return "" 39230 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39231 return "" 39232 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39233 return "" 39234 default: 39235 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39236 } 39237 } 39238 39239 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) { 39240 if item != nil { 39241 switch fp.selector { 39242 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39243 item.DbusPath = "" 39244 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39245 item.Active = "" 39246 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39247 item.Eid = "" 39248 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39249 item.EmergencyNumbers = nil 39250 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39251 item.EsimStatus = "" 39252 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39253 item.Gid1 = "" 39254 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39255 item.Gid2 = "" 39256 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39257 item.Iccid = "" 39258 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39259 item.Imsi = "" 39260 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39261 item.OperatorCode = "" 39262 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39263 item.OperatorName = "" 39264 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39265 item.Removability = "" 39266 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39267 item.SimType = "" 39268 default: 39269 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39270 } 39271 } 39272 } 39273 39274 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) ClearValueRaw(item proto.Message) { 39275 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 39276 } 39277 39278 // IsLeaf - whether field path is holds simple value 39279 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) IsLeaf() bool { 39280 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath || 39281 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive || 39282 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid || 39283 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers || 39284 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus || 39285 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1 || 39286 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2 || 39287 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid || 39288 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi || 39289 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode || 39290 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName || 39291 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability || 39292 fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType 39293 } 39294 39295 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 39296 return []gotenobject.FieldPath{fp} 39297 } 39298 39299 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue { 39300 switch fp.selector { 39301 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39302 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39303 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39304 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39305 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39306 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39307 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39308 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.([]string)} 39309 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39310 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39311 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39312 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39313 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39314 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39315 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39316 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39317 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39318 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39319 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39320 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39321 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39322 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39323 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39324 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39325 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39326 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39327 default: 39328 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39329 } 39330 } 39331 39332 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 39333 return fp.WithIValue(value) 39334 } 39335 39336 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues { 39337 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp} 39338 switch fp.selector { 39339 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39340 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39341 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39342 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39343 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39344 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39345 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39346 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([][]string)} 39347 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39348 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39349 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39350 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39351 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39352 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39353 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39354 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39355 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39356 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39357 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39358 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39359 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39360 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39361 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39362 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39363 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39364 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, values: values.([]string)} 39365 default: 39366 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39367 } 39368 return fpaov 39369 } 39370 39371 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 39372 return fp.WithIArrayOfValues(values) 39373 } 39374 39375 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue { 39376 switch fp.selector { 39377 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39378 return &DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath: *fp, value: value.(string)} 39379 default: 39380 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fp.selector)) 39381 } 39382 } 39383 39384 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 39385 return fp.WithIArrayItemValue(value) 39386 } 39387 39388 // DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue allows storing values for SimStatus fields according to their type 39389 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue interface { 39390 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath 39391 gotenobject.FieldPathValue 39392 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 39393 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) (cmp int, comparable bool) 39394 } 39395 39396 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue, error) { 39397 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(pathStr) 39398 if err != nil { 39399 return nil, err 39400 } 39401 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 39402 if err != nil { 39403 return nil, status.Errorf(codes.InvalidArgument, "error parsing SimStatus field path value from %s: %v", valueStr, err) 39404 } 39405 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue), nil 39406 } 39407 39408 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue { 39409 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue(pathStr, valueStr) 39410 if err != nil { 39411 panic(err) 39412 } 39413 return fpv 39414 } 39415 39416 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue struct { 39417 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath 39418 value interface{} 39419 } 39420 39421 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue)(nil) 39422 39423 // GetRawValue returns raw value stored under selected path for 'SimStatus' as interface{} 39424 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) GetRawValue() interface{} { 39425 return fpv.value 39426 } 39427 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsDbusPathValue() (string, bool) { 39428 res, ok := fpv.value.(string) 39429 return res, ok 39430 } 39431 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsActiveValue() (string, bool) { 39432 res, ok := fpv.value.(string) 39433 return res, ok 39434 } 39435 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsEidValue() (string, bool) { 39436 res, ok := fpv.value.(string) 39437 return res, ok 39438 } 39439 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsEmergencyNumbersValue() ([]string, bool) { 39440 res, ok := fpv.value.([]string) 39441 return res, ok 39442 } 39443 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsEsimStatusValue() (string, bool) { 39444 res, ok := fpv.value.(string) 39445 return res, ok 39446 } 39447 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsGid1Value() (string, bool) { 39448 res, ok := fpv.value.(string) 39449 return res, ok 39450 } 39451 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsGid2Value() (string, bool) { 39452 res, ok := fpv.value.(string) 39453 return res, ok 39454 } 39455 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsIccidValue() (string, bool) { 39456 res, ok := fpv.value.(string) 39457 return res, ok 39458 } 39459 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsImsiValue() (string, bool) { 39460 res, ok := fpv.value.(string) 39461 return res, ok 39462 } 39463 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsOperatorCodeValue() (string, bool) { 39464 res, ok := fpv.value.(string) 39465 return res, ok 39466 } 39467 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsOperatorNameValue() (string, bool) { 39468 res, ok := fpv.value.(string) 39469 return res, ok 39470 } 39471 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsRemovabilityValue() (string, bool) { 39472 res, ok := fpv.value.(string) 39473 return res, ok 39474 } 39475 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) AsSimTypeValue() (string, bool) { 39476 res, ok := fpv.value.(string) 39477 return res, ok 39478 } 39479 39480 // SetTo stores value for selected field for object SimStatus 39481 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) { 39482 if *target == nil { 39483 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 39484 } 39485 switch fpv.selector { 39486 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39487 (*target).DbusPath = fpv.value.(string) 39488 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39489 (*target).Active = fpv.value.(string) 39490 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39491 (*target).Eid = fpv.value.(string) 39492 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39493 (*target).EmergencyNumbers = fpv.value.([]string) 39494 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39495 (*target).EsimStatus = fpv.value.(string) 39496 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39497 (*target).Gid1 = fpv.value.(string) 39498 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39499 (*target).Gid2 = fpv.value.(string) 39500 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39501 (*target).Iccid = fpv.value.(string) 39502 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39503 (*target).Imsi = fpv.value.(string) 39504 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39505 (*target).OperatorCode = fpv.value.(string) 39506 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39507 (*target).OperatorName = fpv.value.(string) 39508 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39509 (*target).Removability = fpv.value.(string) 39510 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39511 (*target).SimType = fpv.value.(string) 39512 default: 39513 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fpv.selector)) 39514 } 39515 } 39516 39517 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) SetToRaw(target proto.Message) { 39518 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 39519 fpv.SetTo(&typedObject) 39520 } 39521 39522 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus'. 39523 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) (int, bool) { 39524 switch fpv.selector { 39525 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39526 leftValue := fpv.value.(string) 39527 rightValue := source.GetDbusPath() 39528 if (leftValue) == (rightValue) { 39529 return 0, true 39530 } else if (leftValue) < (rightValue) { 39531 return -1, true 39532 } else { 39533 return 1, true 39534 } 39535 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39536 leftValue := fpv.value.(string) 39537 rightValue := source.GetActive() 39538 if (leftValue) == (rightValue) { 39539 return 0, true 39540 } else if (leftValue) < (rightValue) { 39541 return -1, true 39542 } else { 39543 return 1, true 39544 } 39545 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39546 leftValue := fpv.value.(string) 39547 rightValue := source.GetEid() 39548 if (leftValue) == (rightValue) { 39549 return 0, true 39550 } else if (leftValue) < (rightValue) { 39551 return -1, true 39552 } else { 39553 return 1, true 39554 } 39555 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39556 return 0, false 39557 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39558 leftValue := fpv.value.(string) 39559 rightValue := source.GetEsimStatus() 39560 if (leftValue) == (rightValue) { 39561 return 0, true 39562 } else if (leftValue) < (rightValue) { 39563 return -1, true 39564 } else { 39565 return 1, true 39566 } 39567 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39568 leftValue := fpv.value.(string) 39569 rightValue := source.GetGid1() 39570 if (leftValue) == (rightValue) { 39571 return 0, true 39572 } else if (leftValue) < (rightValue) { 39573 return -1, true 39574 } else { 39575 return 1, true 39576 } 39577 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39578 leftValue := fpv.value.(string) 39579 rightValue := source.GetGid2() 39580 if (leftValue) == (rightValue) { 39581 return 0, true 39582 } else if (leftValue) < (rightValue) { 39583 return -1, true 39584 } else { 39585 return 1, true 39586 } 39587 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39588 leftValue := fpv.value.(string) 39589 rightValue := source.GetIccid() 39590 if (leftValue) == (rightValue) { 39591 return 0, true 39592 } else if (leftValue) < (rightValue) { 39593 return -1, true 39594 } else { 39595 return 1, true 39596 } 39597 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39598 leftValue := fpv.value.(string) 39599 rightValue := source.GetImsi() 39600 if (leftValue) == (rightValue) { 39601 return 0, true 39602 } else if (leftValue) < (rightValue) { 39603 return -1, true 39604 } else { 39605 return 1, true 39606 } 39607 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39608 leftValue := fpv.value.(string) 39609 rightValue := source.GetOperatorCode() 39610 if (leftValue) == (rightValue) { 39611 return 0, true 39612 } else if (leftValue) < (rightValue) { 39613 return -1, true 39614 } else { 39615 return 1, true 39616 } 39617 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39618 leftValue := fpv.value.(string) 39619 rightValue := source.GetOperatorName() 39620 if (leftValue) == (rightValue) { 39621 return 0, true 39622 } else if (leftValue) < (rightValue) { 39623 return -1, true 39624 } else { 39625 return 1, true 39626 } 39627 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39628 leftValue := fpv.value.(string) 39629 rightValue := source.GetRemovability() 39630 if (leftValue) == (rightValue) { 39631 return 0, true 39632 } else if (leftValue) < (rightValue) { 39633 return -1, true 39634 } else { 39635 return 1, true 39636 } 39637 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39638 leftValue := fpv.value.(string) 39639 rightValue := source.GetSimType() 39640 if (leftValue) == (rightValue) { 39641 return 0, true 39642 } else if (leftValue) < (rightValue) { 39643 return -1, true 39644 } else { 39645 return 1, true 39646 } 39647 default: 39648 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus: %d", fpv.selector)) 39649 } 39650 } 39651 39652 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 39653 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 39654 } 39655 39656 // DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue allows storing single item in Path-specific values for SimStatus according to their type 39657 // Present only for array (repeated) types. 39658 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue interface { 39659 gotenobject.FieldPathArrayItemValue 39660 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath 39661 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) bool 39662 } 39663 39664 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 39665 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue, error) { 39666 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(pathStr) 39667 if err != nil { 39668 return nil, err 39669 } 39670 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 39671 if err != nil { 39672 return nil, status.Errorf(codes.InvalidArgument, "error parsing SimStatus field path array item value from %s: %v", valueStr, err) 39673 } 39674 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue), nil 39675 } 39676 39677 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue { 39678 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue(pathStr, valueStr) 39679 if err != nil { 39680 panic(err) 39681 } 39682 return fpaiv 39683 } 39684 39685 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue struct { 39686 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath 39687 value interface{} 39688 } 39689 39690 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue)(nil) 39691 39692 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus as interface{} 39693 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 39694 return fpaiv.value 39695 } 39696 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue) AsEmergencyNumbersItemValue() (string, bool) { 39697 res, ok := fpaiv.value.(string) 39698 return res, ok 39699 } 39700 39701 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) (interface{}, bool) { 39702 return nil, false 39703 } 39704 39705 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 39706 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)) 39707 } 39708 39709 // Contains returns a boolean indicating if value that is being held is present in given 'SimStatus' 39710 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) bool { 39711 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath.Get(source) 39712 for _, v := range slice { 39713 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 39714 if proto.Equal(asProtoMsg, v.(proto.Message)) { 39715 return true 39716 } 39717 } else if reflect.DeepEqual(v, fpaiv.value) { 39718 return true 39719 } 39720 } 39721 return false 39722 } 39723 39724 // DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues allows storing slice of values for SimStatus fields according to their type 39725 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues interface { 39726 gotenobject.FieldPathArrayOfValues 39727 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath 39728 } 39729 39730 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues, error) { 39731 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPath(pathStr) 39732 if err != nil { 39733 return nil, err 39734 } 39735 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 39736 if err != nil { 39737 return nil, status.Errorf(codes.InvalidArgument, "error parsing SimStatus field path array of values from %s: %v", valuesStr, err) 39738 } 39739 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues), nil 39740 } 39741 39742 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues { 39743 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues(pathStr, valuesStr) 39744 if err != nil { 39745 panic(err) 39746 } 39747 return fpaov 39748 } 39749 39750 type DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues struct { 39751 DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPath 39752 values interface{} 39753 } 39754 39755 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues)(nil) 39756 39757 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 39758 switch fpaov.selector { 39759 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorDbusPath: 39760 for _, v := range fpaov.values.([]string) { 39761 values = append(values, v) 39762 } 39763 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorActive: 39764 for _, v := range fpaov.values.([]string) { 39765 values = append(values, v) 39766 } 39767 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEid: 39768 for _, v := range fpaov.values.([]string) { 39769 values = append(values, v) 39770 } 39771 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEmergencyNumbers: 39772 for _, v := range fpaov.values.([][]string) { 39773 values = append(values, v) 39774 } 39775 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorEsimStatus: 39776 for _, v := range fpaov.values.([]string) { 39777 values = append(values, v) 39778 } 39779 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid1: 39780 for _, v := range fpaov.values.([]string) { 39781 values = append(values, v) 39782 } 39783 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorGid2: 39784 for _, v := range fpaov.values.([]string) { 39785 values = append(values, v) 39786 } 39787 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorIccid: 39788 for _, v := range fpaov.values.([]string) { 39789 values = append(values, v) 39790 } 39791 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorImsi: 39792 for _, v := range fpaov.values.([]string) { 39793 values = append(values, v) 39794 } 39795 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorCode: 39796 for _, v := range fpaov.values.([]string) { 39797 values = append(values, v) 39798 } 39799 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorOperatorName: 39800 for _, v := range fpaov.values.([]string) { 39801 values = append(values, v) 39802 } 39803 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorRemovability: 39804 for _, v := range fpaov.values.([]string) { 39805 values = append(values, v) 39806 } 39807 case DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldPathSelectorSimType: 39808 for _, v := range fpaov.values.([]string) { 39809 values = append(values, v) 39810 } 39811 } 39812 return 39813 } 39814 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsDbusPathArrayOfValues() ([]string, bool) { 39815 res, ok := fpaov.values.([]string) 39816 return res, ok 39817 } 39818 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsActiveArrayOfValues() ([]string, bool) { 39819 res, ok := fpaov.values.([]string) 39820 return res, ok 39821 } 39822 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsEidArrayOfValues() ([]string, bool) { 39823 res, ok := fpaov.values.([]string) 39824 return res, ok 39825 } 39826 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsEmergencyNumbersArrayOfValues() ([][]string, bool) { 39827 res, ok := fpaov.values.([][]string) 39828 return res, ok 39829 } 39830 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsEsimStatusArrayOfValues() ([]string, bool) { 39831 res, ok := fpaov.values.([]string) 39832 return res, ok 39833 } 39834 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsGid1ArrayOfValues() ([]string, bool) { 39835 res, ok := fpaov.values.([]string) 39836 return res, ok 39837 } 39838 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsGid2ArrayOfValues() ([]string, bool) { 39839 res, ok := fpaov.values.([]string) 39840 return res, ok 39841 } 39842 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsIccidArrayOfValues() ([]string, bool) { 39843 res, ok := fpaov.values.([]string) 39844 return res, ok 39845 } 39846 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsImsiArrayOfValues() ([]string, bool) { 39847 res, ok := fpaov.values.([]string) 39848 return res, ok 39849 } 39850 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsOperatorCodeArrayOfValues() ([]string, bool) { 39851 res, ok := fpaov.values.([]string) 39852 return res, ok 39853 } 39854 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsOperatorNameArrayOfValues() ([]string, bool) { 39855 res, ok := fpaov.values.([]string) 39856 return res, ok 39857 } 39858 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsRemovabilityArrayOfValues() ([]string, bool) { 39859 res, ok := fpaov.values.([]string) 39860 return res, ok 39861 } 39862 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusSimStatus_FieldTerminalPathArrayOfValues) AsSimTypeArrayOfValues() ([]string, bool) { 39863 res, ok := fpaov.values.([]string) 39864 return res, ok 39865 } 39866 39867 // FieldPath provides implementation to handle 39868 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 39869 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath interface { 39870 gotenobject.FieldPath 39871 Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector 39872 Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) []interface{} 39873 GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (interface{}, bool) 39874 ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 39875 39876 // Those methods build corresponding DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue 39877 // (or array of values) and holds passed value. Panics if injected type is incorrect. 39878 WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue 39879 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues 39880 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue 39881 } 39882 39883 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector int32 39884 39885 const ( 39886 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector = 0 39887 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector = 1 39888 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector = 2 39889 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector = 3 39890 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector = 4 39891 ) 39892 39893 func (s DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector) String() string { 39894 switch s { 39895 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 39896 return "three_g_pp" 39897 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 39898 return "cdma" 39899 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 39900 return "dbus_path" 39901 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 39902 return "generic" 39903 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 39904 return "sim_status" 39905 default: 39906 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", s)) 39907 } 39908 } 39909 39910 func BuildDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath, error) { 39911 if len(fp) == 0 { 39912 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem") 39913 } 39914 if len(fp) == 1 { 39915 switch fp[0] { 39916 case "three_g_pp", "threeGPp", "three-g-pp": 39917 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp}, nil 39918 case "cdma": 39919 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma}, nil 39920 case "dbus_path", "dbusPath", "dbus-path": 39921 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath}, nil 39922 case "generic": 39923 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric}, nil 39924 case "sim_status", "simStatus", "sim-status": 39925 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus}, nil 39926 } 39927 } else { 39928 switch fp[0] { 39929 case "three_g_pp", "threeGPp", "three-g-pp": 39930 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath(fp[1:]); err != nil { 39931 return nil, err 39932 } else { 39933 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp, subPath: subpath}, nil 39934 } 39935 case "cdma": 39936 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath(fp[1:]); err != nil { 39937 return nil, err 39938 } else { 39939 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma, subPath: subpath}, nil 39940 } 39941 case "generic": 39942 if subpath, err := BuildDeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath(fp[1:]); err != nil { 39943 return nil, err 39944 } else { 39945 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric, subPath: subpath}, nil 39946 } 39947 case "sim_status", "simStatus", "sim-status": 39948 if len(fp) > 2 { 39949 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)", fp) 39950 } 39951 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap{selector: DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus, key: fp[1]}, nil 39952 } 39953 } 39954 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem", fp) 39955 } 39956 39957 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(rawField string) (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath, error) { 39958 fp, err := gotenobject.ParseRawFieldPath(rawField) 39959 if err != nil { 39960 return nil, err 39961 } 39962 return BuildDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(fp) 39963 } 39964 39965 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(rawField string) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath { 39966 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(rawField) 39967 if err != nil { 39968 panic(err) 39969 } 39970 return fp 39971 } 39972 39973 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath struct { 39974 selector DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector 39975 } 39976 39977 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath)(nil) 39978 39979 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector { 39980 return fp.selector 39981 } 39982 39983 // String returns path representation in proto convention 39984 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) String() string { 39985 return fp.selector.String() 39986 } 39987 39988 // JSONString returns path representation is JSON convention 39989 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) JSONString() string { 39990 return strcase.ToLowerCamel(fp.String()) 39991 } 39992 39993 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem 39994 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (values []interface{}) { 39995 if source != nil { 39996 switch fp.selector { 39997 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 39998 if source.ThreeGPp != nil { 39999 values = append(values, source.ThreeGPp) 40000 } 40001 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40002 if source.Cdma != nil { 40003 values = append(values, source.Cdma) 40004 } 40005 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40006 values = append(values, source.DbusPath) 40007 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40008 if source.Generic != nil { 40009 values = append(values, source.Generic) 40010 } 40011 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40012 if source.SimStatus != nil { 40013 values = append(values, source.SimStatus) 40014 } 40015 default: 40016 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40017 } 40018 } 40019 return 40020 } 40021 40022 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 40023 return fp.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40024 } 40025 40026 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem 40027 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (interface{}, bool) { 40028 switch fp.selector { 40029 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40030 res := source.GetThreeGPp() 40031 return res, res != nil 40032 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40033 res := source.GetCdma() 40034 return res, res != nil 40035 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40036 return source.GetDbusPath(), source != nil 40037 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40038 res := source.GetGeneric() 40039 return res, res != nil 40040 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40041 res := source.GetSimStatus() 40042 return res, res != nil 40043 default: 40044 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40045 } 40046 } 40047 40048 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 40049 return fp.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40050 } 40051 40052 // GetDefault returns a default value of the field type 40053 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) GetDefault() interface{} { 40054 switch fp.selector { 40055 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40056 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)(nil) 40057 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40058 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)(nil) 40059 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40060 return "" 40061 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40062 return (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)(nil) 40063 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40064 return (map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)(nil) 40065 default: 40066 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40067 } 40068 } 40069 40070 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 40071 if item != nil { 40072 switch fp.selector { 40073 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40074 item.ThreeGPp = nil 40075 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40076 item.Cdma = nil 40077 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40078 item.DbusPath = "" 40079 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40080 item.Generic = nil 40081 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40082 item.SimStatus = nil 40083 default: 40084 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40085 } 40086 } 40087 } 40088 40089 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) ClearValueRaw(item proto.Message) { 40090 fp.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40091 } 40092 40093 // IsLeaf - whether field path is holds simple value 40094 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) IsLeaf() bool { 40095 return fp.selector == DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath 40096 } 40097 40098 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 40099 return []gotenobject.FieldPath{fp} 40100 } 40101 40102 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue { 40103 switch fp.selector { 40104 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40105 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)} 40106 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40107 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)} 40108 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40109 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, value: value.(string)} 40110 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40111 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)} 40112 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40113 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, value: value.(map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)} 40114 default: 40115 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40116 } 40117 } 40118 40119 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 40120 return fp.WithIValue(value) 40121 } 40122 40123 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues { 40124 fpaov := &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp} 40125 switch fp.selector { 40126 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40127 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp)} 40128 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40129 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma)} 40130 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40131 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, values: values.([]string)} 40132 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40133 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic)} 40134 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40135 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath: *fp, values: values.([]map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)} 40136 default: 40137 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40138 } 40139 return fpaov 40140 } 40141 40142 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 40143 return fp.WithIArrayOfValues(values) 40144 } 40145 40146 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue { 40147 switch fp.selector { 40148 default: 40149 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fp.selector)) 40150 } 40151 } 40152 40153 func (fp *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 40154 return fp.WithIArrayItemValue(value) 40155 } 40156 40157 // FieldPath for map type with additional Key information 40158 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap struct { 40159 key string 40160 selector DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector 40161 } 40162 40163 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap)(nil) 40164 40165 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector { 40166 return fpm.selector 40167 } 40168 40169 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) Key() string { 40170 return fpm.key 40171 } 40172 40173 // String returns path representation in proto convention 40174 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) String() string { 40175 return fpm.selector.String() + "." + fpm.key 40176 } 40177 40178 // JSONString returns path representation is JSON convention. Note that map keys are not transformed 40179 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) JSONString() string { 40180 return strcase.ToLowerCamel(fpm.selector.String()) + "." + fpm.key 40181 } 40182 40183 // Get returns all values pointed by selected field map key from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem 40184 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (values []interface{}) { 40185 switch fpm.selector { 40186 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40187 if value, ok := source.GetSimStatus()[fpm.key]; ok { 40188 values = append(values, value) 40189 } 40190 default: 40191 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40192 } 40193 return 40194 } 40195 40196 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) GetRaw(source proto.Message) []interface{} { 40197 return fpm.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40198 } 40199 40200 // GetSingle returns value by selected field map key from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem 40201 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (interface{}, bool) { 40202 switch fpm.selector { 40203 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40204 res, ok := source.GetSimStatus()[fpm.key] 40205 return res, ok 40206 default: 40207 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40208 } 40209 } 40210 40211 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) GetSingleRaw(source proto.Message) (interface{}, bool) { 40212 return fpm.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40213 } 40214 40215 // GetDefault returns a default value of the field type 40216 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) GetDefault() interface{} { 40217 switch fpm.selector { 40218 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40219 var v *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus 40220 return v 40221 default: 40222 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40223 } 40224 } 40225 40226 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 40227 if item != nil { 40228 switch fpm.selector { 40229 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40230 delete(item.SimStatus, fpm.key) 40231 default: 40232 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40233 } 40234 } 40235 } 40236 40237 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) ClearValueRaw(item proto.Message) { 40238 fpm.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40239 } 40240 40241 // IsLeaf - whether field path is holds simple value 40242 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) IsLeaf() bool { 40243 switch fpm.selector { 40244 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40245 return false 40246 default: 40247 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40248 } 40249 } 40250 40251 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 40252 return []gotenobject.FieldPath{fpm} 40253 } 40254 40255 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue { 40256 switch fpm.selector { 40257 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40258 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap: *fpm, value: value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)} 40259 default: 40260 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40261 } 40262 } 40263 40264 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 40265 return fpm.WithIValue(value) 40266 } 40267 40268 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues { 40269 switch fpm.selector { 40270 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40271 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapArrayOfValues{DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap: *fpm, values: values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus)} 40272 default: 40273 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpm.selector)) 40274 } 40275 } 40276 40277 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 40278 return fpm.WithIArrayOfValues(values) 40279 } 40280 40281 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue { 40282 panic("Cannot create array item value from map fieldpath") 40283 } 40284 40285 func (fpm *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 40286 return fpm.WithIArrayItemValue(value) 40287 } 40288 40289 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath struct { 40290 selector DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector 40291 subPath gotenobject.FieldPath 40292 } 40293 40294 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath)(nil) 40295 40296 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) Selector() DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelector { 40297 return fps.selector 40298 } 40299 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) AsThreeGPpSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath, bool) { 40300 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPath) 40301 return res, ok 40302 } 40303 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) AsCdmaSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath, bool) { 40304 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPath) 40305 return res, ok 40306 } 40307 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) AsGenericSubPath() (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath, bool) { 40308 res, ok := fps.subPath.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPath) 40309 return res, ok 40310 } 40311 40312 // String returns path representation in proto convention 40313 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) String() string { 40314 return fps.selector.String() + "." + fps.subPath.String() 40315 } 40316 40317 // JSONString returns path representation is JSON convention 40318 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) JSONString() string { 40319 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 40320 } 40321 40322 // Get returns all values pointed by selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem 40323 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) Get(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (values []interface{}) { 40324 switch fps.selector { 40325 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40326 values = append(values, fps.subPath.GetRaw(source.GetThreeGPp())...) 40327 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40328 values = append(values, fps.subPath.GetRaw(source.GetCdma())...) 40329 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40330 values = append(values, fps.subPath.GetRaw(source.GetGeneric())...) 40331 default: 40332 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fps.selector)) 40333 } 40334 return 40335 } 40336 40337 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) GetRaw(source proto.Message) []interface{} { 40338 return fps.Get(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40339 } 40340 40341 // GetSingle returns value of selected field from source Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem 40342 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (interface{}, bool) { 40343 switch fps.selector { 40344 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40345 if source.GetThreeGPp() == nil { 40346 return nil, false 40347 } 40348 return fps.subPath.GetSingleRaw(source.GetThreeGPp()) 40349 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40350 if source.GetCdma() == nil { 40351 return nil, false 40352 } 40353 return fps.subPath.GetSingleRaw(source.GetCdma()) 40354 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40355 if source.GetGeneric() == nil { 40356 return nil, false 40357 } 40358 return fps.subPath.GetSingleRaw(source.GetGeneric()) 40359 default: 40360 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fps.selector)) 40361 } 40362 } 40363 40364 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 40365 return fps.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40366 } 40367 40368 // GetDefault returns a default value of the field type 40369 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) GetDefault() interface{} { 40370 return fps.subPath.GetDefault() 40371 } 40372 40373 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) ClearValue(item *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 40374 if item != nil { 40375 switch fps.selector { 40376 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40377 fps.subPath.ClearValueRaw(item.ThreeGPp) 40378 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40379 fps.subPath.ClearValueRaw(item.Cdma) 40380 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40381 fps.subPath.ClearValueRaw(item.Generic) 40382 default: 40383 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fps.selector)) 40384 } 40385 } 40386 } 40387 40388 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) ClearValueRaw(item proto.Message) { 40389 fps.ClearValue(item.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40390 } 40391 40392 // IsLeaf - whether field path is holds simple value 40393 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) IsLeaf() bool { 40394 return fps.subPath.IsLeaf() 40395 } 40396 40397 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 40398 iPaths := []gotenobject.FieldPath{&DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath{selector: fps.selector}} 40399 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 40400 return iPaths 40401 } 40402 40403 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) WithIValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue { 40404 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 40405 } 40406 40407 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 40408 return fps.WithIValue(value) 40409 } 40410 40411 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues { 40412 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 40413 } 40414 40415 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 40416 return fps.WithIArrayOfValues(values) 40417 } 40418 40419 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue { 40420 return &DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 40421 } 40422 40423 func (fps *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 40424 return fps.WithIArrayItemValue(value) 40425 } 40426 40427 // DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue allows storing values for Modem fields according to their type 40428 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue interface { 40429 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 40430 gotenobject.FieldPathValue 40431 SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40432 CompareWith(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (cmp int, comparable bool) 40433 } 40434 40435 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue, error) { 40436 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(pathStr) 40437 if err != nil { 40438 return nil, err 40439 } 40440 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 40441 if err != nil { 40442 return nil, status.Errorf(codes.InvalidArgument, "error parsing Modem field path value from %s: %v", valueStr, err) 40443 } 40444 return fpv.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue), nil 40445 } 40446 40447 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue { 40448 fpv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue(pathStr, valueStr) 40449 if err != nil { 40450 panic(err) 40451 } 40452 return fpv 40453 } 40454 40455 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue struct { 40456 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath 40457 value interface{} 40458 } 40459 40460 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue)(nil) 40461 40462 // GetRawValue returns raw value stored under selected path for 'Modem' as interface{} 40463 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) GetRawValue() interface{} { 40464 return fpv.value 40465 } 40466 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) AsThreeGPpValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp, bool) { 40467 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 40468 return res, ok 40469 } 40470 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) AsCdmaValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma, bool) { 40471 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 40472 return res, ok 40473 } 40474 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) AsDbusPathValue() (string, bool) { 40475 res, ok := fpv.value.(string) 40476 return res, ok 40477 } 40478 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) AsGenericValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic, bool) { 40479 res, ok := fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 40480 return res, ok 40481 } 40482 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) AsSimStatusValue() (map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus, bool) { 40483 res, ok := fpv.value.(map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40484 return res, ok 40485 } 40486 40487 // SetTo stores value for selected field for object Modem 40488 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 40489 if *target == nil { 40490 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40491 } 40492 switch fpv.selector { 40493 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40494 (*target).ThreeGPp = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 40495 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40496 (*target).Cdma = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 40497 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40498 (*target).DbusPath = fpv.value.(string) 40499 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40500 (*target).Generic = fpv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 40501 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40502 (*target).SimStatus = fpv.value.(map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40503 default: 40504 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpv.selector)) 40505 } 40506 } 40507 40508 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) SetToRaw(target proto.Message) { 40509 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40510 fpv.SetTo(&typedObject) 40511 } 40512 40513 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem'. 40514 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (int, bool) { 40515 switch fpv.selector { 40516 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40517 return 0, false 40518 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40519 return 0, false 40520 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40521 leftValue := fpv.value.(string) 40522 rightValue := source.GetDbusPath() 40523 if (leftValue) == (rightValue) { 40524 return 0, true 40525 } else if (leftValue) < (rightValue) { 40526 return -1, true 40527 } else { 40528 return 1, true 40529 } 40530 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40531 return 0, false 40532 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40533 return 0, false 40534 default: 40535 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpv.selector)) 40536 } 40537 } 40538 40539 func (fpv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 40540 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40541 } 40542 40543 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue struct { 40544 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap 40545 value interface{} 40546 } 40547 40548 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue)(nil) 40549 40550 // GetValue returns value stored under selected field in Modem as interface{} 40551 func (fpmv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue) GetRawValue() interface{} { 40552 return fpmv.value 40553 } 40554 func (fpmv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue) AsSimStatusElementValue() (*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus, bool) { 40555 res, ok := fpmv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40556 return res, ok 40557 } 40558 40559 // SetTo stores value for selected field in Modem 40560 func (fpmv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 40561 if *target == nil { 40562 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40563 } 40564 switch fpmv.selector { 40565 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40566 if (*target).SimStatus == nil { 40567 (*target).SimStatus = make(map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40568 } 40569 (*target).SimStatus[fpmv.key] = fpmv.value.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40570 default: 40571 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpmv.selector)) 40572 } 40573 } 40574 40575 func (fpmv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue) SetToRaw(target proto.Message) { 40576 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40577 fpmv.SetTo(&typedObject) 40578 } 40579 40580 // CompareWith compares value in the 'DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue' with the value under path in 'Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem'. 40581 func (fpmv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (int, bool) { 40582 switch fpmv.selector { 40583 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40584 return 0, false 40585 default: 40586 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpmv.selector)) 40587 } 40588 } 40589 40590 func (fpmv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapValue) CompareWithRaw(source proto.Message) (int, bool) { 40591 return fpmv.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40592 } 40593 40594 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue struct { 40595 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 40596 subPathValue gotenobject.FieldPathValue 40597 } 40598 40599 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue)(nil) 40600 40601 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) AsThreeGPpPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue, bool) { 40602 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue) 40603 return res, ok 40604 } 40605 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) AsCdmaPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue, bool) { 40606 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue) 40607 return res, ok 40608 } 40609 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) AsGenericPathValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue, bool) { 40610 res, ok := fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue) 40611 return res, ok 40612 } 40613 40614 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) SetTo(target **Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) { 40615 if *target == nil { 40616 *target = new(Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40617 } 40618 switch fpvs.Selector() { 40619 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40620 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue).SetTo(&(*target).ThreeGPp) 40621 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40622 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue).SetTo(&(*target).Cdma) 40623 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40624 fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue).SetTo(&(*target).Generic) 40625 default: 40626 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpvs.Selector())) 40627 } 40628 } 40629 40630 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) SetToRaw(target proto.Message) { 40631 typedObject := target.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) 40632 fpvs.SetTo(&typedObject) 40633 } 40634 40635 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) GetRawValue() interface{} { 40636 return fpvs.subPathValue.GetRawValue() 40637 } 40638 40639 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) CompareWith(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (int, bool) { 40640 switch fpvs.Selector() { 40641 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40642 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathValue).CompareWith(source.GetThreeGPp()) 40643 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40644 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathValue).CompareWith(source.GetCdma()) 40645 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40646 return fpvs.subPathValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathValue).CompareWith(source.GetGeneric()) 40647 default: 40648 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpvs.Selector())) 40649 } 40650 } 40651 40652 func (fpvs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 40653 return fpvs.CompareWith(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40654 } 40655 40656 // DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue allows storing single item in Path-specific values for Modem according to their type 40657 // Present only for array (repeated) types. 40658 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue interface { 40659 gotenobject.FieldPathArrayItemValue 40660 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 40661 ContainsValue(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) bool 40662 } 40663 40664 // ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 40665 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue, error) { 40666 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(pathStr) 40667 if err != nil { 40668 return nil, err 40669 } 40670 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 40671 if err != nil { 40672 return nil, status.Errorf(codes.InvalidArgument, "error parsing Modem field path array item value from %s: %v", valueStr, err) 40673 } 40674 return fpaiv.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue), nil 40675 } 40676 40677 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue { 40678 fpaiv, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue(pathStr, valueStr) 40679 if err != nil { 40680 panic(err) 40681 } 40682 return fpaiv 40683 } 40684 40685 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayItemValue struct { 40686 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath 40687 value interface{} 40688 } 40689 40690 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayItemValue)(nil) 40691 40692 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem as interface{} 40693 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 40694 return fpaiv.value 40695 } 40696 40697 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) (interface{}, bool) { 40698 return nil, false 40699 } 40700 40701 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 40702 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem)) 40703 } 40704 40705 // Contains returns a boolean indicating if value that is being held is present in given 'Modem' 40706 func (fpaiv *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) bool { 40707 slice := fpaiv.DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath.Get(source) 40708 for _, v := range slice { 40709 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 40710 if proto.Equal(asProtoMsg, v.(proto.Message)) { 40711 return true 40712 } 40713 } else if reflect.DeepEqual(v, fpaiv.value) { 40714 return true 40715 } 40716 } 40717 return false 40718 } 40719 40720 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue struct { 40721 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 40722 subPathItemValue gotenobject.FieldPathArrayItemValue 40723 } 40724 40725 // GetRawValue returns stored array item value 40726 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 40727 return fpaivs.subPathItemValue.GetRawItemValue() 40728 } 40729 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue) AsThreeGPpPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue, bool) { 40730 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue) 40731 return res, ok 40732 } 40733 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue) AsCdmaPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue, bool) { 40734 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue) 40735 return res, ok 40736 } 40737 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue) AsGenericPathItemValue() (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue, bool) { 40738 res, ok := fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue) 40739 return res, ok 40740 } 40741 40742 // Contains returns a boolean indicating if value that is being held is present in given 'Modem' 40743 func (fpaivs *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem) bool { 40744 switch fpaivs.Selector() { 40745 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40746 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayItemValue).ContainsValue(source.GetThreeGPp()) 40747 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40748 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayItemValue).ContainsValue(source.GetCdma()) 40749 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40750 return fpaivs.subPathItemValue.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayItemValue).ContainsValue(source.GetGeneric()) 40751 default: 40752 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Modem: %d", fpaivs.Selector())) 40753 } 40754 } 40755 40756 // DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues allows storing slice of values for Modem fields according to their type 40757 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues interface { 40758 gotenobject.FieldPathArrayOfValues 40759 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 40760 } 40761 40762 func ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues, error) { 40763 fp, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath(pathStr) 40764 if err != nil { 40765 return nil, err 40766 } 40767 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 40768 if err != nil { 40769 return nil, status.Errorf(codes.InvalidArgument, "error parsing Modem field path array of values from %s: %v", valuesStr, err) 40770 } 40771 return fpaov.(DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues), nil 40772 } 40773 40774 func MustParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues { 40775 fpaov, err := ParseDeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues(pathStr, valuesStr) 40776 if err != nil { 40777 panic(err) 40778 } 40779 return fpaov 40780 } 40781 40782 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues struct { 40783 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPath 40784 values interface{} 40785 } 40786 40787 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues)(nil) 40788 40789 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 40790 switch fpaov.selector { 40791 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorThreeGPp: 40792 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) { 40793 values = append(values, v) 40794 } 40795 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorCdma: 40796 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) { 40797 values = append(values, v) 40798 } 40799 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorDbusPath: 40800 for _, v := range fpaov.values.([]string) { 40801 values = append(values, v) 40802 } 40803 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorGeneric: 40804 for _, v := range fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) { 40805 values = append(values, v) 40806 } 40807 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40808 for _, v := range fpaov.values.([]map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) { 40809 values = append(values, v) 40810 } 40811 } 40812 return 40813 } 40814 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues) AsThreeGPpArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp, bool) { 40815 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_ThreeGpp) 40816 return res, ok 40817 } 40818 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues) AsCdmaArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma, bool) { 40819 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Cdma) 40820 return res, ok 40821 } 40822 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues) AsDbusPathArrayOfValues() ([]string, bool) { 40823 res, ok := fpaov.values.([]string) 40824 return res, ok 40825 } 40826 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues) AsGenericArrayOfValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic, bool) { 40827 res, ok := fpaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_Generic) 40828 return res, ok 40829 } 40830 func (fpaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldTerminalPathArrayOfValues) AsSimStatusArrayOfValues() ([]map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus, bool) { 40831 res, ok := fpaov.values.([]map[string]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40832 return res, ok 40833 } 40834 40835 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapArrayOfValues struct { 40836 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMap 40837 values interface{} 40838 } 40839 40840 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapArrayOfValues)(nil) 40841 40842 func (fpmaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapArrayOfValues) GetRawValues() (values []interface{}) { 40843 switch fpmaov.selector { 40844 case DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathSelectorSimStatus: 40845 for _, v := range fpmaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) { 40846 values = append(values, v) 40847 } 40848 } 40849 return 40850 } 40851 func (fpmaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathMapArrayOfValues) AsSimStatusArrayOfElementValues() ([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus, bool) { 40852 res, ok := fpmaov.values.([]*Device_Status_DeviceInfo_HardwareInformation_ModemStatus_SimStatus) 40853 return res, ok 40854 } 40855 40856 type DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues struct { 40857 DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPath 40858 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 40859 } 40860 40861 var _ DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues)(nil) 40862 40863 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 40864 return fpsaov.subPathArrayOfValues.GetRawValues() 40865 } 40866 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues) AsThreeGPpPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues, bool) { 40867 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusThreeGpp_FieldPathArrayOfValues) 40868 return res, ok 40869 } 40870 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues) AsCdmaPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues, bool) { 40871 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusCdma_FieldPathArrayOfValues) 40872 return res, ok 40873 } 40874 func (fpsaov *DeviceStatusDeviceInfoHardwareInformationModemStatusModem_FieldSubPathArrayOfValues) AsGenericPathArrayOfValues() (DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues, bool) { 40875 res, ok := fpsaov.subPathArrayOfValues.(DeviceStatusDeviceInfoHardwareInformationModemStatusGeneric_FieldPathArrayOfValues) 40876 return res, ok 40877 } 40878 40879 // FieldPath provides implementation to handle 40880 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 40881 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath interface { 40882 gotenobject.FieldPath 40883 Selector() DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector 40884 Get(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) []interface{} 40885 GetSingle(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) (interface{}, bool) 40886 ClearValue(item *Device_Status_DeviceInfo_NetworkInterface_ASInfo) 40887 40888 // Those methods build corresponding DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue 40889 // (or array of values) and holds passed value. Panics if injected type is incorrect. 40890 WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue 40891 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues 40892 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue 40893 } 40894 40895 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector int32 40896 40897 const ( 40898 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector = 0 40899 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector = 1 40900 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector = 2 40901 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector = 3 40902 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector = 4 40903 ) 40904 40905 func (s DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector) String() string { 40906 switch s { 40907 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 40908 return "asn" 40909 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 40910 return "name" 40911 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 40912 return "domain" 40913 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 40914 return "routes" 40915 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 40916 return "asn_type" 40917 default: 40918 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", s)) 40919 } 40920 } 40921 40922 func BuildDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath, error) { 40923 if len(fp) == 0 { 40924 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_NetworkInterface_ASInfo") 40925 } 40926 if len(fp) == 1 { 40927 switch fp[0] { 40928 case "asn": 40929 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn}, nil 40930 case "name": 40931 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName}, nil 40932 case "domain": 40933 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain}, nil 40934 case "routes": 40935 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes}, nil 40936 case "asn_type", "asnType", "asn-type": 40937 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType}, nil 40938 } 40939 } 40940 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_NetworkInterface_ASInfo", fp) 40941 } 40942 40943 func ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(rawField string) (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath, error) { 40944 fp, err := gotenobject.ParseRawFieldPath(rawField) 40945 if err != nil { 40946 return nil, err 40947 } 40948 return BuildDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(fp) 40949 } 40950 40951 func MustParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(rawField string) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath { 40952 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(rawField) 40953 if err != nil { 40954 panic(err) 40955 } 40956 return fp 40957 } 40958 40959 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath struct { 40960 selector DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector 40961 } 40962 40963 var _ DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath = (*DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath)(nil) 40964 40965 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) Selector() DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelector { 40966 return fp.selector 40967 } 40968 40969 // String returns path representation in proto convention 40970 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) String() string { 40971 return fp.selector.String() 40972 } 40973 40974 // JSONString returns path representation is JSON convention 40975 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) JSONString() string { 40976 return strcase.ToLowerCamel(fp.String()) 40977 } 40978 40979 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_NetworkInterface_ASInfo 40980 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) (values []interface{}) { 40981 if source != nil { 40982 switch fp.selector { 40983 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 40984 values = append(values, source.Asn) 40985 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 40986 values = append(values, source.Name) 40987 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 40988 values = append(values, source.Domain) 40989 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 40990 for _, value := range source.GetRoutes() { 40991 values = append(values, value) 40992 } 40993 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 40994 values = append(values, source.AsnType) 40995 default: 40996 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 40997 } 40998 } 40999 return 41000 } 41001 41002 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 41003 return fp.Get(source.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 41004 } 41005 41006 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_NetworkInterface_ASInfo 41007 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) (interface{}, bool) { 41008 switch fp.selector { 41009 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41010 return source.GetAsn(), source != nil 41011 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41012 return source.GetName(), source != nil 41013 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41014 return source.GetDomain(), source != nil 41015 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41016 res := source.GetRoutes() 41017 return res, res != nil 41018 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41019 return source.GetAsnType(), source != nil 41020 default: 41021 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 41022 } 41023 } 41024 41025 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 41026 return fp.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 41027 } 41028 41029 // GetDefault returns a default value of the field type 41030 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) GetDefault() interface{} { 41031 switch fp.selector { 41032 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41033 return "" 41034 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41035 return "" 41036 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41037 return "" 41038 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41039 return ([]string)(nil) 41040 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41041 return "" 41042 default: 41043 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 41044 } 41045 } 41046 41047 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_NetworkInterface_ASInfo) { 41048 if item != nil { 41049 switch fp.selector { 41050 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41051 item.Asn = "" 41052 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41053 item.Name = "" 41054 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41055 item.Domain = "" 41056 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41057 item.Routes = nil 41058 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41059 item.AsnType = "" 41060 default: 41061 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 41062 } 41063 } 41064 } 41065 41066 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 41067 fp.ClearValue(item.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 41068 } 41069 41070 // IsLeaf - whether field path is holds simple value 41071 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) IsLeaf() bool { 41072 return fp.selector == DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn || 41073 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName || 41074 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain || 41075 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes || 41076 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType 41077 } 41078 41079 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 41080 return []gotenobject.FieldPath{fp} 41081 } 41082 41083 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue { 41084 switch fp.selector { 41085 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41086 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, value: value.(string)} 41087 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41088 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, value: value.(string)} 41089 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41090 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, value: value.(string)} 41091 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41092 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, value: value.([]string)} 41093 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41094 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, value: value.(string)} 41095 default: 41096 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 41097 } 41098 } 41099 41100 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 41101 return fp.WithIValue(value) 41102 } 41103 41104 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues { 41105 fpaov := &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp} 41106 switch fp.selector { 41107 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41108 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, values: values.([]string)} 41109 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41110 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, values: values.([]string)} 41111 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41112 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, values: values.([]string)} 41113 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41114 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, values: values.([][]string)} 41115 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41116 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, values: values.([]string)} 41117 default: 41118 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 41119 } 41120 return fpaov 41121 } 41122 41123 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 41124 return fp.WithIArrayOfValues(values) 41125 } 41126 41127 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue { 41128 switch fp.selector { 41129 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41130 return &DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue{DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath: *fp, value: value.(string)} 41131 default: 41132 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fp.selector)) 41133 } 41134 } 41135 41136 func (fp *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 41137 return fp.WithIArrayItemValue(value) 41138 } 41139 41140 // DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue allows storing values for ASInfo fields according to their type 41141 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue interface { 41142 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath 41143 gotenobject.FieldPathValue 41144 SetTo(target **Device_Status_DeviceInfo_NetworkInterface_ASInfo) 41145 CompareWith(*Device_Status_DeviceInfo_NetworkInterface_ASInfo) (cmp int, comparable bool) 41146 } 41147 41148 func ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue, error) { 41149 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(pathStr) 41150 if err != nil { 41151 return nil, err 41152 } 41153 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 41154 if err != nil { 41155 return nil, status.Errorf(codes.InvalidArgument, "error parsing ASInfo field path value from %s: %v", valueStr, err) 41156 } 41157 return fpv.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue), nil 41158 } 41159 41160 func MustParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue { 41161 fpv, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue(pathStr, valueStr) 41162 if err != nil { 41163 panic(err) 41164 } 41165 return fpv 41166 } 41167 41168 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue struct { 41169 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath 41170 value interface{} 41171 } 41172 41173 var _ DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathValue = (*DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue)(nil) 41174 41175 // GetRawValue returns raw value stored under selected path for 'ASInfo' as interface{} 41176 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) GetRawValue() interface{} { 41177 return fpv.value 41178 } 41179 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) AsAsnValue() (string, bool) { 41180 res, ok := fpv.value.(string) 41181 return res, ok 41182 } 41183 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) AsNameValue() (string, bool) { 41184 res, ok := fpv.value.(string) 41185 return res, ok 41186 } 41187 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) AsDomainValue() (string, bool) { 41188 res, ok := fpv.value.(string) 41189 return res, ok 41190 } 41191 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) AsRoutesValue() ([]string, bool) { 41192 res, ok := fpv.value.([]string) 41193 return res, ok 41194 } 41195 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) AsAsnTypeValue() (string, bool) { 41196 res, ok := fpv.value.(string) 41197 return res, ok 41198 } 41199 41200 // SetTo stores value for selected field for object ASInfo 41201 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_NetworkInterface_ASInfo) { 41202 if *target == nil { 41203 *target = new(Device_Status_DeviceInfo_NetworkInterface_ASInfo) 41204 } 41205 switch fpv.selector { 41206 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41207 (*target).Asn = fpv.value.(string) 41208 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41209 (*target).Name = fpv.value.(string) 41210 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41211 (*target).Domain = fpv.value.(string) 41212 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41213 (*target).Routes = fpv.value.([]string) 41214 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41215 (*target).AsnType = fpv.value.(string) 41216 default: 41217 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fpv.selector)) 41218 } 41219 } 41220 41221 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 41222 typedObject := target.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo) 41223 fpv.SetTo(&typedObject) 41224 } 41225 41226 // CompareWith compares value in the 'DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_NetworkInterface_ASInfo'. 41227 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) (int, bool) { 41228 switch fpv.selector { 41229 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41230 leftValue := fpv.value.(string) 41231 rightValue := source.GetAsn() 41232 if (leftValue) == (rightValue) { 41233 return 0, true 41234 } else if (leftValue) < (rightValue) { 41235 return -1, true 41236 } else { 41237 return 1, true 41238 } 41239 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41240 leftValue := fpv.value.(string) 41241 rightValue := source.GetName() 41242 if (leftValue) == (rightValue) { 41243 return 0, true 41244 } else if (leftValue) < (rightValue) { 41245 return -1, true 41246 } else { 41247 return 1, true 41248 } 41249 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41250 leftValue := fpv.value.(string) 41251 rightValue := source.GetDomain() 41252 if (leftValue) == (rightValue) { 41253 return 0, true 41254 } else if (leftValue) < (rightValue) { 41255 return -1, true 41256 } else { 41257 return 1, true 41258 } 41259 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41260 return 0, false 41261 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41262 leftValue := fpv.value.(string) 41263 rightValue := source.GetAsnType() 41264 if (leftValue) == (rightValue) { 41265 return 0, true 41266 } else if (leftValue) < (rightValue) { 41267 return -1, true 41268 } else { 41269 return 1, true 41270 } 41271 default: 41272 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_ASInfo: %d", fpv.selector)) 41273 } 41274 } 41275 41276 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 41277 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 41278 } 41279 41280 // DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for ASInfo according to their type 41281 // Present only for array (repeated) types. 41282 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue interface { 41283 gotenobject.FieldPathArrayItemValue 41284 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath 41285 ContainsValue(*Device_Status_DeviceInfo_NetworkInterface_ASInfo) bool 41286 } 41287 41288 // ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 41289 func ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue, error) { 41290 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(pathStr) 41291 if err != nil { 41292 return nil, err 41293 } 41294 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 41295 if err != nil { 41296 return nil, status.Errorf(codes.InvalidArgument, "error parsing ASInfo field path array item value from %s: %v", valueStr, err) 41297 } 41298 return fpaiv.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue), nil 41299 } 41300 41301 func MustParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue { 41302 fpaiv, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue(pathStr, valueStr) 41303 if err != nil { 41304 panic(err) 41305 } 41306 return fpaiv 41307 } 41308 41309 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue struct { 41310 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath 41311 value interface{} 41312 } 41313 41314 var _ DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue)(nil) 41315 41316 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_NetworkInterface_ASInfo as interface{} 41317 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 41318 return fpaiv.value 41319 } 41320 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue) AsRoutesItemValue() (string, bool) { 41321 res, ok := fpaiv.value.(string) 41322 return res, ok 41323 } 41324 41325 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) (interface{}, bool) { 41326 return nil, false 41327 } 41328 41329 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 41330 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface_ASInfo)) 41331 } 41332 41333 // Contains returns a boolean indicating if value that is being held is present in given 'ASInfo' 41334 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_NetworkInterface_ASInfo) bool { 41335 slice := fpaiv.DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath.Get(source) 41336 for _, v := range slice { 41337 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 41338 if proto.Equal(asProtoMsg, v.(proto.Message)) { 41339 return true 41340 } 41341 } else if reflect.DeepEqual(v, fpaiv.value) { 41342 return true 41343 } 41344 } 41345 return false 41346 } 41347 41348 // DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues allows storing slice of values for ASInfo fields according to their type 41349 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues interface { 41350 gotenobject.FieldPathArrayOfValues 41351 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath 41352 } 41353 41354 func ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues, error) { 41355 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPath(pathStr) 41356 if err != nil { 41357 return nil, err 41358 } 41359 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 41360 if err != nil { 41361 return nil, status.Errorf(codes.InvalidArgument, "error parsing ASInfo field path array of values from %s: %v", valuesStr, err) 41362 } 41363 return fpaov.(DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues), nil 41364 } 41365 41366 func MustParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues { 41367 fpaov, err := ParseDeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues(pathStr, valuesStr) 41368 if err != nil { 41369 panic(err) 41370 } 41371 return fpaov 41372 } 41373 41374 type DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues struct { 41375 DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPath 41376 values interface{} 41377 } 41378 41379 var _ DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues)(nil) 41380 41381 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 41382 switch fpaov.selector { 41383 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsn: 41384 for _, v := range fpaov.values.([]string) { 41385 values = append(values, v) 41386 } 41387 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorName: 41388 for _, v := range fpaov.values.([]string) { 41389 values = append(values, v) 41390 } 41391 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorDomain: 41392 for _, v := range fpaov.values.([]string) { 41393 values = append(values, v) 41394 } 41395 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorRoutes: 41396 for _, v := range fpaov.values.([][]string) { 41397 values = append(values, v) 41398 } 41399 case DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldPathSelectorAsnType: 41400 for _, v := range fpaov.values.([]string) { 41401 values = append(values, v) 41402 } 41403 } 41404 return 41405 } 41406 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues) AsAsnArrayOfValues() ([]string, bool) { 41407 res, ok := fpaov.values.([]string) 41408 return res, ok 41409 } 41410 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 41411 res, ok := fpaov.values.([]string) 41412 return res, ok 41413 } 41414 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues) AsDomainArrayOfValues() ([]string, bool) { 41415 res, ok := fpaov.values.([]string) 41416 return res, ok 41417 } 41418 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues) AsRoutesArrayOfValues() ([][]string, bool) { 41419 res, ok := fpaov.values.([][]string) 41420 return res, ok 41421 } 41422 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceASInfo_FieldTerminalPathArrayOfValues) AsAsnTypeArrayOfValues() ([]string, bool) { 41423 res, ok := fpaov.values.([]string) 41424 return res, ok 41425 } 41426 41427 // FieldPath provides implementation to handle 41428 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 41429 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath interface { 41430 gotenobject.FieldPath 41431 Selector() DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector 41432 Get(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) []interface{} 41433 GetSingle(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) (interface{}, bool) 41434 ClearValue(item *Device_Status_DeviceInfo_NetworkInterface_Carrier) 41435 41436 // Those methods build corresponding DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue 41437 // (or array of values) and holds passed value. Panics if injected type is incorrect. 41438 WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue 41439 WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues 41440 WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue 41441 } 41442 41443 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector int32 41444 41445 const ( 41446 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector = 0 41447 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector = 1 41448 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector = 2 41449 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector = 3 41450 ) 41451 41452 func (s DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector) String() string { 41453 switch s { 41454 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41455 return "name" 41456 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41457 return "mobile_country_code" 41458 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41459 return "mobile_network_code" 41460 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41461 return "location_area_code" 41462 default: 41463 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", s)) 41464 } 41465 } 41466 41467 func BuildDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(fp gotenobject.RawFieldPath) (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath, error) { 41468 if len(fp) == 0 { 41469 return nil, status.Error(codes.InvalidArgument, "empty field path for object Device_Status_DeviceInfo_NetworkInterface_Carrier") 41470 } 41471 if len(fp) == 1 { 41472 switch fp[0] { 41473 case "name": 41474 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName}, nil 41475 case "mobile_country_code", "mobileCountryCode", "mobile-country-code": 41476 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode}, nil 41477 case "mobile_network_code", "mobileNetworkCode", "mobile-network-code": 41478 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode}, nil 41479 case "location_area_code", "locationAreaCode", "location-area-code": 41480 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath{selector: DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode}, nil 41481 } 41482 } 41483 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Device_Status_DeviceInfo_NetworkInterface_Carrier", fp) 41484 } 41485 41486 func ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(rawField string) (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath, error) { 41487 fp, err := gotenobject.ParseRawFieldPath(rawField) 41488 if err != nil { 41489 return nil, err 41490 } 41491 return BuildDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(fp) 41492 } 41493 41494 func MustParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(rawField string) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath { 41495 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(rawField) 41496 if err != nil { 41497 panic(err) 41498 } 41499 return fp 41500 } 41501 41502 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath struct { 41503 selector DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector 41504 } 41505 41506 var _ DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath = (*DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath)(nil) 41507 41508 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) Selector() DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelector { 41509 return fp.selector 41510 } 41511 41512 // String returns path representation in proto convention 41513 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) String() string { 41514 return fp.selector.String() 41515 } 41516 41517 // JSONString returns path representation is JSON convention 41518 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) JSONString() string { 41519 return strcase.ToLowerCamel(fp.String()) 41520 } 41521 41522 // Get returns all values pointed by specific field from source Device_Status_DeviceInfo_NetworkInterface_Carrier 41523 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) Get(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) (values []interface{}) { 41524 if source != nil { 41525 switch fp.selector { 41526 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41527 values = append(values, source.Name) 41528 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41529 values = append(values, source.MobileCountryCode) 41530 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41531 values = append(values, source.MobileNetworkCode) 41532 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41533 values = append(values, source.LocationAreaCode) 41534 default: 41535 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41536 } 41537 } 41538 return 41539 } 41540 41541 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 41542 return fp.Get(source.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 41543 } 41544 41545 // GetSingle returns value pointed by specific field of from source Device_Status_DeviceInfo_NetworkInterface_Carrier 41546 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) (interface{}, bool) { 41547 switch fp.selector { 41548 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41549 return source.GetName(), source != nil 41550 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41551 return source.GetMobileCountryCode(), source != nil 41552 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41553 return source.GetMobileNetworkCode(), source != nil 41554 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41555 return source.GetLocationAreaCode(), source != nil 41556 default: 41557 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41558 } 41559 } 41560 41561 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 41562 return fp.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 41563 } 41564 41565 // GetDefault returns a default value of the field type 41566 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) GetDefault() interface{} { 41567 switch fp.selector { 41568 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41569 return "" 41570 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41571 return "" 41572 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41573 return "" 41574 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41575 return "" 41576 default: 41577 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41578 } 41579 } 41580 41581 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) ClearValue(item *Device_Status_DeviceInfo_NetworkInterface_Carrier) { 41582 if item != nil { 41583 switch fp.selector { 41584 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41585 item.Name = "" 41586 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41587 item.MobileCountryCode = "" 41588 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41589 item.MobileNetworkCode = "" 41590 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41591 item.LocationAreaCode = "" 41592 default: 41593 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41594 } 41595 } 41596 } 41597 41598 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) ClearValueRaw(item proto.Message) { 41599 fp.ClearValue(item.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 41600 } 41601 41602 // IsLeaf - whether field path is holds simple value 41603 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) IsLeaf() bool { 41604 return fp.selector == DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName || 41605 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode || 41606 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode || 41607 fp.selector == DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode 41608 } 41609 41610 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 41611 return []gotenobject.FieldPath{fp} 41612 } 41613 41614 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) WithIValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue { 41615 switch fp.selector { 41616 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41617 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, value: value.(string)} 41618 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41619 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, value: value.(string)} 41620 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41621 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, value: value.(string)} 41622 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41623 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, value: value.(string)} 41624 default: 41625 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41626 } 41627 } 41628 41629 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 41630 return fp.WithIValue(value) 41631 } 41632 41633 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) WithIArrayOfValues(values interface{}) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues { 41634 fpaov := &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp} 41635 switch fp.selector { 41636 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41637 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, values: values.([]string)} 41638 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41639 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, values: values.([]string)} 41640 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41641 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, values: values.([]string)} 41642 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41643 return &DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues{DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath: *fp, values: values.([]string)} 41644 default: 41645 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41646 } 41647 return fpaov 41648 } 41649 41650 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 41651 return fp.WithIArrayOfValues(values) 41652 } 41653 41654 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) WithIArrayItemValue(value interface{}) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue { 41655 switch fp.selector { 41656 default: 41657 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fp.selector)) 41658 } 41659 } 41660 41661 func (fp *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 41662 return fp.WithIArrayItemValue(value) 41663 } 41664 41665 // DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue allows storing values for Carrier fields according to their type 41666 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue interface { 41667 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath 41668 gotenobject.FieldPathValue 41669 SetTo(target **Device_Status_DeviceInfo_NetworkInterface_Carrier) 41670 CompareWith(*Device_Status_DeviceInfo_NetworkInterface_Carrier) (cmp int, comparable bool) 41671 } 41672 41673 func ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue(pathStr, valueStr string) (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue, error) { 41674 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(pathStr) 41675 if err != nil { 41676 return nil, err 41677 } 41678 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 41679 if err != nil { 41680 return nil, status.Errorf(codes.InvalidArgument, "error parsing Carrier field path value from %s: %v", valueStr, err) 41681 } 41682 return fpv.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue), nil 41683 } 41684 41685 func MustParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue(pathStr, valueStr string) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue { 41686 fpv, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue(pathStr, valueStr) 41687 if err != nil { 41688 panic(err) 41689 } 41690 return fpv 41691 } 41692 41693 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue struct { 41694 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath 41695 value interface{} 41696 } 41697 41698 var _ DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathValue = (*DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue)(nil) 41699 41700 // GetRawValue returns raw value stored under selected path for 'Carrier' as interface{} 41701 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) GetRawValue() interface{} { 41702 return fpv.value 41703 } 41704 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) AsNameValue() (string, bool) { 41705 res, ok := fpv.value.(string) 41706 return res, ok 41707 } 41708 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) AsMobileCountryCodeValue() (string, bool) { 41709 res, ok := fpv.value.(string) 41710 return res, ok 41711 } 41712 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) AsMobileNetworkCodeValue() (string, bool) { 41713 res, ok := fpv.value.(string) 41714 return res, ok 41715 } 41716 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) AsLocationAreaCodeValue() (string, bool) { 41717 res, ok := fpv.value.(string) 41718 return res, ok 41719 } 41720 41721 // SetTo stores value for selected field for object Carrier 41722 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) SetTo(target **Device_Status_DeviceInfo_NetworkInterface_Carrier) { 41723 if *target == nil { 41724 *target = new(Device_Status_DeviceInfo_NetworkInterface_Carrier) 41725 } 41726 switch fpv.selector { 41727 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41728 (*target).Name = fpv.value.(string) 41729 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41730 (*target).MobileCountryCode = fpv.value.(string) 41731 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41732 (*target).MobileNetworkCode = fpv.value.(string) 41733 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41734 (*target).LocationAreaCode = fpv.value.(string) 41735 default: 41736 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fpv.selector)) 41737 } 41738 } 41739 41740 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) SetToRaw(target proto.Message) { 41741 typedObject := target.(*Device_Status_DeviceInfo_NetworkInterface_Carrier) 41742 fpv.SetTo(&typedObject) 41743 } 41744 41745 // CompareWith compares value in the 'DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue' with the value under path in 'Device_Status_DeviceInfo_NetworkInterface_Carrier'. 41746 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) CompareWith(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) (int, bool) { 41747 switch fpv.selector { 41748 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41749 leftValue := fpv.value.(string) 41750 rightValue := source.GetName() 41751 if (leftValue) == (rightValue) { 41752 return 0, true 41753 } else if (leftValue) < (rightValue) { 41754 return -1, true 41755 } else { 41756 return 1, true 41757 } 41758 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41759 leftValue := fpv.value.(string) 41760 rightValue := source.GetMobileCountryCode() 41761 if (leftValue) == (rightValue) { 41762 return 0, true 41763 } else if (leftValue) < (rightValue) { 41764 return -1, true 41765 } else { 41766 return 1, true 41767 } 41768 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41769 leftValue := fpv.value.(string) 41770 rightValue := source.GetMobileNetworkCode() 41771 if (leftValue) == (rightValue) { 41772 return 0, true 41773 } else if (leftValue) < (rightValue) { 41774 return -1, true 41775 } else { 41776 return 1, true 41777 } 41778 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41779 leftValue := fpv.value.(string) 41780 rightValue := source.GetLocationAreaCode() 41781 if (leftValue) == (rightValue) { 41782 return 0, true 41783 } else if (leftValue) < (rightValue) { 41784 return -1, true 41785 } else { 41786 return 1, true 41787 } 41788 default: 41789 panic(fmt.Sprintf("Invalid selector for Device_Status_DeviceInfo_NetworkInterface_Carrier: %d", fpv.selector)) 41790 } 41791 } 41792 41793 func (fpv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 41794 return fpv.CompareWith(source.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 41795 } 41796 41797 // DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue allows storing single item in Path-specific values for Carrier according to their type 41798 // Present only for array (repeated) types. 41799 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue interface { 41800 gotenobject.FieldPathArrayItemValue 41801 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath 41802 ContainsValue(*Device_Status_DeviceInfo_NetworkInterface_Carrier) bool 41803 } 41804 41805 // ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 41806 func ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue(pathStr, valueStr string) (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue, error) { 41807 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(pathStr) 41808 if err != nil { 41809 return nil, err 41810 } 41811 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 41812 if err != nil { 41813 return nil, status.Errorf(codes.InvalidArgument, "error parsing Carrier field path array item value from %s: %v", valueStr, err) 41814 } 41815 return fpaiv.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue), nil 41816 } 41817 41818 func MustParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue(pathStr, valueStr string) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue { 41819 fpaiv, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue(pathStr, valueStr) 41820 if err != nil { 41821 panic(err) 41822 } 41823 return fpaiv 41824 } 41825 41826 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayItemValue struct { 41827 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath 41828 value interface{} 41829 } 41830 41831 var _ DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayItemValue = (*DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayItemValue)(nil) 41832 41833 // GetRawValue returns stored element value for array in object Device_Status_DeviceInfo_NetworkInterface_Carrier as interface{} 41834 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 41835 return fpaiv.value 41836 } 41837 41838 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayItemValue) GetSingle(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) (interface{}, bool) { 41839 return nil, false 41840 } 41841 41842 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 41843 return fpaiv.GetSingle(source.(*Device_Status_DeviceInfo_NetworkInterface_Carrier)) 41844 } 41845 41846 // Contains returns a boolean indicating if value that is being held is present in given 'Carrier' 41847 func (fpaiv *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayItemValue) ContainsValue(source *Device_Status_DeviceInfo_NetworkInterface_Carrier) bool { 41848 slice := fpaiv.DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath.Get(source) 41849 for _, v := range slice { 41850 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 41851 if proto.Equal(asProtoMsg, v.(proto.Message)) { 41852 return true 41853 } 41854 } else if reflect.DeepEqual(v, fpaiv.value) { 41855 return true 41856 } 41857 } 41858 return false 41859 } 41860 41861 // DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues allows storing slice of values for Carrier fields according to their type 41862 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues interface { 41863 gotenobject.FieldPathArrayOfValues 41864 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath 41865 } 41866 41867 func ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues(pathStr, valuesStr string) (DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues, error) { 41868 fp, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPath(pathStr) 41869 if err != nil { 41870 return nil, err 41871 } 41872 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 41873 if err != nil { 41874 return nil, status.Errorf(codes.InvalidArgument, "error parsing Carrier field path array of values from %s: %v", valuesStr, err) 41875 } 41876 return fpaov.(DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues), nil 41877 } 41878 41879 func MustParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues(pathStr, valuesStr string) DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues { 41880 fpaov, err := ParseDeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues(pathStr, valuesStr) 41881 if err != nil { 41882 panic(err) 41883 } 41884 return fpaov 41885 } 41886 41887 type DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues struct { 41888 DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPath 41889 values interface{} 41890 } 41891 41892 var _ DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathArrayOfValues = (*DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues)(nil) 41893 41894 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 41895 switch fpaov.selector { 41896 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorName: 41897 for _, v := range fpaov.values.([]string) { 41898 values = append(values, v) 41899 } 41900 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileCountryCode: 41901 for _, v := range fpaov.values.([]string) { 41902 values = append(values, v) 41903 } 41904 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorMobileNetworkCode: 41905 for _, v := range fpaov.values.([]string) { 41906 values = append(values, v) 41907 } 41908 case DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldPathSelectorLocationAreaCode: 41909 for _, v := range fpaov.values.([]string) { 41910 values = append(values, v) 41911 } 41912 } 41913 return 41914 } 41915 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 41916 res, ok := fpaov.values.([]string) 41917 return res, ok 41918 } 41919 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues) AsMobileCountryCodeArrayOfValues() ([]string, bool) { 41920 res, ok := fpaov.values.([]string) 41921 return res, ok 41922 } 41923 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues) AsMobileNetworkCodeArrayOfValues() ([]string, bool) { 41924 res, ok := fpaov.values.([]string) 41925 return res, ok 41926 } 41927 func (fpaov *DeviceStatusDeviceInfoNetworkInterfaceCarrier_FieldTerminalPathArrayOfValues) AsLocationAreaCodeArrayOfValues() ([]string, bool) { 41928 res, ok := fpaov.values.([]string) 41929 return res, ok 41930 }