github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v3/phantom_time_serie/phantom_time_serie.pb.fieldpath.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/monitoring/proto/v3/phantom_time_serie.proto 3 // DO NOT EDIT!!! 4 5 package phantom_time_serie 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 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/common" 27 metric_descriptor "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/metric_descriptor" 28 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/project" 29 meta "github.com/cloudwan/goten-sdk/types/meta" 30 ) 31 32 // ensure the imports are used 33 var ( 34 _ = new(json.Marshaler) 35 _ = new(fmt.Stringer) 36 _ = reflect.DeepEqual 37 _ = strings.Builder{} 38 _ = time.Second 39 40 _ = strcase.ToLowerCamel 41 _ = codes.NotFound 42 _ = status.Status{} 43 _ = protojson.UnmarshalOptions{} 44 _ = new(proto.Message) 45 _ = protoregistry.GlobalTypes 46 47 _ = new(gotenobject.FieldPath) 48 ) 49 50 // make sure we're using proto imports 51 var ( 52 _ = &common.LabelDescriptor{} 53 _ = &metric_descriptor.MetricDescriptor{} 54 _ = &project.Project{} 55 _ = &meta.Meta{} 56 ) 57 58 // FieldPath provides implementation to handle 59 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 60 type PhantomTimeSerie_FieldPath interface { 61 gotenobject.FieldPath 62 Selector() PhantomTimeSerie_FieldPathSelector 63 Get(source *PhantomTimeSerie) []interface{} 64 GetSingle(source *PhantomTimeSerie) (interface{}, bool) 65 ClearValue(item *PhantomTimeSerie) 66 67 // Those methods build corresponding PhantomTimeSerie_FieldPathValue 68 // (or array of values) and holds passed value. Panics if injected type is incorrect. 69 WithIValue(value interface{}) PhantomTimeSerie_FieldPathValue 70 WithIArrayOfValues(values interface{}) PhantomTimeSerie_FieldPathArrayOfValues 71 WithIArrayItemValue(value interface{}) PhantomTimeSerie_FieldPathArrayItemValue 72 } 73 74 type PhantomTimeSerie_FieldPathSelector int32 75 76 const ( 77 PhantomTimeSerie_FieldPathSelectorMetadata PhantomTimeSerie_FieldPathSelector = 0 78 PhantomTimeSerie_FieldPathSelectorName PhantomTimeSerie_FieldPathSelector = 1 79 PhantomTimeSerie_FieldPathSelectorKey PhantomTimeSerie_FieldPathSelector = 2 80 PhantomTimeSerie_FieldPathSelectorProject PhantomTimeSerie_FieldPathSelector = 3 81 PhantomTimeSerie_FieldPathSelectorMetric PhantomTimeSerie_FieldPathSelector = 4 82 PhantomTimeSerie_FieldPathSelectorResource PhantomTimeSerie_FieldPathSelector = 5 83 PhantomTimeSerie_FieldPathSelectorMetricKind PhantomTimeSerie_FieldPathSelector = 6 84 PhantomTimeSerie_FieldPathSelectorValueType PhantomTimeSerie_FieldPathSelector = 7 85 PhantomTimeSerie_FieldPathSelectorValue PhantomTimeSerie_FieldPathSelector = 8 86 ) 87 88 func (s PhantomTimeSerie_FieldPathSelector) String() string { 89 switch s { 90 case PhantomTimeSerie_FieldPathSelectorMetadata: 91 return "metadata" 92 case PhantomTimeSerie_FieldPathSelectorName: 93 return "name" 94 case PhantomTimeSerie_FieldPathSelectorKey: 95 return "key" 96 case PhantomTimeSerie_FieldPathSelectorProject: 97 return "project" 98 case PhantomTimeSerie_FieldPathSelectorMetric: 99 return "metric" 100 case PhantomTimeSerie_FieldPathSelectorResource: 101 return "resource" 102 case PhantomTimeSerie_FieldPathSelectorMetricKind: 103 return "metric_kind" 104 case PhantomTimeSerie_FieldPathSelectorValueType: 105 return "value_type" 106 case PhantomTimeSerie_FieldPathSelectorValue: 107 return "value" 108 default: 109 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", s)) 110 } 111 } 112 113 func BuildPhantomTimeSerie_FieldPath(fp gotenobject.RawFieldPath) (PhantomTimeSerie_FieldPath, error) { 114 if len(fp) == 0 { 115 return nil, status.Error(codes.InvalidArgument, "empty field path for object PhantomTimeSerie") 116 } 117 if len(fp) == 1 { 118 switch fp[0] { 119 case "metadata": 120 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorMetadata}, nil 121 case "name": 122 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorName}, nil 123 case "key": 124 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorKey}, nil 125 case "project": 126 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorProject}, nil 127 case "metric": 128 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorMetric}, nil 129 case "resource": 130 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorResource}, nil 131 case "metric_kind", "metricKind", "metric-kind": 132 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorMetricKind}, nil 133 case "value_type", "valueType", "value-type": 134 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorValueType}, nil 135 case "value": 136 return &PhantomTimeSerie_FieldTerminalPath{selector: PhantomTimeSerie_FieldPathSelectorValue}, nil 137 } 138 } else { 139 switch fp[0] { 140 case "metadata": 141 if subpath, err := meta.BuildMeta_FieldPath(fp[1:]); err != nil { 142 return nil, err 143 } else { 144 return &PhantomTimeSerie_FieldSubPath{selector: PhantomTimeSerie_FieldPathSelectorMetadata, subPath: subpath}, nil 145 } 146 case "metric": 147 if subpath, err := common.BuildMetric_FieldPath(fp[1:]); err != nil { 148 return nil, err 149 } else { 150 return &PhantomTimeSerie_FieldSubPath{selector: PhantomTimeSerie_FieldPathSelectorMetric, subPath: subpath}, nil 151 } 152 case "resource": 153 if subpath, err := common.BuildMonitoredResource_FieldPath(fp[1:]); err != nil { 154 return nil, err 155 } else { 156 return &PhantomTimeSerie_FieldSubPath{selector: PhantomTimeSerie_FieldPathSelectorResource, subPath: subpath}, nil 157 } 158 case "value": 159 if subpath, err := common.BuildTypedValue_FieldPath(fp[1:]); err != nil { 160 return nil, err 161 } else { 162 return &PhantomTimeSerie_FieldSubPath{selector: PhantomTimeSerie_FieldPathSelectorValue, subPath: subpath}, nil 163 } 164 } 165 } 166 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object PhantomTimeSerie", fp) 167 } 168 169 func ParsePhantomTimeSerie_FieldPath(rawField string) (PhantomTimeSerie_FieldPath, error) { 170 fp, err := gotenobject.ParseRawFieldPath(rawField) 171 if err != nil { 172 return nil, err 173 } 174 return BuildPhantomTimeSerie_FieldPath(fp) 175 } 176 177 func MustParsePhantomTimeSerie_FieldPath(rawField string) PhantomTimeSerie_FieldPath { 178 fp, err := ParsePhantomTimeSerie_FieldPath(rawField) 179 if err != nil { 180 panic(err) 181 } 182 return fp 183 } 184 185 type PhantomTimeSerie_FieldTerminalPath struct { 186 selector PhantomTimeSerie_FieldPathSelector 187 } 188 189 var _ PhantomTimeSerie_FieldPath = (*PhantomTimeSerie_FieldTerminalPath)(nil) 190 191 func (fp *PhantomTimeSerie_FieldTerminalPath) Selector() PhantomTimeSerie_FieldPathSelector { 192 return fp.selector 193 } 194 195 // String returns path representation in proto convention 196 func (fp *PhantomTimeSerie_FieldTerminalPath) String() string { 197 return fp.selector.String() 198 } 199 200 // JSONString returns path representation is JSON convention 201 func (fp *PhantomTimeSerie_FieldTerminalPath) JSONString() string { 202 return strcase.ToLowerCamel(fp.String()) 203 } 204 205 // Get returns all values pointed by specific field from source PhantomTimeSerie 206 func (fp *PhantomTimeSerie_FieldTerminalPath) Get(source *PhantomTimeSerie) (values []interface{}) { 207 if source != nil { 208 switch fp.selector { 209 case PhantomTimeSerie_FieldPathSelectorMetadata: 210 if source.Metadata != nil { 211 values = append(values, source.Metadata) 212 } 213 case PhantomTimeSerie_FieldPathSelectorName: 214 if source.Name != nil { 215 values = append(values, source.Name) 216 } 217 case PhantomTimeSerie_FieldPathSelectorKey: 218 values = append(values, source.Key) 219 case PhantomTimeSerie_FieldPathSelectorProject: 220 values = append(values, source.Project) 221 case PhantomTimeSerie_FieldPathSelectorMetric: 222 if source.Metric != nil { 223 values = append(values, source.Metric) 224 } 225 case PhantomTimeSerie_FieldPathSelectorResource: 226 if source.Resource != nil { 227 values = append(values, source.Resource) 228 } 229 case PhantomTimeSerie_FieldPathSelectorMetricKind: 230 values = append(values, source.MetricKind) 231 case PhantomTimeSerie_FieldPathSelectorValueType: 232 values = append(values, source.ValueType) 233 case PhantomTimeSerie_FieldPathSelectorValue: 234 if source.Value != nil { 235 values = append(values, source.Value) 236 } 237 default: 238 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 239 } 240 } 241 return 242 } 243 244 func (fp *PhantomTimeSerie_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 245 return fp.Get(source.(*PhantomTimeSerie)) 246 } 247 248 // GetSingle returns value pointed by specific field of from source PhantomTimeSerie 249 func (fp *PhantomTimeSerie_FieldTerminalPath) GetSingle(source *PhantomTimeSerie) (interface{}, bool) { 250 switch fp.selector { 251 case PhantomTimeSerie_FieldPathSelectorMetadata: 252 res := source.GetMetadata() 253 return res, res != nil 254 case PhantomTimeSerie_FieldPathSelectorName: 255 res := source.GetName() 256 return res, res != nil 257 case PhantomTimeSerie_FieldPathSelectorKey: 258 res := source.GetKey() 259 return res, res != nil 260 case PhantomTimeSerie_FieldPathSelectorProject: 261 return source.GetProject(), source != nil 262 case PhantomTimeSerie_FieldPathSelectorMetric: 263 res := source.GetMetric() 264 return res, res != nil 265 case PhantomTimeSerie_FieldPathSelectorResource: 266 res := source.GetResource() 267 return res, res != nil 268 case PhantomTimeSerie_FieldPathSelectorMetricKind: 269 return source.GetMetricKind(), source != nil 270 case PhantomTimeSerie_FieldPathSelectorValueType: 271 return source.GetValueType(), source != nil 272 case PhantomTimeSerie_FieldPathSelectorValue: 273 res := source.GetValue() 274 return res, res != nil 275 default: 276 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 277 } 278 } 279 280 func (fp *PhantomTimeSerie_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 281 return fp.GetSingle(source.(*PhantomTimeSerie)) 282 } 283 284 // GetDefault returns a default value of the field type 285 func (fp *PhantomTimeSerie_FieldTerminalPath) GetDefault() interface{} { 286 switch fp.selector { 287 case PhantomTimeSerie_FieldPathSelectorMetadata: 288 return (*meta.Meta)(nil) 289 case PhantomTimeSerie_FieldPathSelectorName: 290 return (*Name)(nil) 291 case PhantomTimeSerie_FieldPathSelectorKey: 292 return ([]byte)(nil) 293 case PhantomTimeSerie_FieldPathSelectorProject: 294 return "" 295 case PhantomTimeSerie_FieldPathSelectorMetric: 296 return (*common.Metric)(nil) 297 case PhantomTimeSerie_FieldPathSelectorResource: 298 return (*common.MonitoredResource)(nil) 299 case PhantomTimeSerie_FieldPathSelectorMetricKind: 300 return metric_descriptor.MetricDescriptor_METRIC_KIND_UNSPECIFIED 301 case PhantomTimeSerie_FieldPathSelectorValueType: 302 return metric_descriptor.MetricDescriptor_VALUE_TYPE_UNSPECIFIED 303 case PhantomTimeSerie_FieldPathSelectorValue: 304 return (*common.TypedValue)(nil) 305 default: 306 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 307 } 308 } 309 310 func (fp *PhantomTimeSerie_FieldTerminalPath) ClearValue(item *PhantomTimeSerie) { 311 if item != nil { 312 switch fp.selector { 313 case PhantomTimeSerie_FieldPathSelectorMetadata: 314 item.Metadata = nil 315 case PhantomTimeSerie_FieldPathSelectorName: 316 item.Name = nil 317 case PhantomTimeSerie_FieldPathSelectorKey: 318 item.Key = nil 319 case PhantomTimeSerie_FieldPathSelectorProject: 320 item.Project = "" 321 case PhantomTimeSerie_FieldPathSelectorMetric: 322 item.Metric = nil 323 case PhantomTimeSerie_FieldPathSelectorResource: 324 item.Resource = nil 325 case PhantomTimeSerie_FieldPathSelectorMetricKind: 326 item.MetricKind = metric_descriptor.MetricDescriptor_METRIC_KIND_UNSPECIFIED 327 case PhantomTimeSerie_FieldPathSelectorValueType: 328 item.ValueType = metric_descriptor.MetricDescriptor_VALUE_TYPE_UNSPECIFIED 329 case PhantomTimeSerie_FieldPathSelectorValue: 330 item.Value = nil 331 default: 332 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 333 } 334 } 335 } 336 337 func (fp *PhantomTimeSerie_FieldTerminalPath) ClearValueRaw(item proto.Message) { 338 fp.ClearValue(item.(*PhantomTimeSerie)) 339 } 340 341 // IsLeaf - whether field path is holds simple value 342 func (fp *PhantomTimeSerie_FieldTerminalPath) IsLeaf() bool { 343 return fp.selector == PhantomTimeSerie_FieldPathSelectorName || 344 fp.selector == PhantomTimeSerie_FieldPathSelectorKey || 345 fp.selector == PhantomTimeSerie_FieldPathSelectorProject || 346 fp.selector == PhantomTimeSerie_FieldPathSelectorMetricKind || 347 fp.selector == PhantomTimeSerie_FieldPathSelectorValueType 348 } 349 350 func (fp *PhantomTimeSerie_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 351 return []gotenobject.FieldPath{fp} 352 } 353 354 func (fp *PhantomTimeSerie_FieldTerminalPath) WithIValue(value interface{}) PhantomTimeSerie_FieldPathValue { 355 switch fp.selector { 356 case PhantomTimeSerie_FieldPathSelectorMetadata: 357 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(*meta.Meta)} 358 case PhantomTimeSerie_FieldPathSelectorName: 359 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(*Name)} 360 case PhantomTimeSerie_FieldPathSelectorKey: 361 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.([]byte)} 362 case PhantomTimeSerie_FieldPathSelectorProject: 363 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(string)} 364 case PhantomTimeSerie_FieldPathSelectorMetric: 365 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(*common.Metric)} 366 case PhantomTimeSerie_FieldPathSelectorResource: 367 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(*common.MonitoredResource)} 368 case PhantomTimeSerie_FieldPathSelectorMetricKind: 369 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(metric_descriptor.MetricDescriptor_MetricKind)} 370 case PhantomTimeSerie_FieldPathSelectorValueType: 371 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(metric_descriptor.MetricDescriptor_ValueType)} 372 case PhantomTimeSerie_FieldPathSelectorValue: 373 return &PhantomTimeSerie_FieldTerminalPathValue{PhantomTimeSerie_FieldTerminalPath: *fp, value: value.(*common.TypedValue)} 374 default: 375 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 376 } 377 } 378 379 func (fp *PhantomTimeSerie_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 380 return fp.WithIValue(value) 381 } 382 383 func (fp *PhantomTimeSerie_FieldTerminalPath) WithIArrayOfValues(values interface{}) PhantomTimeSerie_FieldPathArrayOfValues { 384 fpaov := &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp} 385 switch fp.selector { 386 case PhantomTimeSerie_FieldPathSelectorMetadata: 387 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]*meta.Meta)} 388 case PhantomTimeSerie_FieldPathSelectorName: 389 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]*Name)} 390 case PhantomTimeSerie_FieldPathSelectorKey: 391 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([][]byte)} 392 case PhantomTimeSerie_FieldPathSelectorProject: 393 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]string)} 394 case PhantomTimeSerie_FieldPathSelectorMetric: 395 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]*common.Metric)} 396 case PhantomTimeSerie_FieldPathSelectorResource: 397 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]*common.MonitoredResource)} 398 case PhantomTimeSerie_FieldPathSelectorMetricKind: 399 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]metric_descriptor.MetricDescriptor_MetricKind)} 400 case PhantomTimeSerie_FieldPathSelectorValueType: 401 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]metric_descriptor.MetricDescriptor_ValueType)} 402 case PhantomTimeSerie_FieldPathSelectorValue: 403 return &PhantomTimeSerie_FieldTerminalPathArrayOfValues{PhantomTimeSerie_FieldTerminalPath: *fp, values: values.([]*common.TypedValue)} 404 default: 405 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 406 } 407 return fpaov 408 } 409 410 func (fp *PhantomTimeSerie_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 411 return fp.WithIArrayOfValues(values) 412 } 413 414 func (fp *PhantomTimeSerie_FieldTerminalPath) WithIArrayItemValue(value interface{}) PhantomTimeSerie_FieldPathArrayItemValue { 415 switch fp.selector { 416 default: 417 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fp.selector)) 418 } 419 } 420 421 func (fp *PhantomTimeSerie_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 422 return fp.WithIArrayItemValue(value) 423 } 424 425 type PhantomTimeSerie_FieldSubPath struct { 426 selector PhantomTimeSerie_FieldPathSelector 427 subPath gotenobject.FieldPath 428 } 429 430 var _ PhantomTimeSerie_FieldPath = (*PhantomTimeSerie_FieldSubPath)(nil) 431 432 func (fps *PhantomTimeSerie_FieldSubPath) Selector() PhantomTimeSerie_FieldPathSelector { 433 return fps.selector 434 } 435 func (fps *PhantomTimeSerie_FieldSubPath) AsMetadataSubPath() (meta.Meta_FieldPath, bool) { 436 res, ok := fps.subPath.(meta.Meta_FieldPath) 437 return res, ok 438 } 439 func (fps *PhantomTimeSerie_FieldSubPath) AsMetricSubPath() (common.Metric_FieldPath, bool) { 440 res, ok := fps.subPath.(common.Metric_FieldPath) 441 return res, ok 442 } 443 func (fps *PhantomTimeSerie_FieldSubPath) AsResourceSubPath() (common.MonitoredResource_FieldPath, bool) { 444 res, ok := fps.subPath.(common.MonitoredResource_FieldPath) 445 return res, ok 446 } 447 func (fps *PhantomTimeSerie_FieldSubPath) AsValueSubPath() (common.TypedValue_FieldPath, bool) { 448 res, ok := fps.subPath.(common.TypedValue_FieldPath) 449 return res, ok 450 } 451 452 // String returns path representation in proto convention 453 func (fps *PhantomTimeSerie_FieldSubPath) String() string { 454 return fps.selector.String() + "." + fps.subPath.String() 455 } 456 457 // JSONString returns path representation is JSON convention 458 func (fps *PhantomTimeSerie_FieldSubPath) JSONString() string { 459 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 460 } 461 462 // Get returns all values pointed by selected field from source PhantomTimeSerie 463 func (fps *PhantomTimeSerie_FieldSubPath) Get(source *PhantomTimeSerie) (values []interface{}) { 464 switch fps.selector { 465 case PhantomTimeSerie_FieldPathSelectorMetadata: 466 values = append(values, fps.subPath.GetRaw(source.GetMetadata())...) 467 case PhantomTimeSerie_FieldPathSelectorMetric: 468 values = append(values, fps.subPath.GetRaw(source.GetMetric())...) 469 case PhantomTimeSerie_FieldPathSelectorResource: 470 values = append(values, fps.subPath.GetRaw(source.GetResource())...) 471 case PhantomTimeSerie_FieldPathSelectorValue: 472 values = append(values, fps.subPath.GetRaw(source.GetValue())...) 473 default: 474 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fps.selector)) 475 } 476 return 477 } 478 479 func (fps *PhantomTimeSerie_FieldSubPath) GetRaw(source proto.Message) []interface{} { 480 return fps.Get(source.(*PhantomTimeSerie)) 481 } 482 483 // GetSingle returns value of selected field from source PhantomTimeSerie 484 func (fps *PhantomTimeSerie_FieldSubPath) GetSingle(source *PhantomTimeSerie) (interface{}, bool) { 485 switch fps.selector { 486 case PhantomTimeSerie_FieldPathSelectorMetadata: 487 if source.GetMetadata() == nil { 488 return nil, false 489 } 490 return fps.subPath.GetSingleRaw(source.GetMetadata()) 491 case PhantomTimeSerie_FieldPathSelectorMetric: 492 if source.GetMetric() == nil { 493 return nil, false 494 } 495 return fps.subPath.GetSingleRaw(source.GetMetric()) 496 case PhantomTimeSerie_FieldPathSelectorResource: 497 if source.GetResource() == nil { 498 return nil, false 499 } 500 return fps.subPath.GetSingleRaw(source.GetResource()) 501 case PhantomTimeSerie_FieldPathSelectorValue: 502 if source.GetValue() == nil { 503 return nil, false 504 } 505 return fps.subPath.GetSingleRaw(source.GetValue()) 506 default: 507 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fps.selector)) 508 } 509 } 510 511 func (fps *PhantomTimeSerie_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 512 return fps.GetSingle(source.(*PhantomTimeSerie)) 513 } 514 515 // GetDefault returns a default value of the field type 516 func (fps *PhantomTimeSerie_FieldSubPath) GetDefault() interface{} { 517 return fps.subPath.GetDefault() 518 } 519 520 func (fps *PhantomTimeSerie_FieldSubPath) ClearValue(item *PhantomTimeSerie) { 521 if item != nil { 522 switch fps.selector { 523 case PhantomTimeSerie_FieldPathSelectorMetadata: 524 fps.subPath.ClearValueRaw(item.Metadata) 525 case PhantomTimeSerie_FieldPathSelectorMetric: 526 fps.subPath.ClearValueRaw(item.Metric) 527 case PhantomTimeSerie_FieldPathSelectorResource: 528 fps.subPath.ClearValueRaw(item.Resource) 529 case PhantomTimeSerie_FieldPathSelectorValue: 530 fps.subPath.ClearValueRaw(item.Value) 531 default: 532 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fps.selector)) 533 } 534 } 535 } 536 537 func (fps *PhantomTimeSerie_FieldSubPath) ClearValueRaw(item proto.Message) { 538 fps.ClearValue(item.(*PhantomTimeSerie)) 539 } 540 541 // IsLeaf - whether field path is holds simple value 542 func (fps *PhantomTimeSerie_FieldSubPath) IsLeaf() bool { 543 return fps.subPath.IsLeaf() 544 } 545 546 func (fps *PhantomTimeSerie_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 547 iPaths := []gotenobject.FieldPath{&PhantomTimeSerie_FieldTerminalPath{selector: fps.selector}} 548 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 549 return iPaths 550 } 551 552 func (fps *PhantomTimeSerie_FieldSubPath) WithIValue(value interface{}) PhantomTimeSerie_FieldPathValue { 553 return &PhantomTimeSerie_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 554 } 555 556 func (fps *PhantomTimeSerie_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 557 return fps.WithIValue(value) 558 } 559 560 func (fps *PhantomTimeSerie_FieldSubPath) WithIArrayOfValues(values interface{}) PhantomTimeSerie_FieldPathArrayOfValues { 561 return &PhantomTimeSerie_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 562 } 563 564 func (fps *PhantomTimeSerie_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 565 return fps.WithIArrayOfValues(values) 566 } 567 568 func (fps *PhantomTimeSerie_FieldSubPath) WithIArrayItemValue(value interface{}) PhantomTimeSerie_FieldPathArrayItemValue { 569 return &PhantomTimeSerie_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 570 } 571 572 func (fps *PhantomTimeSerie_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 573 return fps.WithIArrayItemValue(value) 574 } 575 576 // PhantomTimeSerie_FieldPathValue allows storing values for PhantomTimeSerie fields according to their type 577 type PhantomTimeSerie_FieldPathValue interface { 578 PhantomTimeSerie_FieldPath 579 gotenobject.FieldPathValue 580 SetTo(target **PhantomTimeSerie) 581 CompareWith(*PhantomTimeSerie) (cmp int, comparable bool) 582 } 583 584 func ParsePhantomTimeSerie_FieldPathValue(pathStr, valueStr string) (PhantomTimeSerie_FieldPathValue, error) { 585 fp, err := ParsePhantomTimeSerie_FieldPath(pathStr) 586 if err != nil { 587 return nil, err 588 } 589 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 590 if err != nil { 591 return nil, status.Errorf(codes.InvalidArgument, "error parsing PhantomTimeSerie field path value from %s: %v", valueStr, err) 592 } 593 return fpv.(PhantomTimeSerie_FieldPathValue), nil 594 } 595 596 func MustParsePhantomTimeSerie_FieldPathValue(pathStr, valueStr string) PhantomTimeSerie_FieldPathValue { 597 fpv, err := ParsePhantomTimeSerie_FieldPathValue(pathStr, valueStr) 598 if err != nil { 599 panic(err) 600 } 601 return fpv 602 } 603 604 type PhantomTimeSerie_FieldTerminalPathValue struct { 605 PhantomTimeSerie_FieldTerminalPath 606 value interface{} 607 } 608 609 var _ PhantomTimeSerie_FieldPathValue = (*PhantomTimeSerie_FieldTerminalPathValue)(nil) 610 611 // GetRawValue returns raw value stored under selected path for 'PhantomTimeSerie' as interface{} 612 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) GetRawValue() interface{} { 613 return fpv.value 614 } 615 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsMetadataValue() (*meta.Meta, bool) { 616 res, ok := fpv.value.(*meta.Meta) 617 return res, ok 618 } 619 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsNameValue() (*Name, bool) { 620 res, ok := fpv.value.(*Name) 621 return res, ok 622 } 623 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsKeyValue() ([]byte, bool) { 624 res, ok := fpv.value.([]byte) 625 return res, ok 626 } 627 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsProjectValue() (string, bool) { 628 res, ok := fpv.value.(string) 629 return res, ok 630 } 631 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsMetricValue() (*common.Metric, bool) { 632 res, ok := fpv.value.(*common.Metric) 633 return res, ok 634 } 635 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsResourceValue() (*common.MonitoredResource, bool) { 636 res, ok := fpv.value.(*common.MonitoredResource) 637 return res, ok 638 } 639 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsMetricKindValue() (metric_descriptor.MetricDescriptor_MetricKind, bool) { 640 res, ok := fpv.value.(metric_descriptor.MetricDescriptor_MetricKind) 641 return res, ok 642 } 643 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsValueTypeValue() (metric_descriptor.MetricDescriptor_ValueType, bool) { 644 res, ok := fpv.value.(metric_descriptor.MetricDescriptor_ValueType) 645 return res, ok 646 } 647 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) AsValueValue() (*common.TypedValue, bool) { 648 res, ok := fpv.value.(*common.TypedValue) 649 return res, ok 650 } 651 652 // SetTo stores value for selected field for object PhantomTimeSerie 653 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) SetTo(target **PhantomTimeSerie) { 654 if *target == nil { 655 *target = new(PhantomTimeSerie) 656 } 657 switch fpv.selector { 658 case PhantomTimeSerie_FieldPathSelectorMetadata: 659 (*target).Metadata = fpv.value.(*meta.Meta) 660 case PhantomTimeSerie_FieldPathSelectorName: 661 (*target).Name = fpv.value.(*Name) 662 case PhantomTimeSerie_FieldPathSelectorKey: 663 (*target).Key = fpv.value.([]byte) 664 case PhantomTimeSerie_FieldPathSelectorProject: 665 (*target).Project = fpv.value.(string) 666 case PhantomTimeSerie_FieldPathSelectorMetric: 667 (*target).Metric = fpv.value.(*common.Metric) 668 case PhantomTimeSerie_FieldPathSelectorResource: 669 (*target).Resource = fpv.value.(*common.MonitoredResource) 670 case PhantomTimeSerie_FieldPathSelectorMetricKind: 671 (*target).MetricKind = fpv.value.(metric_descriptor.MetricDescriptor_MetricKind) 672 case PhantomTimeSerie_FieldPathSelectorValueType: 673 (*target).ValueType = fpv.value.(metric_descriptor.MetricDescriptor_ValueType) 674 case PhantomTimeSerie_FieldPathSelectorValue: 675 (*target).Value = fpv.value.(*common.TypedValue) 676 default: 677 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fpv.selector)) 678 } 679 } 680 681 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) SetToRaw(target proto.Message) { 682 typedObject := target.(*PhantomTimeSerie) 683 fpv.SetTo(&typedObject) 684 } 685 686 // CompareWith compares value in the 'PhantomTimeSerie_FieldTerminalPathValue' with the value under path in 'PhantomTimeSerie'. 687 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) CompareWith(source *PhantomTimeSerie) (int, bool) { 688 switch fpv.selector { 689 case PhantomTimeSerie_FieldPathSelectorMetadata: 690 return 0, false 691 case PhantomTimeSerie_FieldPathSelectorName: 692 leftValue := fpv.value.(*Name) 693 rightValue := source.GetName() 694 if leftValue == nil { 695 if rightValue != nil { 696 return -1, true 697 } 698 return 0, true 699 } 700 if rightValue == nil { 701 return 1, true 702 } 703 if leftValue.String() == rightValue.String() { 704 return 0, true 705 } else if leftValue.String() < rightValue.String() { 706 return -1, true 707 } else { 708 return 1, true 709 } 710 case PhantomTimeSerie_FieldPathSelectorKey: 711 return 0, false 712 case PhantomTimeSerie_FieldPathSelectorProject: 713 leftValue := fpv.value.(string) 714 rightValue := source.GetProject() 715 if (leftValue) == (rightValue) { 716 return 0, true 717 } else if (leftValue) < (rightValue) { 718 return -1, true 719 } else { 720 return 1, true 721 } 722 case PhantomTimeSerie_FieldPathSelectorMetric: 723 return 0, false 724 case PhantomTimeSerie_FieldPathSelectorResource: 725 return 0, false 726 case PhantomTimeSerie_FieldPathSelectorMetricKind: 727 leftValue := fpv.value.(metric_descriptor.MetricDescriptor_MetricKind) 728 rightValue := source.GetMetricKind() 729 if (leftValue) == (rightValue) { 730 return 0, true 731 } else if (leftValue) < (rightValue) { 732 return -1, true 733 } else { 734 return 1, true 735 } 736 case PhantomTimeSerie_FieldPathSelectorValueType: 737 leftValue := fpv.value.(metric_descriptor.MetricDescriptor_ValueType) 738 rightValue := source.GetValueType() 739 if (leftValue) == (rightValue) { 740 return 0, true 741 } else if (leftValue) < (rightValue) { 742 return -1, true 743 } else { 744 return 1, true 745 } 746 case PhantomTimeSerie_FieldPathSelectorValue: 747 return 0, false 748 default: 749 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fpv.selector)) 750 } 751 } 752 753 func (fpv *PhantomTimeSerie_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 754 return fpv.CompareWith(source.(*PhantomTimeSerie)) 755 } 756 757 type PhantomTimeSerie_FieldSubPathValue struct { 758 PhantomTimeSerie_FieldPath 759 subPathValue gotenobject.FieldPathValue 760 } 761 762 var _ PhantomTimeSerie_FieldPathValue = (*PhantomTimeSerie_FieldSubPathValue)(nil) 763 764 func (fpvs *PhantomTimeSerie_FieldSubPathValue) AsMetadataPathValue() (meta.Meta_FieldPathValue, bool) { 765 res, ok := fpvs.subPathValue.(meta.Meta_FieldPathValue) 766 return res, ok 767 } 768 func (fpvs *PhantomTimeSerie_FieldSubPathValue) AsMetricPathValue() (common.Metric_FieldPathValue, bool) { 769 res, ok := fpvs.subPathValue.(common.Metric_FieldPathValue) 770 return res, ok 771 } 772 func (fpvs *PhantomTimeSerie_FieldSubPathValue) AsResourcePathValue() (common.MonitoredResource_FieldPathValue, bool) { 773 res, ok := fpvs.subPathValue.(common.MonitoredResource_FieldPathValue) 774 return res, ok 775 } 776 func (fpvs *PhantomTimeSerie_FieldSubPathValue) AsValuePathValue() (common.TypedValue_FieldPathValue, bool) { 777 res, ok := fpvs.subPathValue.(common.TypedValue_FieldPathValue) 778 return res, ok 779 } 780 781 func (fpvs *PhantomTimeSerie_FieldSubPathValue) SetTo(target **PhantomTimeSerie) { 782 if *target == nil { 783 *target = new(PhantomTimeSerie) 784 } 785 switch fpvs.Selector() { 786 case PhantomTimeSerie_FieldPathSelectorMetadata: 787 fpvs.subPathValue.(meta.Meta_FieldPathValue).SetTo(&(*target).Metadata) 788 case PhantomTimeSerie_FieldPathSelectorMetric: 789 fpvs.subPathValue.(common.Metric_FieldPathValue).SetTo(&(*target).Metric) 790 case PhantomTimeSerie_FieldPathSelectorResource: 791 fpvs.subPathValue.(common.MonitoredResource_FieldPathValue).SetTo(&(*target).Resource) 792 case PhantomTimeSerie_FieldPathSelectorValue: 793 fpvs.subPathValue.(common.TypedValue_FieldPathValue).SetTo(&(*target).Value) 794 default: 795 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fpvs.Selector())) 796 } 797 } 798 799 func (fpvs *PhantomTimeSerie_FieldSubPathValue) SetToRaw(target proto.Message) { 800 typedObject := target.(*PhantomTimeSerie) 801 fpvs.SetTo(&typedObject) 802 } 803 804 func (fpvs *PhantomTimeSerie_FieldSubPathValue) GetRawValue() interface{} { 805 return fpvs.subPathValue.GetRawValue() 806 } 807 808 func (fpvs *PhantomTimeSerie_FieldSubPathValue) CompareWith(source *PhantomTimeSerie) (int, bool) { 809 switch fpvs.Selector() { 810 case PhantomTimeSerie_FieldPathSelectorMetadata: 811 return fpvs.subPathValue.(meta.Meta_FieldPathValue).CompareWith(source.GetMetadata()) 812 case PhantomTimeSerie_FieldPathSelectorMetric: 813 return fpvs.subPathValue.(common.Metric_FieldPathValue).CompareWith(source.GetMetric()) 814 case PhantomTimeSerie_FieldPathSelectorResource: 815 return fpvs.subPathValue.(common.MonitoredResource_FieldPathValue).CompareWith(source.GetResource()) 816 case PhantomTimeSerie_FieldPathSelectorValue: 817 return fpvs.subPathValue.(common.TypedValue_FieldPathValue).CompareWith(source.GetValue()) 818 default: 819 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fpvs.Selector())) 820 } 821 } 822 823 func (fpvs *PhantomTimeSerie_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 824 return fpvs.CompareWith(source.(*PhantomTimeSerie)) 825 } 826 827 // PhantomTimeSerie_FieldPathArrayItemValue allows storing single item in Path-specific values for PhantomTimeSerie according to their type 828 // Present only for array (repeated) types. 829 type PhantomTimeSerie_FieldPathArrayItemValue interface { 830 gotenobject.FieldPathArrayItemValue 831 PhantomTimeSerie_FieldPath 832 ContainsValue(*PhantomTimeSerie) bool 833 } 834 835 // ParsePhantomTimeSerie_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 836 func ParsePhantomTimeSerie_FieldPathArrayItemValue(pathStr, valueStr string) (PhantomTimeSerie_FieldPathArrayItemValue, error) { 837 fp, err := ParsePhantomTimeSerie_FieldPath(pathStr) 838 if err != nil { 839 return nil, err 840 } 841 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 842 if err != nil { 843 return nil, status.Errorf(codes.InvalidArgument, "error parsing PhantomTimeSerie field path array item value from %s: %v", valueStr, err) 844 } 845 return fpaiv.(PhantomTimeSerie_FieldPathArrayItemValue), nil 846 } 847 848 func MustParsePhantomTimeSerie_FieldPathArrayItemValue(pathStr, valueStr string) PhantomTimeSerie_FieldPathArrayItemValue { 849 fpaiv, err := ParsePhantomTimeSerie_FieldPathArrayItemValue(pathStr, valueStr) 850 if err != nil { 851 panic(err) 852 } 853 return fpaiv 854 } 855 856 type PhantomTimeSerie_FieldTerminalPathArrayItemValue struct { 857 PhantomTimeSerie_FieldTerminalPath 858 value interface{} 859 } 860 861 var _ PhantomTimeSerie_FieldPathArrayItemValue = (*PhantomTimeSerie_FieldTerminalPathArrayItemValue)(nil) 862 863 // GetRawValue returns stored element value for array in object PhantomTimeSerie as interface{} 864 func (fpaiv *PhantomTimeSerie_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 865 return fpaiv.value 866 } 867 868 func (fpaiv *PhantomTimeSerie_FieldTerminalPathArrayItemValue) GetSingle(source *PhantomTimeSerie) (interface{}, bool) { 869 return nil, false 870 } 871 872 func (fpaiv *PhantomTimeSerie_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 873 return fpaiv.GetSingle(source.(*PhantomTimeSerie)) 874 } 875 876 // Contains returns a boolean indicating if value that is being held is present in given 'PhantomTimeSerie' 877 func (fpaiv *PhantomTimeSerie_FieldTerminalPathArrayItemValue) ContainsValue(source *PhantomTimeSerie) bool { 878 slice := fpaiv.PhantomTimeSerie_FieldTerminalPath.Get(source) 879 for _, v := range slice { 880 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 881 if proto.Equal(asProtoMsg, v.(proto.Message)) { 882 return true 883 } 884 } else if reflect.DeepEqual(v, fpaiv.value) { 885 return true 886 } 887 } 888 return false 889 } 890 891 type PhantomTimeSerie_FieldSubPathArrayItemValue struct { 892 PhantomTimeSerie_FieldPath 893 subPathItemValue gotenobject.FieldPathArrayItemValue 894 } 895 896 // GetRawValue returns stored array item value 897 func (fpaivs *PhantomTimeSerie_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 898 return fpaivs.subPathItemValue.GetRawItemValue() 899 } 900 func (fpaivs *PhantomTimeSerie_FieldSubPathArrayItemValue) AsMetadataPathItemValue() (meta.Meta_FieldPathArrayItemValue, bool) { 901 res, ok := fpaivs.subPathItemValue.(meta.Meta_FieldPathArrayItemValue) 902 return res, ok 903 } 904 func (fpaivs *PhantomTimeSerie_FieldSubPathArrayItemValue) AsMetricPathItemValue() (common.Metric_FieldPathArrayItemValue, bool) { 905 res, ok := fpaivs.subPathItemValue.(common.Metric_FieldPathArrayItemValue) 906 return res, ok 907 } 908 func (fpaivs *PhantomTimeSerie_FieldSubPathArrayItemValue) AsResourcePathItemValue() (common.MonitoredResource_FieldPathArrayItemValue, bool) { 909 res, ok := fpaivs.subPathItemValue.(common.MonitoredResource_FieldPathArrayItemValue) 910 return res, ok 911 } 912 func (fpaivs *PhantomTimeSerie_FieldSubPathArrayItemValue) AsValuePathItemValue() (common.TypedValue_FieldPathArrayItemValue, bool) { 913 res, ok := fpaivs.subPathItemValue.(common.TypedValue_FieldPathArrayItemValue) 914 return res, ok 915 } 916 917 // Contains returns a boolean indicating if value that is being held is present in given 'PhantomTimeSerie' 918 func (fpaivs *PhantomTimeSerie_FieldSubPathArrayItemValue) ContainsValue(source *PhantomTimeSerie) bool { 919 switch fpaivs.Selector() { 920 case PhantomTimeSerie_FieldPathSelectorMetadata: 921 return fpaivs.subPathItemValue.(meta.Meta_FieldPathArrayItemValue).ContainsValue(source.GetMetadata()) 922 case PhantomTimeSerie_FieldPathSelectorMetric: 923 return fpaivs.subPathItemValue.(common.Metric_FieldPathArrayItemValue).ContainsValue(source.GetMetric()) 924 case PhantomTimeSerie_FieldPathSelectorResource: 925 return fpaivs.subPathItemValue.(common.MonitoredResource_FieldPathArrayItemValue).ContainsValue(source.GetResource()) 926 case PhantomTimeSerie_FieldPathSelectorValue: 927 return fpaivs.subPathItemValue.(common.TypedValue_FieldPathArrayItemValue).ContainsValue(source.GetValue()) 928 default: 929 panic(fmt.Sprintf("Invalid selector for PhantomTimeSerie: %d", fpaivs.Selector())) 930 } 931 } 932 933 // PhantomTimeSerie_FieldPathArrayOfValues allows storing slice of values for PhantomTimeSerie fields according to their type 934 type PhantomTimeSerie_FieldPathArrayOfValues interface { 935 gotenobject.FieldPathArrayOfValues 936 PhantomTimeSerie_FieldPath 937 } 938 939 func ParsePhantomTimeSerie_FieldPathArrayOfValues(pathStr, valuesStr string) (PhantomTimeSerie_FieldPathArrayOfValues, error) { 940 fp, err := ParsePhantomTimeSerie_FieldPath(pathStr) 941 if err != nil { 942 return nil, err 943 } 944 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 945 if err != nil { 946 return nil, status.Errorf(codes.InvalidArgument, "error parsing PhantomTimeSerie field path array of values from %s: %v", valuesStr, err) 947 } 948 return fpaov.(PhantomTimeSerie_FieldPathArrayOfValues), nil 949 } 950 951 func MustParsePhantomTimeSerie_FieldPathArrayOfValues(pathStr, valuesStr string) PhantomTimeSerie_FieldPathArrayOfValues { 952 fpaov, err := ParsePhantomTimeSerie_FieldPathArrayOfValues(pathStr, valuesStr) 953 if err != nil { 954 panic(err) 955 } 956 return fpaov 957 } 958 959 type PhantomTimeSerie_FieldTerminalPathArrayOfValues struct { 960 PhantomTimeSerie_FieldTerminalPath 961 values interface{} 962 } 963 964 var _ PhantomTimeSerie_FieldPathArrayOfValues = (*PhantomTimeSerie_FieldTerminalPathArrayOfValues)(nil) 965 966 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 967 switch fpaov.selector { 968 case PhantomTimeSerie_FieldPathSelectorMetadata: 969 for _, v := range fpaov.values.([]*meta.Meta) { 970 values = append(values, v) 971 } 972 case PhantomTimeSerie_FieldPathSelectorName: 973 for _, v := range fpaov.values.([]*Name) { 974 values = append(values, v) 975 } 976 case PhantomTimeSerie_FieldPathSelectorKey: 977 for _, v := range fpaov.values.([][]byte) { 978 values = append(values, v) 979 } 980 case PhantomTimeSerie_FieldPathSelectorProject: 981 for _, v := range fpaov.values.([]string) { 982 values = append(values, v) 983 } 984 case PhantomTimeSerie_FieldPathSelectorMetric: 985 for _, v := range fpaov.values.([]*common.Metric) { 986 values = append(values, v) 987 } 988 case PhantomTimeSerie_FieldPathSelectorResource: 989 for _, v := range fpaov.values.([]*common.MonitoredResource) { 990 values = append(values, v) 991 } 992 case PhantomTimeSerie_FieldPathSelectorMetricKind: 993 for _, v := range fpaov.values.([]metric_descriptor.MetricDescriptor_MetricKind) { 994 values = append(values, v) 995 } 996 case PhantomTimeSerie_FieldPathSelectorValueType: 997 for _, v := range fpaov.values.([]metric_descriptor.MetricDescriptor_ValueType) { 998 values = append(values, v) 999 } 1000 case PhantomTimeSerie_FieldPathSelectorValue: 1001 for _, v := range fpaov.values.([]*common.TypedValue) { 1002 values = append(values, v) 1003 } 1004 } 1005 return 1006 } 1007 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsMetadataArrayOfValues() ([]*meta.Meta, bool) { 1008 res, ok := fpaov.values.([]*meta.Meta) 1009 return res, ok 1010 } 1011 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]*Name, bool) { 1012 res, ok := fpaov.values.([]*Name) 1013 return res, ok 1014 } 1015 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsKeyArrayOfValues() ([][]byte, bool) { 1016 res, ok := fpaov.values.([][]byte) 1017 return res, ok 1018 } 1019 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsProjectArrayOfValues() ([]string, bool) { 1020 res, ok := fpaov.values.([]string) 1021 return res, ok 1022 } 1023 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsMetricArrayOfValues() ([]*common.Metric, bool) { 1024 res, ok := fpaov.values.([]*common.Metric) 1025 return res, ok 1026 } 1027 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsResourceArrayOfValues() ([]*common.MonitoredResource, bool) { 1028 res, ok := fpaov.values.([]*common.MonitoredResource) 1029 return res, ok 1030 } 1031 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsMetricKindArrayOfValues() ([]metric_descriptor.MetricDescriptor_MetricKind, bool) { 1032 res, ok := fpaov.values.([]metric_descriptor.MetricDescriptor_MetricKind) 1033 return res, ok 1034 } 1035 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsValueTypeArrayOfValues() ([]metric_descriptor.MetricDescriptor_ValueType, bool) { 1036 res, ok := fpaov.values.([]metric_descriptor.MetricDescriptor_ValueType) 1037 return res, ok 1038 } 1039 func (fpaov *PhantomTimeSerie_FieldTerminalPathArrayOfValues) AsValueArrayOfValues() ([]*common.TypedValue, bool) { 1040 res, ok := fpaov.values.([]*common.TypedValue) 1041 return res, ok 1042 } 1043 1044 type PhantomTimeSerie_FieldSubPathArrayOfValues struct { 1045 PhantomTimeSerie_FieldPath 1046 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 1047 } 1048 1049 var _ PhantomTimeSerie_FieldPathArrayOfValues = (*PhantomTimeSerie_FieldSubPathArrayOfValues)(nil) 1050 1051 func (fpsaov *PhantomTimeSerie_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 1052 return fpsaov.subPathArrayOfValues.GetRawValues() 1053 } 1054 func (fpsaov *PhantomTimeSerie_FieldSubPathArrayOfValues) AsMetadataPathArrayOfValues() (meta.Meta_FieldPathArrayOfValues, bool) { 1055 res, ok := fpsaov.subPathArrayOfValues.(meta.Meta_FieldPathArrayOfValues) 1056 return res, ok 1057 } 1058 func (fpsaov *PhantomTimeSerie_FieldSubPathArrayOfValues) AsMetricPathArrayOfValues() (common.Metric_FieldPathArrayOfValues, bool) { 1059 res, ok := fpsaov.subPathArrayOfValues.(common.Metric_FieldPathArrayOfValues) 1060 return res, ok 1061 } 1062 func (fpsaov *PhantomTimeSerie_FieldSubPathArrayOfValues) AsResourcePathArrayOfValues() (common.MonitoredResource_FieldPathArrayOfValues, bool) { 1063 res, ok := fpsaov.subPathArrayOfValues.(common.MonitoredResource_FieldPathArrayOfValues) 1064 return res, ok 1065 } 1066 func (fpsaov *PhantomTimeSerie_FieldSubPathArrayOfValues) AsValuePathArrayOfValues() (common.TypedValue_FieldPathArrayOfValues, bool) { 1067 res, ok := fpsaov.subPathArrayOfValues.(common.TypedValue_FieldPathArrayOfValues) 1068 return res, ok 1069 }