-
Notifications
You must be signed in to change notification settings - Fork 1
/
project.pb.fieldpath.go
685 lines (589 loc) · 21.3 KB
/
project.pb.fieldpath.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
// Code generated by protoc-gen-goten-object
// File: edgelq/devices/proto/v1alpha/project.proto
// DO NOT EDIT!!!
package project
import (
"encoding/json"
"fmt"
"reflect"
"strings"
"time"
"github.com/iancoleman/strcase"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoregistry"
"google.golang.org/protobuf/types/known/fieldmaskpb"
gotenobject "github.com/cloudwan/goten-sdk/runtime/object"
)
// proto imports
import (
ntt_meta "github.com/cloudwan/edgelq-sdk/common/types/meta"
)
// ensure the imports are used
var (
_ = new(json.Marshaler)
_ = new(fmt.Stringer)
_ = reflect.DeepEqual
_ = strings.Builder{}
_ = time.Second
_ = strcase.ToLowerCamel
_ = codes.NotFound
_ = status.Status{}
_ = protojson.UnmarshalOptions{}
_ = new(proto.Message)
_ = protoregistry.GlobalTypes
_ = fieldmaskpb.FieldMask{}
_ = new(gotenobject.FieldPath)
)
// make sure we're using proto imports
var (
_ = &ntt_meta.Meta{}
)
// FieldPath provides implementation to handle
// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto
type Project_FieldPath interface {
gotenobject.FieldPath
Selector() Project_FieldPathSelector
Get(source *Project) []interface{}
GetSingle(source *Project) (interface{}, bool)
ClearValue(item *Project)
// Those methods build corresponding Project_FieldPathValue
// (or array of values) and holds passed value. Panics if injected type is incorrect.
WithIValue(value interface{}) Project_FieldPathValue
WithIArrayOfValues(values interface{}) Project_FieldPathArrayOfValues
WithIArrayItemValue(value interface{}) Project_FieldPathArrayItemValue
}
type Project_FieldPathSelector int32
const (
Project_FieldPathSelectorName Project_FieldPathSelector = 0
Project_FieldPathSelectorMetadata Project_FieldPathSelector = 1
)
func (s Project_FieldPathSelector) String() string {
switch s {
case Project_FieldPathSelectorName:
return "name"
case Project_FieldPathSelectorMetadata:
return "metadata"
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", s))
}
}
func BuildProject_FieldPath(fp gotenobject.RawFieldPath) (Project_FieldPath, error) {
if len(fp) == 0 {
return nil, status.Error(codes.InvalidArgument, "empty field path for object Project")
}
if len(fp) == 1 {
switch fp[0] {
case "name":
return &Project_FieldTerminalPath{selector: Project_FieldPathSelectorName}, nil
case "metadata":
return &Project_FieldTerminalPath{selector: Project_FieldPathSelectorMetadata}, nil
}
} else {
switch fp[0] {
case "metadata":
if subpath, err := ntt_meta.BuildMeta_FieldPath(fp[1:]); err != nil {
return nil, err
} else {
return &Project_FieldSubPath{selector: Project_FieldPathSelectorMetadata, subPath: subpath}, nil
}
}
}
return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object Project", fp)
}
func ParseProject_FieldPath(rawField string) (Project_FieldPath, error) {
fp, err := gotenobject.ParseRawFieldPath(rawField)
if err != nil {
return nil, err
}
return BuildProject_FieldPath(fp)
}
func MustParseProject_FieldPath(rawField string) Project_FieldPath {
fp, err := ParseProject_FieldPath(rawField)
if err != nil {
panic(err)
}
return fp
}
type Project_FieldTerminalPath struct {
selector Project_FieldPathSelector
}
var _ Project_FieldPath = (*Project_FieldTerminalPath)(nil)
func (fp *Project_FieldTerminalPath) Selector() Project_FieldPathSelector {
return fp.selector
}
// String returns path representation in proto convention
func (fp *Project_FieldTerminalPath) String() string {
return fp.selector.String()
}
// JSONString returns path representation is JSON convention
func (fp *Project_FieldTerminalPath) JSONString() string {
return strcase.ToLowerCamel(fp.String())
}
// Get returns all values pointed by specific field from source Project
func (fp *Project_FieldTerminalPath) Get(source *Project) (values []interface{}) {
if source != nil {
switch fp.selector {
case Project_FieldPathSelectorName:
if source.Name != nil {
values = append(values, source.Name)
}
case Project_FieldPathSelectorMetadata:
if source.Metadata != nil {
values = append(values, source.Metadata)
}
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
}
return
}
func (fp *Project_FieldTerminalPath) GetRaw(source proto.Message) []interface{} {
return fp.Get(source.(*Project))
}
// GetSingle returns value pointed by specific field of from source Project
func (fp *Project_FieldTerminalPath) GetSingle(source *Project) (interface{}, bool) {
switch fp.selector {
case Project_FieldPathSelectorName:
res := source.GetName()
return res, res != nil
case Project_FieldPathSelectorMetadata:
res := source.GetMetadata()
return res, res != nil
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
}
func (fp *Project_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) {
return fp.GetSingle(source.(*Project))
}
// GetDefault returns a default value of the field type
func (fp *Project_FieldTerminalPath) GetDefault() interface{} {
switch fp.selector {
case Project_FieldPathSelectorName:
return (*Name)(nil)
case Project_FieldPathSelectorMetadata:
return (*ntt_meta.Meta)(nil)
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
}
func (fp *Project_FieldTerminalPath) ClearValue(item *Project) {
if item != nil {
switch fp.selector {
case Project_FieldPathSelectorName:
item.Name = nil
case Project_FieldPathSelectorMetadata:
item.Metadata = nil
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
}
}
func (fp *Project_FieldTerminalPath) ClearValueRaw(item proto.Message) {
fp.ClearValue(item.(*Project))
}
// IsLeaf - whether field path is holds simple value
func (fp *Project_FieldTerminalPath) IsLeaf() bool {
return fp.selector == Project_FieldPathSelectorName
}
func (fp *Project_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath {
return []gotenobject.FieldPath{fp}
}
func (fp *Project_FieldTerminalPath) WithIValue(value interface{}) Project_FieldPathValue {
switch fp.selector {
case Project_FieldPathSelectorName:
return &Project_FieldTerminalPathValue{Project_FieldTerminalPath: *fp, value: value.(*Name)}
case Project_FieldPathSelectorMetadata:
return &Project_FieldTerminalPathValue{Project_FieldTerminalPath: *fp, value: value.(*ntt_meta.Meta)}
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
}
func (fp *Project_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue {
return fp.WithIValue(value)
}
func (fp *Project_FieldTerminalPath) WithIArrayOfValues(values interface{}) Project_FieldPathArrayOfValues {
fpaov := &Project_FieldTerminalPathArrayOfValues{Project_FieldTerminalPath: *fp}
switch fp.selector {
case Project_FieldPathSelectorName:
return &Project_FieldTerminalPathArrayOfValues{Project_FieldTerminalPath: *fp, values: values.([]*Name)}
case Project_FieldPathSelectorMetadata:
return &Project_FieldTerminalPathArrayOfValues{Project_FieldTerminalPath: *fp, values: values.([]*ntt_meta.Meta)}
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
return fpaov
}
func (fp *Project_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues {
return fp.WithIArrayOfValues(values)
}
func (fp *Project_FieldTerminalPath) WithIArrayItemValue(value interface{}) Project_FieldPathArrayItemValue {
switch fp.selector {
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fp.selector))
}
}
func (fp *Project_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue {
return fp.WithIArrayItemValue(value)
}
type Project_FieldSubPath struct {
selector Project_FieldPathSelector
subPath gotenobject.FieldPath
}
var _ Project_FieldPath = (*Project_FieldSubPath)(nil)
func (fps *Project_FieldSubPath) Selector() Project_FieldPathSelector {
return fps.selector
}
func (fps *Project_FieldSubPath) AsMetadataSubPath() (ntt_meta.Meta_FieldPath, bool) {
res, ok := fps.subPath.(ntt_meta.Meta_FieldPath)
return res, ok
}
// String returns path representation in proto convention
func (fps *Project_FieldSubPath) String() string {
return fps.selector.String() + "." + fps.subPath.String()
}
// JSONString returns path representation is JSON convention
func (fps *Project_FieldSubPath) JSONString() string {
return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString()
}
// Get returns all values pointed by selected field from source Project
func (fps *Project_FieldSubPath) Get(source *Project) (values []interface{}) {
switch fps.selector {
case Project_FieldPathSelectorMetadata:
values = append(values, fps.subPath.GetRaw(source.GetMetadata())...)
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fps.selector))
}
return
}
func (fps *Project_FieldSubPath) GetRaw(source proto.Message) []interface{} {
return fps.Get(source.(*Project))
}
// GetSingle returns value of selected field from source Project
func (fps *Project_FieldSubPath) GetSingle(source *Project) (interface{}, bool) {
switch fps.selector {
case Project_FieldPathSelectorMetadata:
if source.GetMetadata() == nil {
return nil, false
}
return fps.subPath.GetSingleRaw(source.GetMetadata())
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fps.selector))
}
}
func (fps *Project_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) {
return fps.GetSingle(source.(*Project))
}
// GetDefault returns a default value of the field type
func (fps *Project_FieldSubPath) GetDefault() interface{} {
return fps.subPath.GetDefault()
}
func (fps *Project_FieldSubPath) ClearValue(item *Project) {
if item != nil {
switch fps.selector {
case Project_FieldPathSelectorMetadata:
fps.subPath.ClearValueRaw(item.Metadata)
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fps.selector))
}
}
}
func (fps *Project_FieldSubPath) ClearValueRaw(item proto.Message) {
fps.ClearValue(item.(*Project))
}
// IsLeaf - whether field path is holds simple value
func (fps *Project_FieldSubPath) IsLeaf() bool {
return fps.subPath.IsLeaf()
}
func (fps *Project_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath {
iPaths := []gotenobject.FieldPath{&Project_FieldTerminalPath{selector: fps.selector}}
iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...)
return iPaths
}
func (fps *Project_FieldSubPath) WithIValue(value interface{}) Project_FieldPathValue {
return &Project_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)}
}
func (fps *Project_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue {
return fps.WithIValue(value)
}
func (fps *Project_FieldSubPath) WithIArrayOfValues(values interface{}) Project_FieldPathArrayOfValues {
return &Project_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)}
}
func (fps *Project_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues {
return fps.WithIArrayOfValues(values)
}
func (fps *Project_FieldSubPath) WithIArrayItemValue(value interface{}) Project_FieldPathArrayItemValue {
return &Project_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)}
}
func (fps *Project_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue {
return fps.WithIArrayItemValue(value)
}
// Project_FieldPathValue allows storing values for Project fields according to their type
type Project_FieldPathValue interface {
Project_FieldPath
gotenobject.FieldPathValue
SetTo(target **Project)
CompareWith(*Project) (cmp int, comparable bool)
}
func ParseProject_FieldPathValue(pathStr, valueStr string) (Project_FieldPathValue, error) {
fp, err := ParseProject_FieldPath(pathStr)
if err != nil {
return nil, err
}
fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "error parsing Project field path value from %s: %v", valueStr, err)
}
return fpv.(Project_FieldPathValue), nil
}
func MustParseProject_FieldPathValue(pathStr, valueStr string) Project_FieldPathValue {
fpv, err := ParseProject_FieldPathValue(pathStr, valueStr)
if err != nil {
panic(err)
}
return fpv
}
type Project_FieldTerminalPathValue struct {
Project_FieldTerminalPath
value interface{}
}
var _ Project_FieldPathValue = (*Project_FieldTerminalPathValue)(nil)
// GetRawValue returns raw value stored under selected path for 'Project' as interface{}
func (fpv *Project_FieldTerminalPathValue) GetRawValue() interface{} {
return fpv.value
}
func (fpv *Project_FieldTerminalPathValue) AsNameValue() (*Name, bool) {
res, ok := fpv.value.(*Name)
return res, ok
}
func (fpv *Project_FieldTerminalPathValue) AsMetadataValue() (*ntt_meta.Meta, bool) {
res, ok := fpv.value.(*ntt_meta.Meta)
return res, ok
}
// SetTo stores value for selected field for object Project
func (fpv *Project_FieldTerminalPathValue) SetTo(target **Project) {
if *target == nil {
*target = new(Project)
}
switch fpv.selector {
case Project_FieldPathSelectorName:
(*target).Name = fpv.value.(*Name)
case Project_FieldPathSelectorMetadata:
(*target).Metadata = fpv.value.(*ntt_meta.Meta)
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fpv.selector))
}
}
func (fpv *Project_FieldTerminalPathValue) SetToRaw(target proto.Message) {
typedObject := target.(*Project)
fpv.SetTo(&typedObject)
}
// CompareWith compares value in the 'Project_FieldTerminalPathValue' with the value under path in 'Project'.
func (fpv *Project_FieldTerminalPathValue) CompareWith(source *Project) (int, bool) {
switch fpv.selector {
case Project_FieldPathSelectorName:
leftValue := fpv.value.(*Name)
rightValue := source.GetName()
if leftValue == nil {
if rightValue != nil {
return -1, true
}
return 0, true
}
if rightValue == nil {
return 1, true
}
if leftValue.String() == rightValue.String() {
return 0, true
} else if leftValue.String() < rightValue.String() {
return -1, true
} else {
return 1, true
}
case Project_FieldPathSelectorMetadata:
return 0, false
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fpv.selector))
}
}
func (fpv *Project_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) {
return fpv.CompareWith(source.(*Project))
}
type Project_FieldSubPathValue struct {
Project_FieldPath
subPathValue gotenobject.FieldPathValue
}
var _ Project_FieldPathValue = (*Project_FieldSubPathValue)(nil)
func (fpvs *Project_FieldSubPathValue) AsMetadataPathValue() (ntt_meta.Meta_FieldPathValue, bool) {
res, ok := fpvs.subPathValue.(ntt_meta.Meta_FieldPathValue)
return res, ok
}
func (fpvs *Project_FieldSubPathValue) SetTo(target **Project) {
if *target == nil {
*target = new(Project)
}
switch fpvs.Selector() {
case Project_FieldPathSelectorMetadata:
fpvs.subPathValue.(ntt_meta.Meta_FieldPathValue).SetTo(&(*target).Metadata)
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fpvs.Selector()))
}
}
func (fpvs *Project_FieldSubPathValue) SetToRaw(target proto.Message) {
typedObject := target.(*Project)
fpvs.SetTo(&typedObject)
}
func (fpvs *Project_FieldSubPathValue) GetRawValue() interface{} {
return fpvs.subPathValue.GetRawValue()
}
func (fpvs *Project_FieldSubPathValue) CompareWith(source *Project) (int, bool) {
switch fpvs.Selector() {
case Project_FieldPathSelectorMetadata:
return fpvs.subPathValue.(ntt_meta.Meta_FieldPathValue).CompareWith(source.GetMetadata())
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fpvs.Selector()))
}
}
func (fpvs *Project_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) {
return fpvs.CompareWith(source.(*Project))
}
// Project_FieldPathArrayItemValue allows storing single item in Path-specific values for Project according to their type
// Present only for array (repeated) types.
type Project_FieldPathArrayItemValue interface {
gotenobject.FieldPathArrayItemValue
Project_FieldPath
ContainsValue(*Project) bool
}
// ParseProject_FieldPathArrayItemValue parses string and JSON-encoded value to its Value
func ParseProject_FieldPathArrayItemValue(pathStr, valueStr string) (Project_FieldPathArrayItemValue, error) {
fp, err := ParseProject_FieldPath(pathStr)
if err != nil {
return nil, err
}
fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "error parsing Project field path array item value from %s: %v", valueStr, err)
}
return fpaiv.(Project_FieldPathArrayItemValue), nil
}
func MustParseProject_FieldPathArrayItemValue(pathStr, valueStr string) Project_FieldPathArrayItemValue {
fpaiv, err := ParseProject_FieldPathArrayItemValue(pathStr, valueStr)
if err != nil {
panic(err)
}
return fpaiv
}
type Project_FieldTerminalPathArrayItemValue struct {
Project_FieldTerminalPath
value interface{}
}
var _ Project_FieldPathArrayItemValue = (*Project_FieldTerminalPathArrayItemValue)(nil)
// GetRawValue returns stored element value for array in object Project as interface{}
func (fpaiv *Project_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} {
return fpaiv.value
}
func (fpaiv *Project_FieldTerminalPathArrayItemValue) GetSingle(source *Project) (interface{}, bool) {
return nil, false
}
func (fpaiv *Project_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) {
return fpaiv.GetSingle(source.(*Project))
}
// Contains returns a boolean indicating if value that is being held is present in given 'Project'
func (fpaiv *Project_FieldTerminalPathArrayItemValue) ContainsValue(source *Project) bool {
slice := fpaiv.Project_FieldTerminalPath.Get(source)
for _, v := range slice {
if asProtoMsg, ok := fpaiv.value.(proto.Message); ok {
if proto.Equal(asProtoMsg, v.(proto.Message)) {
return true
}
} else if reflect.DeepEqual(v, fpaiv.value) {
return true
}
}
return false
}
type Project_FieldSubPathArrayItemValue struct {
Project_FieldPath
subPathItemValue gotenobject.FieldPathArrayItemValue
}
// GetRawValue returns stored array item value
func (fpaivs *Project_FieldSubPathArrayItemValue) GetRawItemValue() interface{} {
return fpaivs.subPathItemValue.GetRawItemValue()
}
func (fpaivs *Project_FieldSubPathArrayItemValue) AsMetadataPathItemValue() (ntt_meta.Meta_FieldPathArrayItemValue, bool) {
res, ok := fpaivs.subPathItemValue.(ntt_meta.Meta_FieldPathArrayItemValue)
return res, ok
}
// Contains returns a boolean indicating if value that is being held is present in given 'Project'
func (fpaivs *Project_FieldSubPathArrayItemValue) ContainsValue(source *Project) bool {
switch fpaivs.Selector() {
case Project_FieldPathSelectorMetadata:
return fpaivs.subPathItemValue.(ntt_meta.Meta_FieldPathArrayItemValue).ContainsValue(source.GetMetadata())
default:
panic(fmt.Sprintf("Invalid selector for Project: %d", fpaivs.Selector()))
}
}
// Project_FieldPathArrayOfValues allows storing slice of values for Project fields according to their type
type Project_FieldPathArrayOfValues interface {
gotenobject.FieldPathArrayOfValues
Project_FieldPath
}
func ParseProject_FieldPathArrayOfValues(pathStr, valuesStr string) (Project_FieldPathArrayOfValues, error) {
fp, err := ParseProject_FieldPath(pathStr)
if err != nil {
return nil, err
}
fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "error parsing Project field path array of values from %s: %v", valuesStr, err)
}
return fpaov.(Project_FieldPathArrayOfValues), nil
}
func MustParseProject_FieldPathArrayOfValues(pathStr, valuesStr string) Project_FieldPathArrayOfValues {
fpaov, err := ParseProject_FieldPathArrayOfValues(pathStr, valuesStr)
if err != nil {
panic(err)
}
return fpaov
}
type Project_FieldTerminalPathArrayOfValues struct {
Project_FieldTerminalPath
values interface{}
}
var _ Project_FieldPathArrayOfValues = (*Project_FieldTerminalPathArrayOfValues)(nil)
func (fpaov *Project_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) {
switch fpaov.selector {
case Project_FieldPathSelectorName:
for _, v := range fpaov.values.([]*Name) {
values = append(values, v)
}
case Project_FieldPathSelectorMetadata:
for _, v := range fpaov.values.([]*ntt_meta.Meta) {
values = append(values, v)
}
}
return
}
func (fpaov *Project_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]*Name, bool) {
res, ok := fpaov.values.([]*Name)
return res, ok
}
func (fpaov *Project_FieldTerminalPathArrayOfValues) AsMetadataArrayOfValues() ([]*ntt_meta.Meta, bool) {
res, ok := fpaov.values.([]*ntt_meta.Meta)
return res, ok
}
type Project_FieldSubPathArrayOfValues struct {
Project_FieldPath
subPathArrayOfValues gotenobject.FieldPathArrayOfValues
}
var _ Project_FieldPathArrayOfValues = (*Project_FieldSubPathArrayOfValues)(nil)
func (fpsaov *Project_FieldSubPathArrayOfValues) GetRawValues() []interface{} {
return fpsaov.subPathArrayOfValues.GetRawValues()
}
func (fpsaov *Project_FieldSubPathArrayOfValues) AsMetadataPathArrayOfValues() (ntt_meta.Meta_FieldPathArrayOfValues, bool) {
res, ok := fpsaov.subPathArrayOfValues.(ntt_meta.Meta_FieldPathArrayOfValues)
return res, ok
}