github.com/cloudwan/edgelq-sdk@v1.15.4/audit/resources/v1alpha2/activity_log/activity_log.pb.fieldpath.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/audit/proto/v1alpha2/activity_log.proto 3 // DO NOT EDIT!!! 4 5 package activity_log 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/audit/resources/v1alpha2/common" 27 rpc "github.com/cloudwan/edgelq-sdk/common/rpc" 28 iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/organization" 29 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project" 30 anypb "google.golang.org/protobuf/types/known/anypb" 31 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 32 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 33 ) 34 35 // ensure the imports are used 36 var ( 37 _ = new(json.Marshaler) 38 _ = new(fmt.Stringer) 39 _ = reflect.DeepEqual 40 _ = strings.Builder{} 41 _ = time.Second 42 43 _ = strcase.ToLowerCamel 44 _ = codes.NotFound 45 _ = status.Status{} 46 _ = protojson.UnmarshalOptions{} 47 _ = new(proto.Message) 48 _ = protoregistry.GlobalTypes 49 50 _ = new(gotenobject.FieldPath) 51 ) 52 53 // make sure we're using proto imports 54 var ( 55 _ = &common.Authentication{} 56 _ = &rpc.Status{} 57 _ = &iam_organization.Organization{} 58 _ = &iam_project.Project{} 59 _ = &anypb.Any{} 60 _ = &fieldmaskpb.FieldMask{} 61 _ = ×tamppb.Timestamp{} 62 ) 63 64 // FieldPath provides implementation to handle 65 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 66 type ActivityLog_FieldPath interface { 67 gotenobject.FieldPath 68 Selector() ActivityLog_FieldPathSelector 69 Get(source *ActivityLog) []interface{} 70 GetSingle(source *ActivityLog) (interface{}, bool) 71 ClearValue(item *ActivityLog) 72 73 // Those methods build corresponding ActivityLog_FieldPathValue 74 // (or array of values) and holds passed value. Panics if injected type is incorrect. 75 WithIValue(value interface{}) ActivityLog_FieldPathValue 76 WithIArrayOfValues(values interface{}) ActivityLog_FieldPathArrayOfValues 77 WithIArrayItemValue(value interface{}) ActivityLog_FieldPathArrayItemValue 78 } 79 80 type ActivityLog_FieldPathSelector int32 81 82 const ( 83 ActivityLog_FieldPathSelectorName ActivityLog_FieldPathSelector = 0 84 ActivityLog_FieldPathSelectorScope ActivityLog_FieldPathSelector = 1 85 ActivityLog_FieldPathSelectorRequestId ActivityLog_FieldPathSelector = 2 86 ActivityLog_FieldPathSelectorAuthentication ActivityLog_FieldPathSelector = 3 87 ActivityLog_FieldPathSelectorAuthorization ActivityLog_FieldPathSelector = 4 88 ActivityLog_FieldPathSelectorService ActivityLog_FieldPathSelector = 5 89 ActivityLog_FieldPathSelectorMethod ActivityLog_FieldPathSelector = 6 90 ActivityLog_FieldPathSelectorRequestMetadata ActivityLog_FieldPathSelector = 7 91 ActivityLog_FieldPathSelectorRequestRouting ActivityLog_FieldPathSelector = 8 92 ActivityLog_FieldPathSelectorResource ActivityLog_FieldPathSelector = 9 93 ActivityLog_FieldPathSelectorCategory ActivityLog_FieldPathSelector = 10 94 ActivityLog_FieldPathSelectorLabels ActivityLog_FieldPathSelector = 11 95 ActivityLog_FieldPathSelectorEvents ActivityLog_FieldPathSelector = 12 96 ) 97 98 func (s ActivityLog_FieldPathSelector) String() string { 99 switch s { 100 case ActivityLog_FieldPathSelectorName: 101 return "name" 102 case ActivityLog_FieldPathSelectorScope: 103 return "scope" 104 case ActivityLog_FieldPathSelectorRequestId: 105 return "request_id" 106 case ActivityLog_FieldPathSelectorAuthentication: 107 return "authentication" 108 case ActivityLog_FieldPathSelectorAuthorization: 109 return "authorization" 110 case ActivityLog_FieldPathSelectorService: 111 return "service" 112 case ActivityLog_FieldPathSelectorMethod: 113 return "method" 114 case ActivityLog_FieldPathSelectorRequestMetadata: 115 return "request_metadata" 116 case ActivityLog_FieldPathSelectorRequestRouting: 117 return "request_routing" 118 case ActivityLog_FieldPathSelectorResource: 119 return "resource" 120 case ActivityLog_FieldPathSelectorCategory: 121 return "category" 122 case ActivityLog_FieldPathSelectorLabels: 123 return "labels" 124 case ActivityLog_FieldPathSelectorEvents: 125 return "events" 126 default: 127 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", s)) 128 } 129 } 130 131 func BuildActivityLog_FieldPath(fp gotenobject.RawFieldPath) (ActivityLog_FieldPath, error) { 132 if len(fp) == 0 { 133 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog") 134 } 135 if len(fp) == 1 { 136 switch fp[0] { 137 case "name": 138 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorName}, nil 139 case "scope": 140 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorScope}, nil 141 case "request_id", "requestId", "request-id": 142 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorRequestId}, nil 143 case "authentication": 144 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorAuthentication}, nil 145 case "authorization": 146 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorAuthorization}, nil 147 case "service": 148 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorService}, nil 149 case "method": 150 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorMethod}, nil 151 case "request_metadata", "requestMetadata", "request-metadata": 152 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorRequestMetadata}, nil 153 case "request_routing", "requestRouting", "request-routing": 154 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorRequestRouting}, nil 155 case "resource": 156 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorResource}, nil 157 case "category": 158 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorCategory}, nil 159 case "labels": 160 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorLabels}, nil 161 case "events": 162 return &ActivityLog_FieldTerminalPath{selector: ActivityLog_FieldPathSelectorEvents}, nil 163 } 164 } else { 165 switch fp[0] { 166 case "authentication": 167 if subpath, err := common.BuildAuthentication_FieldPath(fp[1:]); err != nil { 168 return nil, err 169 } else { 170 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorAuthentication, subPath: subpath}, nil 171 } 172 case "authorization": 173 if subpath, err := common.BuildAuthorization_FieldPath(fp[1:]); err != nil { 174 return nil, err 175 } else { 176 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorAuthorization, subPath: subpath}, nil 177 } 178 case "service": 179 if subpath, err := common.BuildServiceData_FieldPath(fp[1:]); err != nil { 180 return nil, err 181 } else { 182 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorService, subPath: subpath}, nil 183 } 184 case "method": 185 if subpath, err := BuildActivityLogMethod_FieldPath(fp[1:]); err != nil { 186 return nil, err 187 } else { 188 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorMethod, subPath: subpath}, nil 189 } 190 case "request_metadata", "requestMetadata", "request-metadata": 191 if subpath, err := BuildActivityLogRequestMetadata_FieldPath(fp[1:]); err != nil { 192 return nil, err 193 } else { 194 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorRequestMetadata, subPath: subpath}, nil 195 } 196 case "request_routing", "requestRouting", "request-routing": 197 if subpath, err := BuildActivityLogRequestRouting_FieldPath(fp[1:]); err != nil { 198 return nil, err 199 } else { 200 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorRequestRouting, subPath: subpath}, nil 201 } 202 case "resource": 203 if subpath, err := BuildActivityLogResource_FieldPath(fp[1:]); err != nil { 204 return nil, err 205 } else { 206 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorResource, subPath: subpath}, nil 207 } 208 case "events": 209 if subpath, err := BuildActivityLogEvent_FieldPath(fp[1:]); err != nil { 210 return nil, err 211 } else { 212 return &ActivityLog_FieldSubPath{selector: ActivityLog_FieldPathSelectorEvents, subPath: subpath}, nil 213 } 214 case "labels": 215 if len(fp) > 2 { 216 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object ActivityLog)", fp) 217 } 218 return &ActivityLog_FieldPathMap{selector: ActivityLog_FieldPathSelectorLabels, key: fp[1]}, nil 219 } 220 } 221 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog", fp) 222 } 223 224 func ParseActivityLog_FieldPath(rawField string) (ActivityLog_FieldPath, error) { 225 fp, err := gotenobject.ParseRawFieldPath(rawField) 226 if err != nil { 227 return nil, err 228 } 229 return BuildActivityLog_FieldPath(fp) 230 } 231 232 func MustParseActivityLog_FieldPath(rawField string) ActivityLog_FieldPath { 233 fp, err := ParseActivityLog_FieldPath(rawField) 234 if err != nil { 235 panic(err) 236 } 237 return fp 238 } 239 240 type ActivityLog_FieldTerminalPath struct { 241 selector ActivityLog_FieldPathSelector 242 } 243 244 var _ ActivityLog_FieldPath = (*ActivityLog_FieldTerminalPath)(nil) 245 246 func (fp *ActivityLog_FieldTerminalPath) Selector() ActivityLog_FieldPathSelector { 247 return fp.selector 248 } 249 250 // String returns path representation in proto convention 251 func (fp *ActivityLog_FieldTerminalPath) String() string { 252 return fp.selector.String() 253 } 254 255 // JSONString returns path representation is JSON convention 256 func (fp *ActivityLog_FieldTerminalPath) JSONString() string { 257 return strcase.ToLowerCamel(fp.String()) 258 } 259 260 // Get returns all values pointed by specific field from source ActivityLog 261 func (fp *ActivityLog_FieldTerminalPath) Get(source *ActivityLog) (values []interface{}) { 262 if source != nil { 263 switch fp.selector { 264 case ActivityLog_FieldPathSelectorName: 265 if source.Name != nil { 266 values = append(values, source.Name) 267 } 268 case ActivityLog_FieldPathSelectorScope: 269 values = append(values, source.Scope) 270 case ActivityLog_FieldPathSelectorRequestId: 271 values = append(values, source.RequestId) 272 case ActivityLog_FieldPathSelectorAuthentication: 273 if source.Authentication != nil { 274 values = append(values, source.Authentication) 275 } 276 case ActivityLog_FieldPathSelectorAuthorization: 277 if source.Authorization != nil { 278 values = append(values, source.Authorization) 279 } 280 case ActivityLog_FieldPathSelectorService: 281 if source.Service != nil { 282 values = append(values, source.Service) 283 } 284 case ActivityLog_FieldPathSelectorMethod: 285 if source.Method != nil { 286 values = append(values, source.Method) 287 } 288 case ActivityLog_FieldPathSelectorRequestMetadata: 289 if source.RequestMetadata != nil { 290 values = append(values, source.RequestMetadata) 291 } 292 case ActivityLog_FieldPathSelectorRequestRouting: 293 if source.RequestRouting != nil { 294 values = append(values, source.RequestRouting) 295 } 296 case ActivityLog_FieldPathSelectorResource: 297 if source.Resource != nil { 298 values = append(values, source.Resource) 299 } 300 case ActivityLog_FieldPathSelectorCategory: 301 values = append(values, source.Category) 302 case ActivityLog_FieldPathSelectorLabels: 303 values = append(values, source.Labels) 304 case ActivityLog_FieldPathSelectorEvents: 305 for _, value := range source.GetEvents() { 306 values = append(values, value) 307 } 308 default: 309 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 310 } 311 } 312 return 313 } 314 315 func (fp *ActivityLog_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 316 return fp.Get(source.(*ActivityLog)) 317 } 318 319 // GetSingle returns value pointed by specific field of from source ActivityLog 320 func (fp *ActivityLog_FieldTerminalPath) GetSingle(source *ActivityLog) (interface{}, bool) { 321 switch fp.selector { 322 case ActivityLog_FieldPathSelectorName: 323 res := source.GetName() 324 return res, res != nil 325 case ActivityLog_FieldPathSelectorScope: 326 return source.GetScope(), source != nil 327 case ActivityLog_FieldPathSelectorRequestId: 328 return source.GetRequestId(), source != nil 329 case ActivityLog_FieldPathSelectorAuthentication: 330 res := source.GetAuthentication() 331 return res, res != nil 332 case ActivityLog_FieldPathSelectorAuthorization: 333 res := source.GetAuthorization() 334 return res, res != nil 335 case ActivityLog_FieldPathSelectorService: 336 res := source.GetService() 337 return res, res != nil 338 case ActivityLog_FieldPathSelectorMethod: 339 res := source.GetMethod() 340 return res, res != nil 341 case ActivityLog_FieldPathSelectorRequestMetadata: 342 res := source.GetRequestMetadata() 343 return res, res != nil 344 case ActivityLog_FieldPathSelectorRequestRouting: 345 res := source.GetRequestRouting() 346 return res, res != nil 347 case ActivityLog_FieldPathSelectorResource: 348 res := source.GetResource() 349 return res, res != nil 350 case ActivityLog_FieldPathSelectorCategory: 351 return source.GetCategory(), source != nil 352 case ActivityLog_FieldPathSelectorLabels: 353 res := source.GetLabels() 354 return res, res != nil 355 case ActivityLog_FieldPathSelectorEvents: 356 res := source.GetEvents() 357 return res, res != nil 358 default: 359 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 360 } 361 } 362 363 func (fp *ActivityLog_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 364 return fp.GetSingle(source.(*ActivityLog)) 365 } 366 367 // GetDefault returns a default value of the field type 368 func (fp *ActivityLog_FieldTerminalPath) GetDefault() interface{} { 369 switch fp.selector { 370 case ActivityLog_FieldPathSelectorName: 371 return (*Name)(nil) 372 case ActivityLog_FieldPathSelectorScope: 373 return "" 374 case ActivityLog_FieldPathSelectorRequestId: 375 return uint64(0) 376 case ActivityLog_FieldPathSelectorAuthentication: 377 return (*common.Authentication)(nil) 378 case ActivityLog_FieldPathSelectorAuthorization: 379 return (*common.Authorization)(nil) 380 case ActivityLog_FieldPathSelectorService: 381 return (*common.ServiceData)(nil) 382 case ActivityLog_FieldPathSelectorMethod: 383 return (*ActivityLog_Method)(nil) 384 case ActivityLog_FieldPathSelectorRequestMetadata: 385 return (*ActivityLog_RequestMetadata)(nil) 386 case ActivityLog_FieldPathSelectorRequestRouting: 387 return (*ActivityLog_RequestRouting)(nil) 388 case ActivityLog_FieldPathSelectorResource: 389 return (*ActivityLog_Resource)(nil) 390 case ActivityLog_FieldPathSelectorCategory: 391 return ActivityLog_Undefined 392 case ActivityLog_FieldPathSelectorLabels: 393 return (map[string]string)(nil) 394 case ActivityLog_FieldPathSelectorEvents: 395 return ([]*ActivityLog_Event)(nil) 396 default: 397 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 398 } 399 } 400 401 func (fp *ActivityLog_FieldTerminalPath) ClearValue(item *ActivityLog) { 402 if item != nil { 403 switch fp.selector { 404 case ActivityLog_FieldPathSelectorName: 405 item.Name = nil 406 case ActivityLog_FieldPathSelectorScope: 407 item.Scope = "" 408 case ActivityLog_FieldPathSelectorRequestId: 409 item.RequestId = uint64(0) 410 case ActivityLog_FieldPathSelectorAuthentication: 411 item.Authentication = nil 412 case ActivityLog_FieldPathSelectorAuthorization: 413 item.Authorization = nil 414 case ActivityLog_FieldPathSelectorService: 415 item.Service = nil 416 case ActivityLog_FieldPathSelectorMethod: 417 item.Method = nil 418 case ActivityLog_FieldPathSelectorRequestMetadata: 419 item.RequestMetadata = nil 420 case ActivityLog_FieldPathSelectorRequestRouting: 421 item.RequestRouting = nil 422 case ActivityLog_FieldPathSelectorResource: 423 item.Resource = nil 424 case ActivityLog_FieldPathSelectorCategory: 425 item.Category = ActivityLog_Undefined 426 case ActivityLog_FieldPathSelectorLabels: 427 item.Labels = nil 428 case ActivityLog_FieldPathSelectorEvents: 429 item.Events = nil 430 default: 431 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 432 } 433 } 434 } 435 436 func (fp *ActivityLog_FieldTerminalPath) ClearValueRaw(item proto.Message) { 437 fp.ClearValue(item.(*ActivityLog)) 438 } 439 440 // IsLeaf - whether field path is holds simple value 441 func (fp *ActivityLog_FieldTerminalPath) IsLeaf() bool { 442 return fp.selector == ActivityLog_FieldPathSelectorName || 443 fp.selector == ActivityLog_FieldPathSelectorScope || 444 fp.selector == ActivityLog_FieldPathSelectorRequestId || 445 fp.selector == ActivityLog_FieldPathSelectorCategory || 446 fp.selector == ActivityLog_FieldPathSelectorLabels 447 } 448 449 func (fp *ActivityLog_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 450 return []gotenobject.FieldPath{fp} 451 } 452 453 func (fp *ActivityLog_FieldTerminalPath) WithIValue(value interface{}) ActivityLog_FieldPathValue { 454 switch fp.selector { 455 case ActivityLog_FieldPathSelectorName: 456 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*Name)} 457 case ActivityLog_FieldPathSelectorScope: 458 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(string)} 459 case ActivityLog_FieldPathSelectorRequestId: 460 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(uint64)} 461 case ActivityLog_FieldPathSelectorAuthentication: 462 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*common.Authentication)} 463 case ActivityLog_FieldPathSelectorAuthorization: 464 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*common.Authorization)} 465 case ActivityLog_FieldPathSelectorService: 466 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*common.ServiceData)} 467 case ActivityLog_FieldPathSelectorMethod: 468 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*ActivityLog_Method)} 469 case ActivityLog_FieldPathSelectorRequestMetadata: 470 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*ActivityLog_RequestMetadata)} 471 case ActivityLog_FieldPathSelectorRequestRouting: 472 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*ActivityLog_RequestRouting)} 473 case ActivityLog_FieldPathSelectorResource: 474 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*ActivityLog_Resource)} 475 case ActivityLog_FieldPathSelectorCategory: 476 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(ActivityLog_Category)} 477 case ActivityLog_FieldPathSelectorLabels: 478 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.(map[string]string)} 479 case ActivityLog_FieldPathSelectorEvents: 480 return &ActivityLog_FieldTerminalPathValue{ActivityLog_FieldTerminalPath: *fp, value: value.([]*ActivityLog_Event)} 481 default: 482 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 483 } 484 } 485 486 func (fp *ActivityLog_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 487 return fp.WithIValue(value) 488 } 489 490 func (fp *ActivityLog_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLog_FieldPathArrayOfValues { 491 fpaov := &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp} 492 switch fp.selector { 493 case ActivityLog_FieldPathSelectorName: 494 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*Name)} 495 case ActivityLog_FieldPathSelectorScope: 496 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]string)} 497 case ActivityLog_FieldPathSelectorRequestId: 498 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]uint64)} 499 case ActivityLog_FieldPathSelectorAuthentication: 500 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*common.Authentication)} 501 case ActivityLog_FieldPathSelectorAuthorization: 502 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*common.Authorization)} 503 case ActivityLog_FieldPathSelectorService: 504 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*common.ServiceData)} 505 case ActivityLog_FieldPathSelectorMethod: 506 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Method)} 507 case ActivityLog_FieldPathSelectorRequestMetadata: 508 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*ActivityLog_RequestMetadata)} 509 case ActivityLog_FieldPathSelectorRequestRouting: 510 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*ActivityLog_RequestRouting)} 511 case ActivityLog_FieldPathSelectorResource: 512 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Resource)} 513 case ActivityLog_FieldPathSelectorCategory: 514 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]ActivityLog_Category)} 515 case ActivityLog_FieldPathSelectorLabels: 516 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([]map[string]string)} 517 case ActivityLog_FieldPathSelectorEvents: 518 return &ActivityLog_FieldTerminalPathArrayOfValues{ActivityLog_FieldTerminalPath: *fp, values: values.([][]*ActivityLog_Event)} 519 default: 520 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 521 } 522 return fpaov 523 } 524 525 func (fp *ActivityLog_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 526 return fp.WithIArrayOfValues(values) 527 } 528 529 func (fp *ActivityLog_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLog_FieldPathArrayItemValue { 530 switch fp.selector { 531 case ActivityLog_FieldPathSelectorEvents: 532 return &ActivityLog_FieldTerminalPathArrayItemValue{ActivityLog_FieldTerminalPath: *fp, value: value.(*ActivityLog_Event)} 533 default: 534 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fp.selector)) 535 } 536 } 537 538 func (fp *ActivityLog_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 539 return fp.WithIArrayItemValue(value) 540 } 541 542 // FieldPath for map type with additional Key information 543 type ActivityLog_FieldPathMap struct { 544 key string 545 selector ActivityLog_FieldPathSelector 546 } 547 548 var _ ActivityLog_FieldPath = (*ActivityLog_FieldPathMap)(nil) 549 550 func (fpm *ActivityLog_FieldPathMap) Selector() ActivityLog_FieldPathSelector { 551 return fpm.selector 552 } 553 554 func (fpm *ActivityLog_FieldPathMap) Key() string { 555 return fpm.key 556 } 557 558 // String returns path representation in proto convention 559 func (fpm *ActivityLog_FieldPathMap) String() string { 560 return fpm.selector.String() + "." + fpm.key 561 } 562 563 // JSONString returns path representation is JSON convention. Note that map keys are not transformed 564 func (fpm *ActivityLog_FieldPathMap) JSONString() string { 565 return strcase.ToLowerCamel(fpm.selector.String()) + "." + fpm.key 566 } 567 568 // Get returns all values pointed by selected field map key from source ActivityLog 569 func (fpm *ActivityLog_FieldPathMap) Get(source *ActivityLog) (values []interface{}) { 570 switch fpm.selector { 571 case ActivityLog_FieldPathSelectorLabels: 572 if value, ok := source.GetLabels()[fpm.key]; ok { 573 values = append(values, value) 574 } 575 default: 576 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 577 } 578 return 579 } 580 581 func (fpm *ActivityLog_FieldPathMap) GetRaw(source proto.Message) []interface{} { 582 return fpm.Get(source.(*ActivityLog)) 583 } 584 585 // GetSingle returns value by selected field map key from source ActivityLog 586 func (fpm *ActivityLog_FieldPathMap) GetSingle(source *ActivityLog) (interface{}, bool) { 587 switch fpm.selector { 588 case ActivityLog_FieldPathSelectorLabels: 589 res, ok := source.GetLabels()[fpm.key] 590 return res, ok 591 default: 592 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 593 } 594 } 595 596 func (fpm *ActivityLog_FieldPathMap) GetSingleRaw(source proto.Message) (interface{}, bool) { 597 return fpm.GetSingle(source.(*ActivityLog)) 598 } 599 600 // GetDefault returns a default value of the field type 601 func (fpm *ActivityLog_FieldPathMap) GetDefault() interface{} { 602 switch fpm.selector { 603 case ActivityLog_FieldPathSelectorLabels: 604 var v string 605 return v 606 default: 607 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 608 } 609 } 610 611 func (fpm *ActivityLog_FieldPathMap) ClearValue(item *ActivityLog) { 612 if item != nil { 613 switch fpm.selector { 614 case ActivityLog_FieldPathSelectorLabels: 615 delete(item.Labels, fpm.key) 616 default: 617 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 618 } 619 } 620 } 621 622 func (fpm *ActivityLog_FieldPathMap) ClearValueRaw(item proto.Message) { 623 fpm.ClearValue(item.(*ActivityLog)) 624 } 625 626 // IsLeaf - whether field path is holds simple value 627 func (fpm *ActivityLog_FieldPathMap) IsLeaf() bool { 628 switch fpm.selector { 629 case ActivityLog_FieldPathSelectorLabels: 630 return true 631 default: 632 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 633 } 634 } 635 636 func (fpm *ActivityLog_FieldPathMap) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 637 return []gotenobject.FieldPath{fpm} 638 } 639 640 func (fpm *ActivityLog_FieldPathMap) WithIValue(value interface{}) ActivityLog_FieldPathValue { 641 switch fpm.selector { 642 case ActivityLog_FieldPathSelectorLabels: 643 return &ActivityLog_FieldPathMapValue{ActivityLog_FieldPathMap: *fpm, value: value.(string)} 644 default: 645 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 646 } 647 } 648 649 func (fpm *ActivityLog_FieldPathMap) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 650 return fpm.WithIValue(value) 651 } 652 653 func (fpm *ActivityLog_FieldPathMap) WithIArrayOfValues(values interface{}) ActivityLog_FieldPathArrayOfValues { 654 switch fpm.selector { 655 case ActivityLog_FieldPathSelectorLabels: 656 return &ActivityLog_FieldPathMapArrayOfValues{ActivityLog_FieldPathMap: *fpm, values: values.([]string)} 657 default: 658 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpm.selector)) 659 } 660 } 661 662 func (fpm *ActivityLog_FieldPathMap) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 663 return fpm.WithIArrayOfValues(values) 664 } 665 666 func (fpm *ActivityLog_FieldPathMap) WithIArrayItemValue(value interface{}) ActivityLog_FieldPathArrayItemValue { 667 panic("Cannot create array item value from map fieldpath") 668 } 669 670 func (fpm *ActivityLog_FieldPathMap) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 671 return fpm.WithIArrayItemValue(value) 672 } 673 674 type ActivityLog_FieldSubPath struct { 675 selector ActivityLog_FieldPathSelector 676 subPath gotenobject.FieldPath 677 } 678 679 var _ ActivityLog_FieldPath = (*ActivityLog_FieldSubPath)(nil) 680 681 func (fps *ActivityLog_FieldSubPath) Selector() ActivityLog_FieldPathSelector { 682 return fps.selector 683 } 684 func (fps *ActivityLog_FieldSubPath) AsAuthenticationSubPath() (common.Authentication_FieldPath, bool) { 685 res, ok := fps.subPath.(common.Authentication_FieldPath) 686 return res, ok 687 } 688 func (fps *ActivityLog_FieldSubPath) AsAuthorizationSubPath() (common.Authorization_FieldPath, bool) { 689 res, ok := fps.subPath.(common.Authorization_FieldPath) 690 return res, ok 691 } 692 func (fps *ActivityLog_FieldSubPath) AsServiceSubPath() (common.ServiceData_FieldPath, bool) { 693 res, ok := fps.subPath.(common.ServiceData_FieldPath) 694 return res, ok 695 } 696 func (fps *ActivityLog_FieldSubPath) AsMethodSubPath() (ActivityLogMethod_FieldPath, bool) { 697 res, ok := fps.subPath.(ActivityLogMethod_FieldPath) 698 return res, ok 699 } 700 func (fps *ActivityLog_FieldSubPath) AsRequestMetadataSubPath() (ActivityLogRequestMetadata_FieldPath, bool) { 701 res, ok := fps.subPath.(ActivityLogRequestMetadata_FieldPath) 702 return res, ok 703 } 704 func (fps *ActivityLog_FieldSubPath) AsRequestRoutingSubPath() (ActivityLogRequestRouting_FieldPath, bool) { 705 res, ok := fps.subPath.(ActivityLogRequestRouting_FieldPath) 706 return res, ok 707 } 708 func (fps *ActivityLog_FieldSubPath) AsResourceSubPath() (ActivityLogResource_FieldPath, bool) { 709 res, ok := fps.subPath.(ActivityLogResource_FieldPath) 710 return res, ok 711 } 712 func (fps *ActivityLog_FieldSubPath) AsEventsSubPath() (ActivityLogEvent_FieldPath, bool) { 713 res, ok := fps.subPath.(ActivityLogEvent_FieldPath) 714 return res, ok 715 } 716 717 // String returns path representation in proto convention 718 func (fps *ActivityLog_FieldSubPath) String() string { 719 return fps.selector.String() + "." + fps.subPath.String() 720 } 721 722 // JSONString returns path representation is JSON convention 723 func (fps *ActivityLog_FieldSubPath) JSONString() string { 724 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 725 } 726 727 // Get returns all values pointed by selected field from source ActivityLog 728 func (fps *ActivityLog_FieldSubPath) Get(source *ActivityLog) (values []interface{}) { 729 switch fps.selector { 730 case ActivityLog_FieldPathSelectorAuthentication: 731 values = append(values, fps.subPath.GetRaw(source.GetAuthentication())...) 732 case ActivityLog_FieldPathSelectorAuthorization: 733 values = append(values, fps.subPath.GetRaw(source.GetAuthorization())...) 734 case ActivityLog_FieldPathSelectorService: 735 values = append(values, fps.subPath.GetRaw(source.GetService())...) 736 case ActivityLog_FieldPathSelectorMethod: 737 values = append(values, fps.subPath.GetRaw(source.GetMethod())...) 738 case ActivityLog_FieldPathSelectorRequestMetadata: 739 values = append(values, fps.subPath.GetRaw(source.GetRequestMetadata())...) 740 case ActivityLog_FieldPathSelectorRequestRouting: 741 values = append(values, fps.subPath.GetRaw(source.GetRequestRouting())...) 742 case ActivityLog_FieldPathSelectorResource: 743 values = append(values, fps.subPath.GetRaw(source.GetResource())...) 744 case ActivityLog_FieldPathSelectorEvents: 745 for _, item := range source.GetEvents() { 746 values = append(values, fps.subPath.GetRaw(item)...) 747 } 748 default: 749 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fps.selector)) 750 } 751 return 752 } 753 754 func (fps *ActivityLog_FieldSubPath) GetRaw(source proto.Message) []interface{} { 755 return fps.Get(source.(*ActivityLog)) 756 } 757 758 // GetSingle returns value of selected field from source ActivityLog 759 func (fps *ActivityLog_FieldSubPath) GetSingle(source *ActivityLog) (interface{}, bool) { 760 switch fps.selector { 761 case ActivityLog_FieldPathSelectorAuthentication: 762 if source.GetAuthentication() == nil { 763 return nil, false 764 } 765 return fps.subPath.GetSingleRaw(source.GetAuthentication()) 766 case ActivityLog_FieldPathSelectorAuthorization: 767 if source.GetAuthorization() == nil { 768 return nil, false 769 } 770 return fps.subPath.GetSingleRaw(source.GetAuthorization()) 771 case ActivityLog_FieldPathSelectorService: 772 if source.GetService() == nil { 773 return nil, false 774 } 775 return fps.subPath.GetSingleRaw(source.GetService()) 776 case ActivityLog_FieldPathSelectorMethod: 777 if source.GetMethod() == nil { 778 return nil, false 779 } 780 return fps.subPath.GetSingleRaw(source.GetMethod()) 781 case ActivityLog_FieldPathSelectorRequestMetadata: 782 if source.GetRequestMetadata() == nil { 783 return nil, false 784 } 785 return fps.subPath.GetSingleRaw(source.GetRequestMetadata()) 786 case ActivityLog_FieldPathSelectorRequestRouting: 787 if source.GetRequestRouting() == nil { 788 return nil, false 789 } 790 return fps.subPath.GetSingleRaw(source.GetRequestRouting()) 791 case ActivityLog_FieldPathSelectorResource: 792 if source.GetResource() == nil { 793 return nil, false 794 } 795 return fps.subPath.GetSingleRaw(source.GetResource()) 796 case ActivityLog_FieldPathSelectorEvents: 797 if len(source.GetEvents()) == 0 { 798 return nil, false 799 } 800 return fps.subPath.GetSingleRaw(source.GetEvents()[0]) 801 default: 802 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fps.selector)) 803 } 804 } 805 806 func (fps *ActivityLog_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 807 return fps.GetSingle(source.(*ActivityLog)) 808 } 809 810 // GetDefault returns a default value of the field type 811 func (fps *ActivityLog_FieldSubPath) GetDefault() interface{} { 812 return fps.subPath.GetDefault() 813 } 814 815 func (fps *ActivityLog_FieldSubPath) ClearValue(item *ActivityLog) { 816 if item != nil { 817 switch fps.selector { 818 case ActivityLog_FieldPathSelectorAuthentication: 819 fps.subPath.ClearValueRaw(item.Authentication) 820 case ActivityLog_FieldPathSelectorAuthorization: 821 fps.subPath.ClearValueRaw(item.Authorization) 822 case ActivityLog_FieldPathSelectorService: 823 fps.subPath.ClearValueRaw(item.Service) 824 case ActivityLog_FieldPathSelectorMethod: 825 fps.subPath.ClearValueRaw(item.Method) 826 case ActivityLog_FieldPathSelectorRequestMetadata: 827 fps.subPath.ClearValueRaw(item.RequestMetadata) 828 case ActivityLog_FieldPathSelectorRequestRouting: 829 fps.subPath.ClearValueRaw(item.RequestRouting) 830 case ActivityLog_FieldPathSelectorResource: 831 fps.subPath.ClearValueRaw(item.Resource) 832 case ActivityLog_FieldPathSelectorEvents: 833 for _, subItem := range item.Events { 834 fps.subPath.ClearValueRaw(subItem) 835 } 836 default: 837 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fps.selector)) 838 } 839 } 840 } 841 842 func (fps *ActivityLog_FieldSubPath) ClearValueRaw(item proto.Message) { 843 fps.ClearValue(item.(*ActivityLog)) 844 } 845 846 // IsLeaf - whether field path is holds simple value 847 func (fps *ActivityLog_FieldSubPath) IsLeaf() bool { 848 return fps.subPath.IsLeaf() 849 } 850 851 func (fps *ActivityLog_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 852 iPaths := []gotenobject.FieldPath{&ActivityLog_FieldTerminalPath{selector: fps.selector}} 853 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 854 return iPaths 855 } 856 857 func (fps *ActivityLog_FieldSubPath) WithIValue(value interface{}) ActivityLog_FieldPathValue { 858 return &ActivityLog_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 859 } 860 861 func (fps *ActivityLog_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 862 return fps.WithIValue(value) 863 } 864 865 func (fps *ActivityLog_FieldSubPath) WithIArrayOfValues(values interface{}) ActivityLog_FieldPathArrayOfValues { 866 return &ActivityLog_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 867 } 868 869 func (fps *ActivityLog_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 870 return fps.WithIArrayOfValues(values) 871 } 872 873 func (fps *ActivityLog_FieldSubPath) WithIArrayItemValue(value interface{}) ActivityLog_FieldPathArrayItemValue { 874 return &ActivityLog_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 875 } 876 877 func (fps *ActivityLog_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 878 return fps.WithIArrayItemValue(value) 879 } 880 881 // ActivityLog_FieldPathValue allows storing values for ActivityLog fields according to their type 882 type ActivityLog_FieldPathValue interface { 883 ActivityLog_FieldPath 884 gotenobject.FieldPathValue 885 SetTo(target **ActivityLog) 886 CompareWith(*ActivityLog) (cmp int, comparable bool) 887 } 888 889 func ParseActivityLog_FieldPathValue(pathStr, valueStr string) (ActivityLog_FieldPathValue, error) { 890 fp, err := ParseActivityLog_FieldPath(pathStr) 891 if err != nil { 892 return nil, err 893 } 894 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 895 if err != nil { 896 return nil, status.Errorf(codes.InvalidArgument, "error parsing ActivityLog field path value from %s: %v", valueStr, err) 897 } 898 return fpv.(ActivityLog_FieldPathValue), nil 899 } 900 901 func MustParseActivityLog_FieldPathValue(pathStr, valueStr string) ActivityLog_FieldPathValue { 902 fpv, err := ParseActivityLog_FieldPathValue(pathStr, valueStr) 903 if err != nil { 904 panic(err) 905 } 906 return fpv 907 } 908 909 type ActivityLog_FieldTerminalPathValue struct { 910 ActivityLog_FieldTerminalPath 911 value interface{} 912 } 913 914 var _ ActivityLog_FieldPathValue = (*ActivityLog_FieldTerminalPathValue)(nil) 915 916 // GetRawValue returns raw value stored under selected path for 'ActivityLog' as interface{} 917 func (fpv *ActivityLog_FieldTerminalPathValue) GetRawValue() interface{} { 918 return fpv.value 919 } 920 func (fpv *ActivityLog_FieldTerminalPathValue) AsNameValue() (*Name, bool) { 921 res, ok := fpv.value.(*Name) 922 return res, ok 923 } 924 func (fpv *ActivityLog_FieldTerminalPathValue) AsScopeValue() (string, bool) { 925 res, ok := fpv.value.(string) 926 return res, ok 927 } 928 func (fpv *ActivityLog_FieldTerminalPathValue) AsRequestIdValue() (uint64, bool) { 929 res, ok := fpv.value.(uint64) 930 return res, ok 931 } 932 func (fpv *ActivityLog_FieldTerminalPathValue) AsAuthenticationValue() (*common.Authentication, bool) { 933 res, ok := fpv.value.(*common.Authentication) 934 return res, ok 935 } 936 func (fpv *ActivityLog_FieldTerminalPathValue) AsAuthorizationValue() (*common.Authorization, bool) { 937 res, ok := fpv.value.(*common.Authorization) 938 return res, ok 939 } 940 func (fpv *ActivityLog_FieldTerminalPathValue) AsServiceValue() (*common.ServiceData, bool) { 941 res, ok := fpv.value.(*common.ServiceData) 942 return res, ok 943 } 944 func (fpv *ActivityLog_FieldTerminalPathValue) AsMethodValue() (*ActivityLog_Method, bool) { 945 res, ok := fpv.value.(*ActivityLog_Method) 946 return res, ok 947 } 948 func (fpv *ActivityLog_FieldTerminalPathValue) AsRequestMetadataValue() (*ActivityLog_RequestMetadata, bool) { 949 res, ok := fpv.value.(*ActivityLog_RequestMetadata) 950 return res, ok 951 } 952 func (fpv *ActivityLog_FieldTerminalPathValue) AsRequestRoutingValue() (*ActivityLog_RequestRouting, bool) { 953 res, ok := fpv.value.(*ActivityLog_RequestRouting) 954 return res, ok 955 } 956 func (fpv *ActivityLog_FieldTerminalPathValue) AsResourceValue() (*ActivityLog_Resource, bool) { 957 res, ok := fpv.value.(*ActivityLog_Resource) 958 return res, ok 959 } 960 func (fpv *ActivityLog_FieldTerminalPathValue) AsCategoryValue() (ActivityLog_Category, bool) { 961 res, ok := fpv.value.(ActivityLog_Category) 962 return res, ok 963 } 964 func (fpv *ActivityLog_FieldTerminalPathValue) AsLabelsValue() (map[string]string, bool) { 965 res, ok := fpv.value.(map[string]string) 966 return res, ok 967 } 968 func (fpv *ActivityLog_FieldTerminalPathValue) AsEventsValue() ([]*ActivityLog_Event, bool) { 969 res, ok := fpv.value.([]*ActivityLog_Event) 970 return res, ok 971 } 972 973 // SetTo stores value for selected field for object ActivityLog 974 func (fpv *ActivityLog_FieldTerminalPathValue) SetTo(target **ActivityLog) { 975 if *target == nil { 976 *target = new(ActivityLog) 977 } 978 switch fpv.selector { 979 case ActivityLog_FieldPathSelectorName: 980 (*target).Name = fpv.value.(*Name) 981 case ActivityLog_FieldPathSelectorScope: 982 (*target).Scope = fpv.value.(string) 983 case ActivityLog_FieldPathSelectorRequestId: 984 (*target).RequestId = fpv.value.(uint64) 985 case ActivityLog_FieldPathSelectorAuthentication: 986 (*target).Authentication = fpv.value.(*common.Authentication) 987 case ActivityLog_FieldPathSelectorAuthorization: 988 (*target).Authorization = fpv.value.(*common.Authorization) 989 case ActivityLog_FieldPathSelectorService: 990 (*target).Service = fpv.value.(*common.ServiceData) 991 case ActivityLog_FieldPathSelectorMethod: 992 (*target).Method = fpv.value.(*ActivityLog_Method) 993 case ActivityLog_FieldPathSelectorRequestMetadata: 994 (*target).RequestMetadata = fpv.value.(*ActivityLog_RequestMetadata) 995 case ActivityLog_FieldPathSelectorRequestRouting: 996 (*target).RequestRouting = fpv.value.(*ActivityLog_RequestRouting) 997 case ActivityLog_FieldPathSelectorResource: 998 (*target).Resource = fpv.value.(*ActivityLog_Resource) 999 case ActivityLog_FieldPathSelectorCategory: 1000 (*target).Category = fpv.value.(ActivityLog_Category) 1001 case ActivityLog_FieldPathSelectorLabels: 1002 (*target).Labels = fpv.value.(map[string]string) 1003 case ActivityLog_FieldPathSelectorEvents: 1004 (*target).Events = fpv.value.([]*ActivityLog_Event) 1005 default: 1006 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpv.selector)) 1007 } 1008 } 1009 1010 func (fpv *ActivityLog_FieldTerminalPathValue) SetToRaw(target proto.Message) { 1011 typedObject := target.(*ActivityLog) 1012 fpv.SetTo(&typedObject) 1013 } 1014 1015 // CompareWith compares value in the 'ActivityLog_FieldTerminalPathValue' with the value under path in 'ActivityLog'. 1016 func (fpv *ActivityLog_FieldTerminalPathValue) CompareWith(source *ActivityLog) (int, bool) { 1017 switch fpv.selector { 1018 case ActivityLog_FieldPathSelectorName: 1019 leftValue := fpv.value.(*Name) 1020 rightValue := source.GetName() 1021 if leftValue == nil { 1022 if rightValue != nil { 1023 return -1, true 1024 } 1025 return 0, true 1026 } 1027 if rightValue == nil { 1028 return 1, true 1029 } 1030 if leftValue.String() == rightValue.String() { 1031 return 0, true 1032 } else if leftValue.String() < rightValue.String() { 1033 return -1, true 1034 } else { 1035 return 1, true 1036 } 1037 case ActivityLog_FieldPathSelectorScope: 1038 leftValue := fpv.value.(string) 1039 rightValue := source.GetScope() 1040 if (leftValue) == (rightValue) { 1041 return 0, true 1042 } else if (leftValue) < (rightValue) { 1043 return -1, true 1044 } else { 1045 return 1, true 1046 } 1047 case ActivityLog_FieldPathSelectorRequestId: 1048 leftValue := fpv.value.(uint64) 1049 rightValue := source.GetRequestId() 1050 if (leftValue) == (rightValue) { 1051 return 0, true 1052 } else if (leftValue) < (rightValue) { 1053 return -1, true 1054 } else { 1055 return 1, true 1056 } 1057 case ActivityLog_FieldPathSelectorAuthentication: 1058 return 0, false 1059 case ActivityLog_FieldPathSelectorAuthorization: 1060 return 0, false 1061 case ActivityLog_FieldPathSelectorService: 1062 return 0, false 1063 case ActivityLog_FieldPathSelectorMethod: 1064 return 0, false 1065 case ActivityLog_FieldPathSelectorRequestMetadata: 1066 return 0, false 1067 case ActivityLog_FieldPathSelectorRequestRouting: 1068 return 0, false 1069 case ActivityLog_FieldPathSelectorResource: 1070 return 0, false 1071 case ActivityLog_FieldPathSelectorCategory: 1072 leftValue := fpv.value.(ActivityLog_Category) 1073 rightValue := source.GetCategory() 1074 if (leftValue) == (rightValue) { 1075 return 0, true 1076 } else if (leftValue) < (rightValue) { 1077 return -1, true 1078 } else { 1079 return 1, true 1080 } 1081 case ActivityLog_FieldPathSelectorLabels: 1082 return 0, false 1083 case ActivityLog_FieldPathSelectorEvents: 1084 return 0, false 1085 default: 1086 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpv.selector)) 1087 } 1088 } 1089 1090 func (fpv *ActivityLog_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1091 return fpv.CompareWith(source.(*ActivityLog)) 1092 } 1093 1094 type ActivityLog_FieldPathMapValue struct { 1095 ActivityLog_FieldPathMap 1096 value interface{} 1097 } 1098 1099 var _ ActivityLog_FieldPathValue = (*ActivityLog_FieldPathMapValue)(nil) 1100 1101 // GetValue returns value stored under selected field in ActivityLog as interface{} 1102 func (fpmv *ActivityLog_FieldPathMapValue) GetRawValue() interface{} { 1103 return fpmv.value 1104 } 1105 func (fpmv *ActivityLog_FieldPathMapValue) AsLabelsElementValue() (string, bool) { 1106 res, ok := fpmv.value.(string) 1107 return res, ok 1108 } 1109 1110 // SetTo stores value for selected field in ActivityLog 1111 func (fpmv *ActivityLog_FieldPathMapValue) SetTo(target **ActivityLog) { 1112 if *target == nil { 1113 *target = new(ActivityLog) 1114 } 1115 switch fpmv.selector { 1116 case ActivityLog_FieldPathSelectorLabels: 1117 if (*target).Labels == nil { 1118 (*target).Labels = make(map[string]string) 1119 } 1120 (*target).Labels[fpmv.key] = fpmv.value.(string) 1121 default: 1122 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpmv.selector)) 1123 } 1124 } 1125 1126 func (fpmv *ActivityLog_FieldPathMapValue) SetToRaw(target proto.Message) { 1127 typedObject := target.(*ActivityLog) 1128 fpmv.SetTo(&typedObject) 1129 } 1130 1131 // CompareWith compares value in the 'ActivityLog_FieldPathMapValue' with the value under path in 'ActivityLog'. 1132 func (fpmv *ActivityLog_FieldPathMapValue) CompareWith(source *ActivityLog) (int, bool) { 1133 switch fpmv.selector { 1134 case ActivityLog_FieldPathSelectorLabels: 1135 leftValue := fpmv.value.(string) 1136 rightValue := source.GetLabels()[fpmv.key] 1137 if (leftValue) == (rightValue) { 1138 return 0, true 1139 } else if (leftValue) < (rightValue) { 1140 return -1, true 1141 } else { 1142 return 1, true 1143 } 1144 default: 1145 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpmv.selector)) 1146 } 1147 } 1148 1149 func (fpmv *ActivityLog_FieldPathMapValue) CompareWithRaw(source proto.Message) (int, bool) { 1150 return fpmv.CompareWith(source.(*ActivityLog)) 1151 } 1152 1153 type ActivityLog_FieldSubPathValue struct { 1154 ActivityLog_FieldPath 1155 subPathValue gotenobject.FieldPathValue 1156 } 1157 1158 var _ ActivityLog_FieldPathValue = (*ActivityLog_FieldSubPathValue)(nil) 1159 1160 func (fpvs *ActivityLog_FieldSubPathValue) AsAuthenticationPathValue() (common.Authentication_FieldPathValue, bool) { 1161 res, ok := fpvs.subPathValue.(common.Authentication_FieldPathValue) 1162 return res, ok 1163 } 1164 func (fpvs *ActivityLog_FieldSubPathValue) AsAuthorizationPathValue() (common.Authorization_FieldPathValue, bool) { 1165 res, ok := fpvs.subPathValue.(common.Authorization_FieldPathValue) 1166 return res, ok 1167 } 1168 func (fpvs *ActivityLog_FieldSubPathValue) AsServicePathValue() (common.ServiceData_FieldPathValue, bool) { 1169 res, ok := fpvs.subPathValue.(common.ServiceData_FieldPathValue) 1170 return res, ok 1171 } 1172 func (fpvs *ActivityLog_FieldSubPathValue) AsMethodPathValue() (ActivityLogMethod_FieldPathValue, bool) { 1173 res, ok := fpvs.subPathValue.(ActivityLogMethod_FieldPathValue) 1174 return res, ok 1175 } 1176 func (fpvs *ActivityLog_FieldSubPathValue) AsRequestMetadataPathValue() (ActivityLogRequestMetadata_FieldPathValue, bool) { 1177 res, ok := fpvs.subPathValue.(ActivityLogRequestMetadata_FieldPathValue) 1178 return res, ok 1179 } 1180 func (fpvs *ActivityLog_FieldSubPathValue) AsRequestRoutingPathValue() (ActivityLogRequestRouting_FieldPathValue, bool) { 1181 res, ok := fpvs.subPathValue.(ActivityLogRequestRouting_FieldPathValue) 1182 return res, ok 1183 } 1184 func (fpvs *ActivityLog_FieldSubPathValue) AsResourcePathValue() (ActivityLogResource_FieldPathValue, bool) { 1185 res, ok := fpvs.subPathValue.(ActivityLogResource_FieldPathValue) 1186 return res, ok 1187 } 1188 func (fpvs *ActivityLog_FieldSubPathValue) AsEventsPathValue() (ActivityLogEvent_FieldPathValue, bool) { 1189 res, ok := fpvs.subPathValue.(ActivityLogEvent_FieldPathValue) 1190 return res, ok 1191 } 1192 1193 func (fpvs *ActivityLog_FieldSubPathValue) SetTo(target **ActivityLog) { 1194 if *target == nil { 1195 *target = new(ActivityLog) 1196 } 1197 switch fpvs.Selector() { 1198 case ActivityLog_FieldPathSelectorAuthentication: 1199 fpvs.subPathValue.(common.Authentication_FieldPathValue).SetTo(&(*target).Authentication) 1200 case ActivityLog_FieldPathSelectorAuthorization: 1201 fpvs.subPathValue.(common.Authorization_FieldPathValue).SetTo(&(*target).Authorization) 1202 case ActivityLog_FieldPathSelectorService: 1203 fpvs.subPathValue.(common.ServiceData_FieldPathValue).SetTo(&(*target).Service) 1204 case ActivityLog_FieldPathSelectorMethod: 1205 fpvs.subPathValue.(ActivityLogMethod_FieldPathValue).SetTo(&(*target).Method) 1206 case ActivityLog_FieldPathSelectorRequestMetadata: 1207 fpvs.subPathValue.(ActivityLogRequestMetadata_FieldPathValue).SetTo(&(*target).RequestMetadata) 1208 case ActivityLog_FieldPathSelectorRequestRouting: 1209 fpvs.subPathValue.(ActivityLogRequestRouting_FieldPathValue).SetTo(&(*target).RequestRouting) 1210 case ActivityLog_FieldPathSelectorResource: 1211 fpvs.subPathValue.(ActivityLogResource_FieldPathValue).SetTo(&(*target).Resource) 1212 case ActivityLog_FieldPathSelectorEvents: 1213 panic("FieldPath setter is unsupported for array subpaths") 1214 default: 1215 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpvs.Selector())) 1216 } 1217 } 1218 1219 func (fpvs *ActivityLog_FieldSubPathValue) SetToRaw(target proto.Message) { 1220 typedObject := target.(*ActivityLog) 1221 fpvs.SetTo(&typedObject) 1222 } 1223 1224 func (fpvs *ActivityLog_FieldSubPathValue) GetRawValue() interface{} { 1225 return fpvs.subPathValue.GetRawValue() 1226 } 1227 1228 func (fpvs *ActivityLog_FieldSubPathValue) CompareWith(source *ActivityLog) (int, bool) { 1229 switch fpvs.Selector() { 1230 case ActivityLog_FieldPathSelectorAuthentication: 1231 return fpvs.subPathValue.(common.Authentication_FieldPathValue).CompareWith(source.GetAuthentication()) 1232 case ActivityLog_FieldPathSelectorAuthorization: 1233 return fpvs.subPathValue.(common.Authorization_FieldPathValue).CompareWith(source.GetAuthorization()) 1234 case ActivityLog_FieldPathSelectorService: 1235 return fpvs.subPathValue.(common.ServiceData_FieldPathValue).CompareWith(source.GetService()) 1236 case ActivityLog_FieldPathSelectorMethod: 1237 return fpvs.subPathValue.(ActivityLogMethod_FieldPathValue).CompareWith(source.GetMethod()) 1238 case ActivityLog_FieldPathSelectorRequestMetadata: 1239 return fpvs.subPathValue.(ActivityLogRequestMetadata_FieldPathValue).CompareWith(source.GetRequestMetadata()) 1240 case ActivityLog_FieldPathSelectorRequestRouting: 1241 return fpvs.subPathValue.(ActivityLogRequestRouting_FieldPathValue).CompareWith(source.GetRequestRouting()) 1242 case ActivityLog_FieldPathSelectorResource: 1243 return fpvs.subPathValue.(ActivityLogResource_FieldPathValue).CompareWith(source.GetResource()) 1244 case ActivityLog_FieldPathSelectorEvents: 1245 return 0, false // repeated field 1246 default: 1247 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpvs.Selector())) 1248 } 1249 } 1250 1251 func (fpvs *ActivityLog_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1252 return fpvs.CompareWith(source.(*ActivityLog)) 1253 } 1254 1255 // ActivityLog_FieldPathArrayItemValue allows storing single item in Path-specific values for ActivityLog according to their type 1256 // Present only for array (repeated) types. 1257 type ActivityLog_FieldPathArrayItemValue interface { 1258 gotenobject.FieldPathArrayItemValue 1259 ActivityLog_FieldPath 1260 ContainsValue(*ActivityLog) bool 1261 } 1262 1263 // ParseActivityLog_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 1264 func ParseActivityLog_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLog_FieldPathArrayItemValue, error) { 1265 fp, err := ParseActivityLog_FieldPath(pathStr) 1266 if err != nil { 1267 return nil, err 1268 } 1269 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 1270 if err != nil { 1271 return nil, status.Errorf(codes.InvalidArgument, "error parsing ActivityLog field path array item value from %s: %v", valueStr, err) 1272 } 1273 return fpaiv.(ActivityLog_FieldPathArrayItemValue), nil 1274 } 1275 1276 func MustParseActivityLog_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLog_FieldPathArrayItemValue { 1277 fpaiv, err := ParseActivityLog_FieldPathArrayItemValue(pathStr, valueStr) 1278 if err != nil { 1279 panic(err) 1280 } 1281 return fpaiv 1282 } 1283 1284 type ActivityLog_FieldTerminalPathArrayItemValue struct { 1285 ActivityLog_FieldTerminalPath 1286 value interface{} 1287 } 1288 1289 var _ ActivityLog_FieldPathArrayItemValue = (*ActivityLog_FieldTerminalPathArrayItemValue)(nil) 1290 1291 // GetRawValue returns stored element value for array in object ActivityLog as interface{} 1292 func (fpaiv *ActivityLog_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 1293 return fpaiv.value 1294 } 1295 func (fpaiv *ActivityLog_FieldTerminalPathArrayItemValue) AsEventsItemValue() (*ActivityLog_Event, bool) { 1296 res, ok := fpaiv.value.(*ActivityLog_Event) 1297 return res, ok 1298 } 1299 1300 func (fpaiv *ActivityLog_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog) (interface{}, bool) { 1301 return nil, false 1302 } 1303 1304 func (fpaiv *ActivityLog_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 1305 return fpaiv.GetSingle(source.(*ActivityLog)) 1306 } 1307 1308 // Contains returns a boolean indicating if value that is being held is present in given 'ActivityLog' 1309 func (fpaiv *ActivityLog_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog) bool { 1310 slice := fpaiv.ActivityLog_FieldTerminalPath.Get(source) 1311 for _, v := range slice { 1312 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 1313 if proto.Equal(asProtoMsg, v.(proto.Message)) { 1314 return true 1315 } 1316 } else if reflect.DeepEqual(v, fpaiv.value) { 1317 return true 1318 } 1319 } 1320 return false 1321 } 1322 1323 type ActivityLog_FieldSubPathArrayItemValue struct { 1324 ActivityLog_FieldPath 1325 subPathItemValue gotenobject.FieldPathArrayItemValue 1326 } 1327 1328 // GetRawValue returns stored array item value 1329 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 1330 return fpaivs.subPathItemValue.GetRawItemValue() 1331 } 1332 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsAuthenticationPathItemValue() (common.Authentication_FieldPathArrayItemValue, bool) { 1333 res, ok := fpaivs.subPathItemValue.(common.Authentication_FieldPathArrayItemValue) 1334 return res, ok 1335 } 1336 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsAuthorizationPathItemValue() (common.Authorization_FieldPathArrayItemValue, bool) { 1337 res, ok := fpaivs.subPathItemValue.(common.Authorization_FieldPathArrayItemValue) 1338 return res, ok 1339 } 1340 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsServicePathItemValue() (common.ServiceData_FieldPathArrayItemValue, bool) { 1341 res, ok := fpaivs.subPathItemValue.(common.ServiceData_FieldPathArrayItemValue) 1342 return res, ok 1343 } 1344 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsMethodPathItemValue() (ActivityLogMethod_FieldPathArrayItemValue, bool) { 1345 res, ok := fpaivs.subPathItemValue.(ActivityLogMethod_FieldPathArrayItemValue) 1346 return res, ok 1347 } 1348 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsRequestMetadataPathItemValue() (ActivityLogRequestMetadata_FieldPathArrayItemValue, bool) { 1349 res, ok := fpaivs.subPathItemValue.(ActivityLogRequestMetadata_FieldPathArrayItemValue) 1350 return res, ok 1351 } 1352 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsRequestRoutingPathItemValue() (ActivityLogRequestRouting_FieldPathArrayItemValue, bool) { 1353 res, ok := fpaivs.subPathItemValue.(ActivityLogRequestRouting_FieldPathArrayItemValue) 1354 return res, ok 1355 } 1356 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsResourcePathItemValue() (ActivityLogResource_FieldPathArrayItemValue, bool) { 1357 res, ok := fpaivs.subPathItemValue.(ActivityLogResource_FieldPathArrayItemValue) 1358 return res, ok 1359 } 1360 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) AsEventsPathItemValue() (ActivityLogEvent_FieldPathArrayItemValue, bool) { 1361 res, ok := fpaivs.subPathItemValue.(ActivityLogEvent_FieldPathArrayItemValue) 1362 return res, ok 1363 } 1364 1365 // Contains returns a boolean indicating if value that is being held is present in given 'ActivityLog' 1366 func (fpaivs *ActivityLog_FieldSubPathArrayItemValue) ContainsValue(source *ActivityLog) bool { 1367 switch fpaivs.Selector() { 1368 case ActivityLog_FieldPathSelectorAuthentication: 1369 return fpaivs.subPathItemValue.(common.Authentication_FieldPathArrayItemValue).ContainsValue(source.GetAuthentication()) 1370 case ActivityLog_FieldPathSelectorAuthorization: 1371 return fpaivs.subPathItemValue.(common.Authorization_FieldPathArrayItemValue).ContainsValue(source.GetAuthorization()) 1372 case ActivityLog_FieldPathSelectorService: 1373 return fpaivs.subPathItemValue.(common.ServiceData_FieldPathArrayItemValue).ContainsValue(source.GetService()) 1374 case ActivityLog_FieldPathSelectorMethod: 1375 return fpaivs.subPathItemValue.(ActivityLogMethod_FieldPathArrayItemValue).ContainsValue(source.GetMethod()) 1376 case ActivityLog_FieldPathSelectorRequestMetadata: 1377 return fpaivs.subPathItemValue.(ActivityLogRequestMetadata_FieldPathArrayItemValue).ContainsValue(source.GetRequestMetadata()) 1378 case ActivityLog_FieldPathSelectorRequestRouting: 1379 return fpaivs.subPathItemValue.(ActivityLogRequestRouting_FieldPathArrayItemValue).ContainsValue(source.GetRequestRouting()) 1380 case ActivityLog_FieldPathSelectorResource: 1381 return fpaivs.subPathItemValue.(ActivityLogResource_FieldPathArrayItemValue).ContainsValue(source.GetResource()) 1382 case ActivityLog_FieldPathSelectorEvents: 1383 return false // repeated/map field 1384 default: 1385 panic(fmt.Sprintf("Invalid selector for ActivityLog: %d", fpaivs.Selector())) 1386 } 1387 } 1388 1389 // ActivityLog_FieldPathArrayOfValues allows storing slice of values for ActivityLog fields according to their type 1390 type ActivityLog_FieldPathArrayOfValues interface { 1391 gotenobject.FieldPathArrayOfValues 1392 ActivityLog_FieldPath 1393 } 1394 1395 func ParseActivityLog_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLog_FieldPathArrayOfValues, error) { 1396 fp, err := ParseActivityLog_FieldPath(pathStr) 1397 if err != nil { 1398 return nil, err 1399 } 1400 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 1401 if err != nil { 1402 return nil, status.Errorf(codes.InvalidArgument, "error parsing ActivityLog field path array of values from %s: %v", valuesStr, err) 1403 } 1404 return fpaov.(ActivityLog_FieldPathArrayOfValues), nil 1405 } 1406 1407 func MustParseActivityLog_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLog_FieldPathArrayOfValues { 1408 fpaov, err := ParseActivityLog_FieldPathArrayOfValues(pathStr, valuesStr) 1409 if err != nil { 1410 panic(err) 1411 } 1412 return fpaov 1413 } 1414 1415 type ActivityLog_FieldTerminalPathArrayOfValues struct { 1416 ActivityLog_FieldTerminalPath 1417 values interface{} 1418 } 1419 1420 var _ ActivityLog_FieldPathArrayOfValues = (*ActivityLog_FieldTerminalPathArrayOfValues)(nil) 1421 1422 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 1423 switch fpaov.selector { 1424 case ActivityLog_FieldPathSelectorName: 1425 for _, v := range fpaov.values.([]*Name) { 1426 values = append(values, v) 1427 } 1428 case ActivityLog_FieldPathSelectorScope: 1429 for _, v := range fpaov.values.([]string) { 1430 values = append(values, v) 1431 } 1432 case ActivityLog_FieldPathSelectorRequestId: 1433 for _, v := range fpaov.values.([]uint64) { 1434 values = append(values, v) 1435 } 1436 case ActivityLog_FieldPathSelectorAuthentication: 1437 for _, v := range fpaov.values.([]*common.Authentication) { 1438 values = append(values, v) 1439 } 1440 case ActivityLog_FieldPathSelectorAuthorization: 1441 for _, v := range fpaov.values.([]*common.Authorization) { 1442 values = append(values, v) 1443 } 1444 case ActivityLog_FieldPathSelectorService: 1445 for _, v := range fpaov.values.([]*common.ServiceData) { 1446 values = append(values, v) 1447 } 1448 case ActivityLog_FieldPathSelectorMethod: 1449 for _, v := range fpaov.values.([]*ActivityLog_Method) { 1450 values = append(values, v) 1451 } 1452 case ActivityLog_FieldPathSelectorRequestMetadata: 1453 for _, v := range fpaov.values.([]*ActivityLog_RequestMetadata) { 1454 values = append(values, v) 1455 } 1456 case ActivityLog_FieldPathSelectorRequestRouting: 1457 for _, v := range fpaov.values.([]*ActivityLog_RequestRouting) { 1458 values = append(values, v) 1459 } 1460 case ActivityLog_FieldPathSelectorResource: 1461 for _, v := range fpaov.values.([]*ActivityLog_Resource) { 1462 values = append(values, v) 1463 } 1464 case ActivityLog_FieldPathSelectorCategory: 1465 for _, v := range fpaov.values.([]ActivityLog_Category) { 1466 values = append(values, v) 1467 } 1468 case ActivityLog_FieldPathSelectorLabels: 1469 for _, v := range fpaov.values.([]map[string]string) { 1470 values = append(values, v) 1471 } 1472 case ActivityLog_FieldPathSelectorEvents: 1473 for _, v := range fpaov.values.([][]*ActivityLog_Event) { 1474 values = append(values, v) 1475 } 1476 } 1477 return 1478 } 1479 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]*Name, bool) { 1480 res, ok := fpaov.values.([]*Name) 1481 return res, ok 1482 } 1483 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsScopeArrayOfValues() ([]string, bool) { 1484 res, ok := fpaov.values.([]string) 1485 return res, ok 1486 } 1487 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsRequestIdArrayOfValues() ([]uint64, bool) { 1488 res, ok := fpaov.values.([]uint64) 1489 return res, ok 1490 } 1491 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsAuthenticationArrayOfValues() ([]*common.Authentication, bool) { 1492 res, ok := fpaov.values.([]*common.Authentication) 1493 return res, ok 1494 } 1495 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsAuthorizationArrayOfValues() ([]*common.Authorization, bool) { 1496 res, ok := fpaov.values.([]*common.Authorization) 1497 return res, ok 1498 } 1499 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsServiceArrayOfValues() ([]*common.ServiceData, bool) { 1500 res, ok := fpaov.values.([]*common.ServiceData) 1501 return res, ok 1502 } 1503 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsMethodArrayOfValues() ([]*ActivityLog_Method, bool) { 1504 res, ok := fpaov.values.([]*ActivityLog_Method) 1505 return res, ok 1506 } 1507 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsRequestMetadataArrayOfValues() ([]*ActivityLog_RequestMetadata, bool) { 1508 res, ok := fpaov.values.([]*ActivityLog_RequestMetadata) 1509 return res, ok 1510 } 1511 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsRequestRoutingArrayOfValues() ([]*ActivityLog_RequestRouting, bool) { 1512 res, ok := fpaov.values.([]*ActivityLog_RequestRouting) 1513 return res, ok 1514 } 1515 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsResourceArrayOfValues() ([]*ActivityLog_Resource, bool) { 1516 res, ok := fpaov.values.([]*ActivityLog_Resource) 1517 return res, ok 1518 } 1519 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsCategoryArrayOfValues() ([]ActivityLog_Category, bool) { 1520 res, ok := fpaov.values.([]ActivityLog_Category) 1521 return res, ok 1522 } 1523 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsLabelsArrayOfValues() ([]map[string]string, bool) { 1524 res, ok := fpaov.values.([]map[string]string) 1525 return res, ok 1526 } 1527 func (fpaov *ActivityLog_FieldTerminalPathArrayOfValues) AsEventsArrayOfValues() ([][]*ActivityLog_Event, bool) { 1528 res, ok := fpaov.values.([][]*ActivityLog_Event) 1529 return res, ok 1530 } 1531 1532 type ActivityLog_FieldPathMapArrayOfValues struct { 1533 ActivityLog_FieldPathMap 1534 values interface{} 1535 } 1536 1537 var _ ActivityLog_FieldPathArrayOfValues = (*ActivityLog_FieldPathMapArrayOfValues)(nil) 1538 1539 func (fpmaov *ActivityLog_FieldPathMapArrayOfValues) GetRawValues() (values []interface{}) { 1540 switch fpmaov.selector { 1541 case ActivityLog_FieldPathSelectorLabels: 1542 for _, v := range fpmaov.values.([]string) { 1543 values = append(values, v) 1544 } 1545 } 1546 return 1547 } 1548 func (fpmaov *ActivityLog_FieldPathMapArrayOfValues) AsLabelsArrayOfElementValues() ([]string, bool) { 1549 res, ok := fpmaov.values.([]string) 1550 return res, ok 1551 } 1552 1553 type ActivityLog_FieldSubPathArrayOfValues struct { 1554 ActivityLog_FieldPath 1555 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 1556 } 1557 1558 var _ ActivityLog_FieldPathArrayOfValues = (*ActivityLog_FieldSubPathArrayOfValues)(nil) 1559 1560 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 1561 return fpsaov.subPathArrayOfValues.GetRawValues() 1562 } 1563 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsAuthenticationPathArrayOfValues() (common.Authentication_FieldPathArrayOfValues, bool) { 1564 res, ok := fpsaov.subPathArrayOfValues.(common.Authentication_FieldPathArrayOfValues) 1565 return res, ok 1566 } 1567 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsAuthorizationPathArrayOfValues() (common.Authorization_FieldPathArrayOfValues, bool) { 1568 res, ok := fpsaov.subPathArrayOfValues.(common.Authorization_FieldPathArrayOfValues) 1569 return res, ok 1570 } 1571 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsServicePathArrayOfValues() (common.ServiceData_FieldPathArrayOfValues, bool) { 1572 res, ok := fpsaov.subPathArrayOfValues.(common.ServiceData_FieldPathArrayOfValues) 1573 return res, ok 1574 } 1575 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsMethodPathArrayOfValues() (ActivityLogMethod_FieldPathArrayOfValues, bool) { 1576 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogMethod_FieldPathArrayOfValues) 1577 return res, ok 1578 } 1579 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsRequestMetadataPathArrayOfValues() (ActivityLogRequestMetadata_FieldPathArrayOfValues, bool) { 1580 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogRequestMetadata_FieldPathArrayOfValues) 1581 return res, ok 1582 } 1583 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsRequestRoutingPathArrayOfValues() (ActivityLogRequestRouting_FieldPathArrayOfValues, bool) { 1584 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogRequestRouting_FieldPathArrayOfValues) 1585 return res, ok 1586 } 1587 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsResourcePathArrayOfValues() (ActivityLogResource_FieldPathArrayOfValues, bool) { 1588 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogResource_FieldPathArrayOfValues) 1589 return res, ok 1590 } 1591 func (fpsaov *ActivityLog_FieldSubPathArrayOfValues) AsEventsPathArrayOfValues() (ActivityLogEvent_FieldPathArrayOfValues, bool) { 1592 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogEvent_FieldPathArrayOfValues) 1593 return res, ok 1594 } 1595 1596 // FieldPath provides implementation to handle 1597 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 1598 type ActivityLogEvent_FieldPath interface { 1599 gotenobject.FieldPath 1600 Selector() ActivityLogEvent_FieldPathSelector 1601 Get(source *ActivityLog_Event) []interface{} 1602 GetSingle(source *ActivityLog_Event) (interface{}, bool) 1603 ClearValue(item *ActivityLog_Event) 1604 1605 // Those methods build corresponding ActivityLogEvent_FieldPathValue 1606 // (or array of values) and holds passed value. Panics if injected type is incorrect. 1607 WithIValue(value interface{}) ActivityLogEvent_FieldPathValue 1608 WithIArrayOfValues(values interface{}) ActivityLogEvent_FieldPathArrayOfValues 1609 WithIArrayItemValue(value interface{}) ActivityLogEvent_FieldPathArrayItemValue 1610 } 1611 1612 type ActivityLogEvent_FieldPathSelector int32 1613 1614 const ( 1615 ActivityLogEvent_FieldPathSelectorClientMessage ActivityLogEvent_FieldPathSelector = 0 1616 ActivityLogEvent_FieldPathSelectorServerMessage ActivityLogEvent_FieldPathSelector = 1 1617 ActivityLogEvent_FieldPathSelectorExit ActivityLogEvent_FieldPathSelector = 2 1618 ActivityLogEvent_FieldPathSelectorRegionalServerMessage ActivityLogEvent_FieldPathSelector = 3 1619 ActivityLogEvent_FieldPathSelectorRegionalExit ActivityLogEvent_FieldPathSelector = 4 1620 ) 1621 1622 func (s ActivityLogEvent_FieldPathSelector) String() string { 1623 switch s { 1624 case ActivityLogEvent_FieldPathSelectorClientMessage: 1625 return "client_message" 1626 case ActivityLogEvent_FieldPathSelectorServerMessage: 1627 return "server_message" 1628 case ActivityLogEvent_FieldPathSelectorExit: 1629 return "exit" 1630 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1631 return "regional_server_message" 1632 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1633 return "regional_exit" 1634 default: 1635 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", s)) 1636 } 1637 } 1638 1639 func BuildActivityLogEvent_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogEvent_FieldPath, error) { 1640 if len(fp) == 0 { 1641 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Event") 1642 } 1643 if len(fp) == 1 { 1644 switch fp[0] { 1645 case "client_message", "clientMessage", "client-message": 1646 return &ActivityLogEvent_FieldTerminalPath{selector: ActivityLogEvent_FieldPathSelectorClientMessage}, nil 1647 case "server_message", "serverMessage", "server-message": 1648 return &ActivityLogEvent_FieldTerminalPath{selector: ActivityLogEvent_FieldPathSelectorServerMessage}, nil 1649 case "exit": 1650 return &ActivityLogEvent_FieldTerminalPath{selector: ActivityLogEvent_FieldPathSelectorExit}, nil 1651 case "regional_server_message", "regionalServerMessage", "regional-server-message": 1652 return &ActivityLogEvent_FieldTerminalPath{selector: ActivityLogEvent_FieldPathSelectorRegionalServerMessage}, nil 1653 case "regional_exit", "regionalExit", "regional-exit": 1654 return &ActivityLogEvent_FieldTerminalPath{selector: ActivityLogEvent_FieldPathSelectorRegionalExit}, nil 1655 } 1656 } else { 1657 switch fp[0] { 1658 case "client_message", "clientMessage", "client-message": 1659 if subpath, err := BuildActivityLogEventClientMsgEvent_FieldPath(fp[1:]); err != nil { 1660 return nil, err 1661 } else { 1662 return &ActivityLogEvent_FieldSubPath{selector: ActivityLogEvent_FieldPathSelectorClientMessage, subPath: subpath}, nil 1663 } 1664 case "server_message", "serverMessage", "server-message": 1665 if subpath, err := BuildActivityLogEventServerMsgEvent_FieldPath(fp[1:]); err != nil { 1666 return nil, err 1667 } else { 1668 return &ActivityLogEvent_FieldSubPath{selector: ActivityLogEvent_FieldPathSelectorServerMessage, subPath: subpath}, nil 1669 } 1670 case "exit": 1671 if subpath, err := BuildActivityLogEventExitEvent_FieldPath(fp[1:]); err != nil { 1672 return nil, err 1673 } else { 1674 return &ActivityLogEvent_FieldSubPath{selector: ActivityLogEvent_FieldPathSelectorExit, subPath: subpath}, nil 1675 } 1676 case "regional_server_message", "regionalServerMessage", "regional-server-message": 1677 if subpath, err := BuildActivityLogEventRegionalServerMsgEvent_FieldPath(fp[1:]); err != nil { 1678 return nil, err 1679 } else { 1680 return &ActivityLogEvent_FieldSubPath{selector: ActivityLogEvent_FieldPathSelectorRegionalServerMessage, subPath: subpath}, nil 1681 } 1682 case "regional_exit", "regionalExit", "regional-exit": 1683 if subpath, err := BuildActivityLogEventRegionalServerMsgEvent_FieldPath(fp[1:]); err != nil { 1684 return nil, err 1685 } else { 1686 return &ActivityLogEvent_FieldSubPath{selector: ActivityLogEvent_FieldPathSelectorRegionalExit, subPath: subpath}, nil 1687 } 1688 } 1689 } 1690 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Event", fp) 1691 } 1692 1693 func ParseActivityLogEvent_FieldPath(rawField string) (ActivityLogEvent_FieldPath, error) { 1694 fp, err := gotenobject.ParseRawFieldPath(rawField) 1695 if err != nil { 1696 return nil, err 1697 } 1698 return BuildActivityLogEvent_FieldPath(fp) 1699 } 1700 1701 func MustParseActivityLogEvent_FieldPath(rawField string) ActivityLogEvent_FieldPath { 1702 fp, err := ParseActivityLogEvent_FieldPath(rawField) 1703 if err != nil { 1704 panic(err) 1705 } 1706 return fp 1707 } 1708 1709 type ActivityLogEvent_FieldTerminalPath struct { 1710 selector ActivityLogEvent_FieldPathSelector 1711 } 1712 1713 var _ ActivityLogEvent_FieldPath = (*ActivityLogEvent_FieldTerminalPath)(nil) 1714 1715 func (fp *ActivityLogEvent_FieldTerminalPath) Selector() ActivityLogEvent_FieldPathSelector { 1716 return fp.selector 1717 } 1718 1719 // String returns path representation in proto convention 1720 func (fp *ActivityLogEvent_FieldTerminalPath) String() string { 1721 return fp.selector.String() 1722 } 1723 1724 // JSONString returns path representation is JSON convention 1725 func (fp *ActivityLogEvent_FieldTerminalPath) JSONString() string { 1726 return strcase.ToLowerCamel(fp.String()) 1727 } 1728 1729 // Get returns all values pointed by specific field from source ActivityLog_Event 1730 func (fp *ActivityLogEvent_FieldTerminalPath) Get(source *ActivityLog_Event) (values []interface{}) { 1731 if source != nil { 1732 switch fp.selector { 1733 case ActivityLogEvent_FieldPathSelectorClientMessage: 1734 if source, ok := source.Evt.(*ActivityLog_Event_ClientMessage); ok && source != nil { 1735 if source.ClientMessage != nil { 1736 values = append(values, source.ClientMessage) 1737 } 1738 } 1739 case ActivityLogEvent_FieldPathSelectorServerMessage: 1740 if source, ok := source.Evt.(*ActivityLog_Event_ServerMessage); ok && source != nil { 1741 if source.ServerMessage != nil { 1742 values = append(values, source.ServerMessage) 1743 } 1744 } 1745 case ActivityLogEvent_FieldPathSelectorExit: 1746 if source, ok := source.Evt.(*ActivityLog_Event_Exit); ok && source != nil { 1747 if source.Exit != nil { 1748 values = append(values, source.Exit) 1749 } 1750 } 1751 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1752 if source, ok := source.Evt.(*ActivityLog_Event_RegionalServerMessage); ok && source != nil { 1753 if source.RegionalServerMessage != nil { 1754 values = append(values, source.RegionalServerMessage) 1755 } 1756 } 1757 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1758 if source, ok := source.Evt.(*ActivityLog_Event_RegionalExit); ok && source != nil { 1759 if source.RegionalExit != nil { 1760 values = append(values, source.RegionalExit) 1761 } 1762 } 1763 default: 1764 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1765 } 1766 } 1767 return 1768 } 1769 1770 func (fp *ActivityLogEvent_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 1771 return fp.Get(source.(*ActivityLog_Event)) 1772 } 1773 1774 // GetSingle returns value pointed by specific field of from source ActivityLog_Event 1775 func (fp *ActivityLogEvent_FieldTerminalPath) GetSingle(source *ActivityLog_Event) (interface{}, bool) { 1776 switch fp.selector { 1777 case ActivityLogEvent_FieldPathSelectorClientMessage: 1778 // if object nil or oneof not active, return "default" type with false flag. 1779 if source == nil { 1780 return source.GetClientMessage(), false 1781 } 1782 _, oneOfSelected := source.Evt.(*ActivityLog_Event_ClientMessage) 1783 if !oneOfSelected { 1784 return source.GetClientMessage(), false // to return "type" information 1785 } 1786 res := source.GetClientMessage() 1787 return res, res != nil 1788 case ActivityLogEvent_FieldPathSelectorServerMessage: 1789 // if object nil or oneof not active, return "default" type with false flag. 1790 if source == nil { 1791 return source.GetServerMessage(), false 1792 } 1793 _, oneOfSelected := source.Evt.(*ActivityLog_Event_ServerMessage) 1794 if !oneOfSelected { 1795 return source.GetServerMessage(), false // to return "type" information 1796 } 1797 res := source.GetServerMessage() 1798 return res, res != nil 1799 case ActivityLogEvent_FieldPathSelectorExit: 1800 // if object nil or oneof not active, return "default" type with false flag. 1801 if source == nil { 1802 return source.GetExit(), false 1803 } 1804 _, oneOfSelected := source.Evt.(*ActivityLog_Event_Exit) 1805 if !oneOfSelected { 1806 return source.GetExit(), false // to return "type" information 1807 } 1808 res := source.GetExit() 1809 return res, res != nil 1810 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1811 // if object nil or oneof not active, return "default" type with false flag. 1812 if source == nil { 1813 return source.GetRegionalServerMessage(), false 1814 } 1815 _, oneOfSelected := source.Evt.(*ActivityLog_Event_RegionalServerMessage) 1816 if !oneOfSelected { 1817 return source.GetRegionalServerMessage(), false // to return "type" information 1818 } 1819 res := source.GetRegionalServerMessage() 1820 return res, res != nil 1821 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1822 // if object nil or oneof not active, return "default" type with false flag. 1823 if source == nil { 1824 return source.GetRegionalExit(), false 1825 } 1826 _, oneOfSelected := source.Evt.(*ActivityLog_Event_RegionalExit) 1827 if !oneOfSelected { 1828 return source.GetRegionalExit(), false // to return "type" information 1829 } 1830 res := source.GetRegionalExit() 1831 return res, res != nil 1832 default: 1833 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1834 } 1835 } 1836 1837 func (fp *ActivityLogEvent_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 1838 return fp.GetSingle(source.(*ActivityLog_Event)) 1839 } 1840 1841 // GetDefault returns a default value of the field type 1842 func (fp *ActivityLogEvent_FieldTerminalPath) GetDefault() interface{} { 1843 switch fp.selector { 1844 case ActivityLogEvent_FieldPathSelectorClientMessage: 1845 return (*ActivityLog_Event_ClientMsgEvent)(nil) 1846 case ActivityLogEvent_FieldPathSelectorServerMessage: 1847 return (*ActivityLog_Event_ServerMsgEvent)(nil) 1848 case ActivityLogEvent_FieldPathSelectorExit: 1849 return (*ActivityLog_Event_ExitEvent)(nil) 1850 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1851 return (*ActivityLog_Event_RegionalServerMsgEvent)(nil) 1852 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1853 return (*ActivityLog_Event_RegionalServerMsgEvent)(nil) 1854 default: 1855 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1856 } 1857 } 1858 1859 func (fp *ActivityLogEvent_FieldTerminalPath) ClearValue(item *ActivityLog_Event) { 1860 if item != nil { 1861 switch fp.selector { 1862 case ActivityLogEvent_FieldPathSelectorClientMessage: 1863 if item, ok := item.Evt.(*ActivityLog_Event_ClientMessage); ok { 1864 item.ClientMessage = nil 1865 } 1866 case ActivityLogEvent_FieldPathSelectorServerMessage: 1867 if item, ok := item.Evt.(*ActivityLog_Event_ServerMessage); ok { 1868 item.ServerMessage = nil 1869 } 1870 case ActivityLogEvent_FieldPathSelectorExit: 1871 if item, ok := item.Evt.(*ActivityLog_Event_Exit); ok { 1872 item.Exit = nil 1873 } 1874 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1875 if item, ok := item.Evt.(*ActivityLog_Event_RegionalServerMessage); ok { 1876 item.RegionalServerMessage = nil 1877 } 1878 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1879 if item, ok := item.Evt.(*ActivityLog_Event_RegionalExit); ok { 1880 item.RegionalExit = nil 1881 } 1882 default: 1883 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1884 } 1885 } 1886 } 1887 1888 func (fp *ActivityLogEvent_FieldTerminalPath) ClearValueRaw(item proto.Message) { 1889 fp.ClearValue(item.(*ActivityLog_Event)) 1890 } 1891 1892 // IsLeaf - whether field path is holds simple value 1893 func (fp *ActivityLogEvent_FieldTerminalPath) IsLeaf() bool { 1894 return false 1895 } 1896 1897 func (fp *ActivityLogEvent_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 1898 return []gotenobject.FieldPath{fp} 1899 } 1900 1901 func (fp *ActivityLogEvent_FieldTerminalPath) WithIValue(value interface{}) ActivityLogEvent_FieldPathValue { 1902 switch fp.selector { 1903 case ActivityLogEvent_FieldPathSelectorClientMessage: 1904 return &ActivityLogEvent_FieldTerminalPathValue{ActivityLogEvent_FieldTerminalPath: *fp, value: value.(*ActivityLog_Event_ClientMsgEvent)} 1905 case ActivityLogEvent_FieldPathSelectorServerMessage: 1906 return &ActivityLogEvent_FieldTerminalPathValue{ActivityLogEvent_FieldTerminalPath: *fp, value: value.(*ActivityLog_Event_ServerMsgEvent)} 1907 case ActivityLogEvent_FieldPathSelectorExit: 1908 return &ActivityLogEvent_FieldTerminalPathValue{ActivityLogEvent_FieldTerminalPath: *fp, value: value.(*ActivityLog_Event_ExitEvent)} 1909 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1910 return &ActivityLogEvent_FieldTerminalPathValue{ActivityLogEvent_FieldTerminalPath: *fp, value: value.(*ActivityLog_Event_RegionalServerMsgEvent)} 1911 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1912 return &ActivityLogEvent_FieldTerminalPathValue{ActivityLogEvent_FieldTerminalPath: *fp, value: value.(*ActivityLog_Event_RegionalServerMsgEvent)} 1913 default: 1914 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1915 } 1916 } 1917 1918 func (fp *ActivityLogEvent_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 1919 return fp.WithIValue(value) 1920 } 1921 1922 func (fp *ActivityLogEvent_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogEvent_FieldPathArrayOfValues { 1923 fpaov := &ActivityLogEvent_FieldTerminalPathArrayOfValues{ActivityLogEvent_FieldTerminalPath: *fp} 1924 switch fp.selector { 1925 case ActivityLogEvent_FieldPathSelectorClientMessage: 1926 return &ActivityLogEvent_FieldTerminalPathArrayOfValues{ActivityLogEvent_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Event_ClientMsgEvent)} 1927 case ActivityLogEvent_FieldPathSelectorServerMessage: 1928 return &ActivityLogEvent_FieldTerminalPathArrayOfValues{ActivityLogEvent_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Event_ServerMsgEvent)} 1929 case ActivityLogEvent_FieldPathSelectorExit: 1930 return &ActivityLogEvent_FieldTerminalPathArrayOfValues{ActivityLogEvent_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Event_ExitEvent)} 1931 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 1932 return &ActivityLogEvent_FieldTerminalPathArrayOfValues{ActivityLogEvent_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Event_RegionalServerMsgEvent)} 1933 case ActivityLogEvent_FieldPathSelectorRegionalExit: 1934 return &ActivityLogEvent_FieldTerminalPathArrayOfValues{ActivityLogEvent_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Event_RegionalServerMsgEvent)} 1935 default: 1936 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1937 } 1938 return fpaov 1939 } 1940 1941 func (fp *ActivityLogEvent_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 1942 return fp.WithIArrayOfValues(values) 1943 } 1944 1945 func (fp *ActivityLogEvent_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogEvent_FieldPathArrayItemValue { 1946 switch fp.selector { 1947 default: 1948 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fp.selector)) 1949 } 1950 } 1951 1952 func (fp *ActivityLogEvent_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 1953 return fp.WithIArrayItemValue(value) 1954 } 1955 1956 type ActivityLogEvent_FieldSubPath struct { 1957 selector ActivityLogEvent_FieldPathSelector 1958 subPath gotenobject.FieldPath 1959 } 1960 1961 var _ ActivityLogEvent_FieldPath = (*ActivityLogEvent_FieldSubPath)(nil) 1962 1963 func (fps *ActivityLogEvent_FieldSubPath) Selector() ActivityLogEvent_FieldPathSelector { 1964 return fps.selector 1965 } 1966 func (fps *ActivityLogEvent_FieldSubPath) AsClientMessageSubPath() (ActivityLogEventClientMsgEvent_FieldPath, bool) { 1967 res, ok := fps.subPath.(ActivityLogEventClientMsgEvent_FieldPath) 1968 return res, ok 1969 } 1970 func (fps *ActivityLogEvent_FieldSubPath) AsServerMessageSubPath() (ActivityLogEventServerMsgEvent_FieldPath, bool) { 1971 res, ok := fps.subPath.(ActivityLogEventServerMsgEvent_FieldPath) 1972 return res, ok 1973 } 1974 func (fps *ActivityLogEvent_FieldSubPath) AsExitSubPath() (ActivityLogEventExitEvent_FieldPath, bool) { 1975 res, ok := fps.subPath.(ActivityLogEventExitEvent_FieldPath) 1976 return res, ok 1977 } 1978 func (fps *ActivityLogEvent_FieldSubPath) AsRegionalServerMessageSubPath() (ActivityLogEventRegionalServerMsgEvent_FieldPath, bool) { 1979 res, ok := fps.subPath.(ActivityLogEventRegionalServerMsgEvent_FieldPath) 1980 return res, ok 1981 } 1982 func (fps *ActivityLogEvent_FieldSubPath) AsRegionalExitSubPath() (ActivityLogEventRegionalServerMsgEvent_FieldPath, bool) { 1983 res, ok := fps.subPath.(ActivityLogEventRegionalServerMsgEvent_FieldPath) 1984 return res, ok 1985 } 1986 1987 // String returns path representation in proto convention 1988 func (fps *ActivityLogEvent_FieldSubPath) String() string { 1989 return fps.selector.String() + "." + fps.subPath.String() 1990 } 1991 1992 // JSONString returns path representation is JSON convention 1993 func (fps *ActivityLogEvent_FieldSubPath) JSONString() string { 1994 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 1995 } 1996 1997 // Get returns all values pointed by selected field from source ActivityLog_Event 1998 func (fps *ActivityLogEvent_FieldSubPath) Get(source *ActivityLog_Event) (values []interface{}) { 1999 switch fps.selector { 2000 case ActivityLogEvent_FieldPathSelectorClientMessage: 2001 values = append(values, fps.subPath.GetRaw(source.GetClientMessage())...) 2002 case ActivityLogEvent_FieldPathSelectorServerMessage: 2003 values = append(values, fps.subPath.GetRaw(source.GetServerMessage())...) 2004 case ActivityLogEvent_FieldPathSelectorExit: 2005 values = append(values, fps.subPath.GetRaw(source.GetExit())...) 2006 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2007 values = append(values, fps.subPath.GetRaw(source.GetRegionalServerMessage())...) 2008 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2009 values = append(values, fps.subPath.GetRaw(source.GetRegionalExit())...) 2010 default: 2011 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fps.selector)) 2012 } 2013 return 2014 } 2015 2016 func (fps *ActivityLogEvent_FieldSubPath) GetRaw(source proto.Message) []interface{} { 2017 return fps.Get(source.(*ActivityLog_Event)) 2018 } 2019 2020 // GetSingle returns value of selected field from source ActivityLog_Event 2021 func (fps *ActivityLogEvent_FieldSubPath) GetSingle(source *ActivityLog_Event) (interface{}, bool) { 2022 switch fps.selector { 2023 case ActivityLogEvent_FieldPathSelectorClientMessage: 2024 if source.GetClientMessage() == nil { 2025 return nil, false 2026 } 2027 return fps.subPath.GetSingleRaw(source.GetClientMessage()) 2028 case ActivityLogEvent_FieldPathSelectorServerMessage: 2029 if source.GetServerMessage() == nil { 2030 return nil, false 2031 } 2032 return fps.subPath.GetSingleRaw(source.GetServerMessage()) 2033 case ActivityLogEvent_FieldPathSelectorExit: 2034 if source.GetExit() == nil { 2035 return nil, false 2036 } 2037 return fps.subPath.GetSingleRaw(source.GetExit()) 2038 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2039 if source.GetRegionalServerMessage() == nil { 2040 return nil, false 2041 } 2042 return fps.subPath.GetSingleRaw(source.GetRegionalServerMessage()) 2043 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2044 if source.GetRegionalExit() == nil { 2045 return nil, false 2046 } 2047 return fps.subPath.GetSingleRaw(source.GetRegionalExit()) 2048 default: 2049 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fps.selector)) 2050 } 2051 } 2052 2053 func (fps *ActivityLogEvent_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 2054 return fps.GetSingle(source.(*ActivityLog_Event)) 2055 } 2056 2057 // GetDefault returns a default value of the field type 2058 func (fps *ActivityLogEvent_FieldSubPath) GetDefault() interface{} { 2059 return fps.subPath.GetDefault() 2060 } 2061 2062 func (fps *ActivityLogEvent_FieldSubPath) ClearValue(item *ActivityLog_Event) { 2063 if item != nil { 2064 switch fps.selector { 2065 case ActivityLogEvent_FieldPathSelectorClientMessage: 2066 if item.Evt != nil { 2067 if item, ok := item.Evt.(*ActivityLog_Event_ClientMessage); ok { 2068 fps.subPath.ClearValueRaw(item.ClientMessage) 2069 } 2070 } 2071 case ActivityLogEvent_FieldPathSelectorServerMessage: 2072 if item.Evt != nil { 2073 if item, ok := item.Evt.(*ActivityLog_Event_ServerMessage); ok { 2074 fps.subPath.ClearValueRaw(item.ServerMessage) 2075 } 2076 } 2077 case ActivityLogEvent_FieldPathSelectorExit: 2078 if item.Evt != nil { 2079 if item, ok := item.Evt.(*ActivityLog_Event_Exit); ok { 2080 fps.subPath.ClearValueRaw(item.Exit) 2081 } 2082 } 2083 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2084 if item.Evt != nil { 2085 if item, ok := item.Evt.(*ActivityLog_Event_RegionalServerMessage); ok { 2086 fps.subPath.ClearValueRaw(item.RegionalServerMessage) 2087 } 2088 } 2089 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2090 if item.Evt != nil { 2091 if item, ok := item.Evt.(*ActivityLog_Event_RegionalExit); ok { 2092 fps.subPath.ClearValueRaw(item.RegionalExit) 2093 } 2094 } 2095 default: 2096 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fps.selector)) 2097 } 2098 } 2099 } 2100 2101 func (fps *ActivityLogEvent_FieldSubPath) ClearValueRaw(item proto.Message) { 2102 fps.ClearValue(item.(*ActivityLog_Event)) 2103 } 2104 2105 // IsLeaf - whether field path is holds simple value 2106 func (fps *ActivityLogEvent_FieldSubPath) IsLeaf() bool { 2107 return fps.subPath.IsLeaf() 2108 } 2109 2110 func (fps *ActivityLogEvent_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 2111 iPaths := []gotenobject.FieldPath{&ActivityLogEvent_FieldTerminalPath{selector: fps.selector}} 2112 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 2113 return iPaths 2114 } 2115 2116 func (fps *ActivityLogEvent_FieldSubPath) WithIValue(value interface{}) ActivityLogEvent_FieldPathValue { 2117 return &ActivityLogEvent_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 2118 } 2119 2120 func (fps *ActivityLogEvent_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 2121 return fps.WithIValue(value) 2122 } 2123 2124 func (fps *ActivityLogEvent_FieldSubPath) WithIArrayOfValues(values interface{}) ActivityLogEvent_FieldPathArrayOfValues { 2125 return &ActivityLogEvent_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 2126 } 2127 2128 func (fps *ActivityLogEvent_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 2129 return fps.WithIArrayOfValues(values) 2130 } 2131 2132 func (fps *ActivityLogEvent_FieldSubPath) WithIArrayItemValue(value interface{}) ActivityLogEvent_FieldPathArrayItemValue { 2133 return &ActivityLogEvent_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 2134 } 2135 2136 func (fps *ActivityLogEvent_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 2137 return fps.WithIArrayItemValue(value) 2138 } 2139 2140 // ActivityLogEvent_FieldPathValue allows storing values for Event fields according to their type 2141 type ActivityLogEvent_FieldPathValue interface { 2142 ActivityLogEvent_FieldPath 2143 gotenobject.FieldPathValue 2144 SetTo(target **ActivityLog_Event) 2145 CompareWith(*ActivityLog_Event) (cmp int, comparable bool) 2146 } 2147 2148 func ParseActivityLogEvent_FieldPathValue(pathStr, valueStr string) (ActivityLogEvent_FieldPathValue, error) { 2149 fp, err := ParseActivityLogEvent_FieldPath(pathStr) 2150 if err != nil { 2151 return nil, err 2152 } 2153 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 2154 if err != nil { 2155 return nil, status.Errorf(codes.InvalidArgument, "error parsing Event field path value from %s: %v", valueStr, err) 2156 } 2157 return fpv.(ActivityLogEvent_FieldPathValue), nil 2158 } 2159 2160 func MustParseActivityLogEvent_FieldPathValue(pathStr, valueStr string) ActivityLogEvent_FieldPathValue { 2161 fpv, err := ParseActivityLogEvent_FieldPathValue(pathStr, valueStr) 2162 if err != nil { 2163 panic(err) 2164 } 2165 return fpv 2166 } 2167 2168 type ActivityLogEvent_FieldTerminalPathValue struct { 2169 ActivityLogEvent_FieldTerminalPath 2170 value interface{} 2171 } 2172 2173 var _ ActivityLogEvent_FieldPathValue = (*ActivityLogEvent_FieldTerminalPathValue)(nil) 2174 2175 // GetRawValue returns raw value stored under selected path for 'Event' as interface{} 2176 func (fpv *ActivityLogEvent_FieldTerminalPathValue) GetRawValue() interface{} { 2177 return fpv.value 2178 } 2179 func (fpv *ActivityLogEvent_FieldTerminalPathValue) AsClientMessageValue() (*ActivityLog_Event_ClientMsgEvent, bool) { 2180 res, ok := fpv.value.(*ActivityLog_Event_ClientMsgEvent) 2181 return res, ok 2182 } 2183 func (fpv *ActivityLogEvent_FieldTerminalPathValue) AsServerMessageValue() (*ActivityLog_Event_ServerMsgEvent, bool) { 2184 res, ok := fpv.value.(*ActivityLog_Event_ServerMsgEvent) 2185 return res, ok 2186 } 2187 func (fpv *ActivityLogEvent_FieldTerminalPathValue) AsExitValue() (*ActivityLog_Event_ExitEvent, bool) { 2188 res, ok := fpv.value.(*ActivityLog_Event_ExitEvent) 2189 return res, ok 2190 } 2191 func (fpv *ActivityLogEvent_FieldTerminalPathValue) AsRegionalServerMessageValue() (*ActivityLog_Event_RegionalServerMsgEvent, bool) { 2192 res, ok := fpv.value.(*ActivityLog_Event_RegionalServerMsgEvent) 2193 return res, ok 2194 } 2195 func (fpv *ActivityLogEvent_FieldTerminalPathValue) AsRegionalExitValue() (*ActivityLog_Event_RegionalServerMsgEvent, bool) { 2196 res, ok := fpv.value.(*ActivityLog_Event_RegionalServerMsgEvent) 2197 return res, ok 2198 } 2199 2200 // SetTo stores value for selected field for object Event 2201 func (fpv *ActivityLogEvent_FieldTerminalPathValue) SetTo(target **ActivityLog_Event) { 2202 if *target == nil { 2203 *target = new(ActivityLog_Event) 2204 } 2205 switch fpv.selector { 2206 case ActivityLogEvent_FieldPathSelectorClientMessage: 2207 if _, ok := (*target).Evt.(*ActivityLog_Event_ClientMessage); !ok { 2208 (*target).Evt = &ActivityLog_Event_ClientMessage{} 2209 } 2210 (*target).Evt.(*ActivityLog_Event_ClientMessage).ClientMessage = fpv.value.(*ActivityLog_Event_ClientMsgEvent) 2211 case ActivityLogEvent_FieldPathSelectorServerMessage: 2212 if _, ok := (*target).Evt.(*ActivityLog_Event_ServerMessage); !ok { 2213 (*target).Evt = &ActivityLog_Event_ServerMessage{} 2214 } 2215 (*target).Evt.(*ActivityLog_Event_ServerMessage).ServerMessage = fpv.value.(*ActivityLog_Event_ServerMsgEvent) 2216 case ActivityLogEvent_FieldPathSelectorExit: 2217 if _, ok := (*target).Evt.(*ActivityLog_Event_Exit); !ok { 2218 (*target).Evt = &ActivityLog_Event_Exit{} 2219 } 2220 (*target).Evt.(*ActivityLog_Event_Exit).Exit = fpv.value.(*ActivityLog_Event_ExitEvent) 2221 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2222 if _, ok := (*target).Evt.(*ActivityLog_Event_RegionalServerMessage); !ok { 2223 (*target).Evt = &ActivityLog_Event_RegionalServerMessage{} 2224 } 2225 (*target).Evt.(*ActivityLog_Event_RegionalServerMessage).RegionalServerMessage = fpv.value.(*ActivityLog_Event_RegionalServerMsgEvent) 2226 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2227 if _, ok := (*target).Evt.(*ActivityLog_Event_RegionalExit); !ok { 2228 (*target).Evt = &ActivityLog_Event_RegionalExit{} 2229 } 2230 (*target).Evt.(*ActivityLog_Event_RegionalExit).RegionalExit = fpv.value.(*ActivityLog_Event_RegionalServerMsgEvent) 2231 default: 2232 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fpv.selector)) 2233 } 2234 } 2235 2236 func (fpv *ActivityLogEvent_FieldTerminalPathValue) SetToRaw(target proto.Message) { 2237 typedObject := target.(*ActivityLog_Event) 2238 fpv.SetTo(&typedObject) 2239 } 2240 2241 // CompareWith compares value in the 'ActivityLogEvent_FieldTerminalPathValue' with the value under path in 'ActivityLog_Event'. 2242 func (fpv *ActivityLogEvent_FieldTerminalPathValue) CompareWith(source *ActivityLog_Event) (int, bool) { 2243 switch fpv.selector { 2244 case ActivityLogEvent_FieldPathSelectorClientMessage: 2245 return 0, false 2246 case ActivityLogEvent_FieldPathSelectorServerMessage: 2247 return 0, false 2248 case ActivityLogEvent_FieldPathSelectorExit: 2249 return 0, false 2250 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2251 return 0, false 2252 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2253 return 0, false 2254 default: 2255 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fpv.selector)) 2256 } 2257 } 2258 2259 func (fpv *ActivityLogEvent_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 2260 return fpv.CompareWith(source.(*ActivityLog_Event)) 2261 } 2262 2263 type ActivityLogEvent_FieldSubPathValue struct { 2264 ActivityLogEvent_FieldPath 2265 subPathValue gotenobject.FieldPathValue 2266 } 2267 2268 var _ ActivityLogEvent_FieldPathValue = (*ActivityLogEvent_FieldSubPathValue)(nil) 2269 2270 func (fpvs *ActivityLogEvent_FieldSubPathValue) AsClientMessagePathValue() (ActivityLogEventClientMsgEvent_FieldPathValue, bool) { 2271 res, ok := fpvs.subPathValue.(ActivityLogEventClientMsgEvent_FieldPathValue) 2272 return res, ok 2273 } 2274 func (fpvs *ActivityLogEvent_FieldSubPathValue) AsServerMessagePathValue() (ActivityLogEventServerMsgEvent_FieldPathValue, bool) { 2275 res, ok := fpvs.subPathValue.(ActivityLogEventServerMsgEvent_FieldPathValue) 2276 return res, ok 2277 } 2278 func (fpvs *ActivityLogEvent_FieldSubPathValue) AsExitPathValue() (ActivityLogEventExitEvent_FieldPathValue, bool) { 2279 res, ok := fpvs.subPathValue.(ActivityLogEventExitEvent_FieldPathValue) 2280 return res, ok 2281 } 2282 func (fpvs *ActivityLogEvent_FieldSubPathValue) AsRegionalServerMessagePathValue() (ActivityLogEventRegionalServerMsgEvent_FieldPathValue, bool) { 2283 res, ok := fpvs.subPathValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue) 2284 return res, ok 2285 } 2286 func (fpvs *ActivityLogEvent_FieldSubPathValue) AsRegionalExitPathValue() (ActivityLogEventRegionalServerMsgEvent_FieldPathValue, bool) { 2287 res, ok := fpvs.subPathValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue) 2288 return res, ok 2289 } 2290 2291 func (fpvs *ActivityLogEvent_FieldSubPathValue) SetTo(target **ActivityLog_Event) { 2292 if *target == nil { 2293 *target = new(ActivityLog_Event) 2294 } 2295 switch fpvs.Selector() { 2296 case ActivityLogEvent_FieldPathSelectorClientMessage: 2297 if _, ok := (*target).Evt.(*ActivityLog_Event_ClientMessage); !ok { 2298 (*target).Evt = &ActivityLog_Event_ClientMessage{} 2299 } 2300 fpvs.subPathValue.(ActivityLogEventClientMsgEvent_FieldPathValue).SetTo(&(*target).Evt.(*ActivityLog_Event_ClientMessage).ClientMessage) 2301 case ActivityLogEvent_FieldPathSelectorServerMessage: 2302 if _, ok := (*target).Evt.(*ActivityLog_Event_ServerMessage); !ok { 2303 (*target).Evt = &ActivityLog_Event_ServerMessage{} 2304 } 2305 fpvs.subPathValue.(ActivityLogEventServerMsgEvent_FieldPathValue).SetTo(&(*target).Evt.(*ActivityLog_Event_ServerMessage).ServerMessage) 2306 case ActivityLogEvent_FieldPathSelectorExit: 2307 if _, ok := (*target).Evt.(*ActivityLog_Event_Exit); !ok { 2308 (*target).Evt = &ActivityLog_Event_Exit{} 2309 } 2310 fpvs.subPathValue.(ActivityLogEventExitEvent_FieldPathValue).SetTo(&(*target).Evt.(*ActivityLog_Event_Exit).Exit) 2311 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2312 if _, ok := (*target).Evt.(*ActivityLog_Event_RegionalServerMessage); !ok { 2313 (*target).Evt = &ActivityLog_Event_RegionalServerMessage{} 2314 } 2315 fpvs.subPathValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue).SetTo(&(*target).Evt.(*ActivityLog_Event_RegionalServerMessage).RegionalServerMessage) 2316 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2317 if _, ok := (*target).Evt.(*ActivityLog_Event_RegionalExit); !ok { 2318 (*target).Evt = &ActivityLog_Event_RegionalExit{} 2319 } 2320 fpvs.subPathValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue).SetTo(&(*target).Evt.(*ActivityLog_Event_RegionalExit).RegionalExit) 2321 default: 2322 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fpvs.Selector())) 2323 } 2324 } 2325 2326 func (fpvs *ActivityLogEvent_FieldSubPathValue) SetToRaw(target proto.Message) { 2327 typedObject := target.(*ActivityLog_Event) 2328 fpvs.SetTo(&typedObject) 2329 } 2330 2331 func (fpvs *ActivityLogEvent_FieldSubPathValue) GetRawValue() interface{} { 2332 return fpvs.subPathValue.GetRawValue() 2333 } 2334 2335 func (fpvs *ActivityLogEvent_FieldSubPathValue) CompareWith(source *ActivityLog_Event) (int, bool) { 2336 switch fpvs.Selector() { 2337 case ActivityLogEvent_FieldPathSelectorClientMessage: 2338 return fpvs.subPathValue.(ActivityLogEventClientMsgEvent_FieldPathValue).CompareWith(source.GetClientMessage()) 2339 case ActivityLogEvent_FieldPathSelectorServerMessage: 2340 return fpvs.subPathValue.(ActivityLogEventServerMsgEvent_FieldPathValue).CompareWith(source.GetServerMessage()) 2341 case ActivityLogEvent_FieldPathSelectorExit: 2342 return fpvs.subPathValue.(ActivityLogEventExitEvent_FieldPathValue).CompareWith(source.GetExit()) 2343 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2344 return fpvs.subPathValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue).CompareWith(source.GetRegionalServerMessage()) 2345 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2346 return fpvs.subPathValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue).CompareWith(source.GetRegionalExit()) 2347 default: 2348 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fpvs.Selector())) 2349 } 2350 } 2351 2352 func (fpvs *ActivityLogEvent_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 2353 return fpvs.CompareWith(source.(*ActivityLog_Event)) 2354 } 2355 2356 // ActivityLogEvent_FieldPathArrayItemValue allows storing single item in Path-specific values for Event according to their type 2357 // Present only for array (repeated) types. 2358 type ActivityLogEvent_FieldPathArrayItemValue interface { 2359 gotenobject.FieldPathArrayItemValue 2360 ActivityLogEvent_FieldPath 2361 ContainsValue(*ActivityLog_Event) bool 2362 } 2363 2364 // ParseActivityLogEvent_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 2365 func ParseActivityLogEvent_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogEvent_FieldPathArrayItemValue, error) { 2366 fp, err := ParseActivityLogEvent_FieldPath(pathStr) 2367 if err != nil { 2368 return nil, err 2369 } 2370 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 2371 if err != nil { 2372 return nil, status.Errorf(codes.InvalidArgument, "error parsing Event field path array item value from %s: %v", valueStr, err) 2373 } 2374 return fpaiv.(ActivityLogEvent_FieldPathArrayItemValue), nil 2375 } 2376 2377 func MustParseActivityLogEvent_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogEvent_FieldPathArrayItemValue { 2378 fpaiv, err := ParseActivityLogEvent_FieldPathArrayItemValue(pathStr, valueStr) 2379 if err != nil { 2380 panic(err) 2381 } 2382 return fpaiv 2383 } 2384 2385 type ActivityLogEvent_FieldTerminalPathArrayItemValue struct { 2386 ActivityLogEvent_FieldTerminalPath 2387 value interface{} 2388 } 2389 2390 var _ ActivityLogEvent_FieldPathArrayItemValue = (*ActivityLogEvent_FieldTerminalPathArrayItemValue)(nil) 2391 2392 // GetRawValue returns stored element value for array in object ActivityLog_Event as interface{} 2393 func (fpaiv *ActivityLogEvent_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 2394 return fpaiv.value 2395 } 2396 2397 func (fpaiv *ActivityLogEvent_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Event) (interface{}, bool) { 2398 return nil, false 2399 } 2400 2401 func (fpaiv *ActivityLogEvent_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 2402 return fpaiv.GetSingle(source.(*ActivityLog_Event)) 2403 } 2404 2405 // Contains returns a boolean indicating if value that is being held is present in given 'Event' 2406 func (fpaiv *ActivityLogEvent_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Event) bool { 2407 slice := fpaiv.ActivityLogEvent_FieldTerminalPath.Get(source) 2408 for _, v := range slice { 2409 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 2410 if proto.Equal(asProtoMsg, v.(proto.Message)) { 2411 return true 2412 } 2413 } else if reflect.DeepEqual(v, fpaiv.value) { 2414 return true 2415 } 2416 } 2417 return false 2418 } 2419 2420 type ActivityLogEvent_FieldSubPathArrayItemValue struct { 2421 ActivityLogEvent_FieldPath 2422 subPathItemValue gotenobject.FieldPathArrayItemValue 2423 } 2424 2425 // GetRawValue returns stored array item value 2426 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 2427 return fpaivs.subPathItemValue.GetRawItemValue() 2428 } 2429 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) AsClientMessagePathItemValue() (ActivityLogEventClientMsgEvent_FieldPathArrayItemValue, bool) { 2430 res, ok := fpaivs.subPathItemValue.(ActivityLogEventClientMsgEvent_FieldPathArrayItemValue) 2431 return res, ok 2432 } 2433 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) AsServerMessagePathItemValue() (ActivityLogEventServerMsgEvent_FieldPathArrayItemValue, bool) { 2434 res, ok := fpaivs.subPathItemValue.(ActivityLogEventServerMsgEvent_FieldPathArrayItemValue) 2435 return res, ok 2436 } 2437 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) AsExitPathItemValue() (ActivityLogEventExitEvent_FieldPathArrayItemValue, bool) { 2438 res, ok := fpaivs.subPathItemValue.(ActivityLogEventExitEvent_FieldPathArrayItemValue) 2439 return res, ok 2440 } 2441 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) AsRegionalServerMessagePathItemValue() (ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue, bool) { 2442 res, ok := fpaivs.subPathItemValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue) 2443 return res, ok 2444 } 2445 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) AsRegionalExitPathItemValue() (ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue, bool) { 2446 res, ok := fpaivs.subPathItemValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue) 2447 return res, ok 2448 } 2449 2450 // Contains returns a boolean indicating if value that is being held is present in given 'Event' 2451 func (fpaivs *ActivityLogEvent_FieldSubPathArrayItemValue) ContainsValue(source *ActivityLog_Event) bool { 2452 switch fpaivs.Selector() { 2453 case ActivityLogEvent_FieldPathSelectorClientMessage: 2454 return fpaivs.subPathItemValue.(ActivityLogEventClientMsgEvent_FieldPathArrayItemValue).ContainsValue(source.GetClientMessage()) 2455 case ActivityLogEvent_FieldPathSelectorServerMessage: 2456 return fpaivs.subPathItemValue.(ActivityLogEventServerMsgEvent_FieldPathArrayItemValue).ContainsValue(source.GetServerMessage()) 2457 case ActivityLogEvent_FieldPathSelectorExit: 2458 return fpaivs.subPathItemValue.(ActivityLogEventExitEvent_FieldPathArrayItemValue).ContainsValue(source.GetExit()) 2459 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2460 return fpaivs.subPathItemValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue).ContainsValue(source.GetRegionalServerMessage()) 2461 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2462 return fpaivs.subPathItemValue.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue).ContainsValue(source.GetRegionalExit()) 2463 default: 2464 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event: %d", fpaivs.Selector())) 2465 } 2466 } 2467 2468 // ActivityLogEvent_FieldPathArrayOfValues allows storing slice of values for Event fields according to their type 2469 type ActivityLogEvent_FieldPathArrayOfValues interface { 2470 gotenobject.FieldPathArrayOfValues 2471 ActivityLogEvent_FieldPath 2472 } 2473 2474 func ParseActivityLogEvent_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogEvent_FieldPathArrayOfValues, error) { 2475 fp, err := ParseActivityLogEvent_FieldPath(pathStr) 2476 if err != nil { 2477 return nil, err 2478 } 2479 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 2480 if err != nil { 2481 return nil, status.Errorf(codes.InvalidArgument, "error parsing Event field path array of values from %s: %v", valuesStr, err) 2482 } 2483 return fpaov.(ActivityLogEvent_FieldPathArrayOfValues), nil 2484 } 2485 2486 func MustParseActivityLogEvent_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogEvent_FieldPathArrayOfValues { 2487 fpaov, err := ParseActivityLogEvent_FieldPathArrayOfValues(pathStr, valuesStr) 2488 if err != nil { 2489 panic(err) 2490 } 2491 return fpaov 2492 } 2493 2494 type ActivityLogEvent_FieldTerminalPathArrayOfValues struct { 2495 ActivityLogEvent_FieldTerminalPath 2496 values interface{} 2497 } 2498 2499 var _ ActivityLogEvent_FieldPathArrayOfValues = (*ActivityLogEvent_FieldTerminalPathArrayOfValues)(nil) 2500 2501 func (fpaov *ActivityLogEvent_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 2502 switch fpaov.selector { 2503 case ActivityLogEvent_FieldPathSelectorClientMessage: 2504 for _, v := range fpaov.values.([]*ActivityLog_Event_ClientMsgEvent) { 2505 values = append(values, v) 2506 } 2507 case ActivityLogEvent_FieldPathSelectorServerMessage: 2508 for _, v := range fpaov.values.([]*ActivityLog_Event_ServerMsgEvent) { 2509 values = append(values, v) 2510 } 2511 case ActivityLogEvent_FieldPathSelectorExit: 2512 for _, v := range fpaov.values.([]*ActivityLog_Event_ExitEvent) { 2513 values = append(values, v) 2514 } 2515 case ActivityLogEvent_FieldPathSelectorRegionalServerMessage: 2516 for _, v := range fpaov.values.([]*ActivityLog_Event_RegionalServerMsgEvent) { 2517 values = append(values, v) 2518 } 2519 case ActivityLogEvent_FieldPathSelectorRegionalExit: 2520 for _, v := range fpaov.values.([]*ActivityLog_Event_RegionalServerMsgEvent) { 2521 values = append(values, v) 2522 } 2523 } 2524 return 2525 } 2526 func (fpaov *ActivityLogEvent_FieldTerminalPathArrayOfValues) AsClientMessageArrayOfValues() ([]*ActivityLog_Event_ClientMsgEvent, bool) { 2527 res, ok := fpaov.values.([]*ActivityLog_Event_ClientMsgEvent) 2528 return res, ok 2529 } 2530 func (fpaov *ActivityLogEvent_FieldTerminalPathArrayOfValues) AsServerMessageArrayOfValues() ([]*ActivityLog_Event_ServerMsgEvent, bool) { 2531 res, ok := fpaov.values.([]*ActivityLog_Event_ServerMsgEvent) 2532 return res, ok 2533 } 2534 func (fpaov *ActivityLogEvent_FieldTerminalPathArrayOfValues) AsExitArrayOfValues() ([]*ActivityLog_Event_ExitEvent, bool) { 2535 res, ok := fpaov.values.([]*ActivityLog_Event_ExitEvent) 2536 return res, ok 2537 } 2538 func (fpaov *ActivityLogEvent_FieldTerminalPathArrayOfValues) AsRegionalServerMessageArrayOfValues() ([]*ActivityLog_Event_RegionalServerMsgEvent, bool) { 2539 res, ok := fpaov.values.([]*ActivityLog_Event_RegionalServerMsgEvent) 2540 return res, ok 2541 } 2542 func (fpaov *ActivityLogEvent_FieldTerminalPathArrayOfValues) AsRegionalExitArrayOfValues() ([]*ActivityLog_Event_RegionalServerMsgEvent, bool) { 2543 res, ok := fpaov.values.([]*ActivityLog_Event_RegionalServerMsgEvent) 2544 return res, ok 2545 } 2546 2547 type ActivityLogEvent_FieldSubPathArrayOfValues struct { 2548 ActivityLogEvent_FieldPath 2549 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 2550 } 2551 2552 var _ ActivityLogEvent_FieldPathArrayOfValues = (*ActivityLogEvent_FieldSubPathArrayOfValues)(nil) 2553 2554 func (fpsaov *ActivityLogEvent_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 2555 return fpsaov.subPathArrayOfValues.GetRawValues() 2556 } 2557 func (fpsaov *ActivityLogEvent_FieldSubPathArrayOfValues) AsClientMessagePathArrayOfValues() (ActivityLogEventClientMsgEvent_FieldPathArrayOfValues, bool) { 2558 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogEventClientMsgEvent_FieldPathArrayOfValues) 2559 return res, ok 2560 } 2561 func (fpsaov *ActivityLogEvent_FieldSubPathArrayOfValues) AsServerMessagePathArrayOfValues() (ActivityLogEventServerMsgEvent_FieldPathArrayOfValues, bool) { 2562 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogEventServerMsgEvent_FieldPathArrayOfValues) 2563 return res, ok 2564 } 2565 func (fpsaov *ActivityLogEvent_FieldSubPathArrayOfValues) AsExitPathArrayOfValues() (ActivityLogEventExitEvent_FieldPathArrayOfValues, bool) { 2566 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogEventExitEvent_FieldPathArrayOfValues) 2567 return res, ok 2568 } 2569 func (fpsaov *ActivityLogEvent_FieldSubPathArrayOfValues) AsRegionalServerMessagePathArrayOfValues() (ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues, bool) { 2570 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues) 2571 return res, ok 2572 } 2573 func (fpsaov *ActivityLogEvent_FieldSubPathArrayOfValues) AsRegionalExitPathArrayOfValues() (ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues, bool) { 2574 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues) 2575 return res, ok 2576 } 2577 2578 // FieldPath provides implementation to handle 2579 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 2580 type ActivityLogMethod_FieldPath interface { 2581 gotenobject.FieldPath 2582 Selector() ActivityLogMethod_FieldPathSelector 2583 Get(source *ActivityLog_Method) []interface{} 2584 GetSingle(source *ActivityLog_Method) (interface{}, bool) 2585 ClearValue(item *ActivityLog_Method) 2586 2587 // Those methods build corresponding ActivityLogMethod_FieldPathValue 2588 // (or array of values) and holds passed value. Panics if injected type is incorrect. 2589 WithIValue(value interface{}) ActivityLogMethod_FieldPathValue 2590 WithIArrayOfValues(values interface{}) ActivityLogMethod_FieldPathArrayOfValues 2591 WithIArrayItemValue(value interface{}) ActivityLogMethod_FieldPathArrayItemValue 2592 } 2593 2594 type ActivityLogMethod_FieldPathSelector int32 2595 2596 const ( 2597 ActivityLogMethod_FieldPathSelectorType ActivityLogMethod_FieldPathSelector = 0 2598 ActivityLogMethod_FieldPathSelectorVersion ActivityLogMethod_FieldPathSelector = 1 2599 ) 2600 2601 func (s ActivityLogMethod_FieldPathSelector) String() string { 2602 switch s { 2603 case ActivityLogMethod_FieldPathSelectorType: 2604 return "type" 2605 case ActivityLogMethod_FieldPathSelectorVersion: 2606 return "version" 2607 default: 2608 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", s)) 2609 } 2610 } 2611 2612 func BuildActivityLogMethod_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogMethod_FieldPath, error) { 2613 if len(fp) == 0 { 2614 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Method") 2615 } 2616 if len(fp) == 1 { 2617 switch fp[0] { 2618 case "type": 2619 return &ActivityLogMethod_FieldTerminalPath{selector: ActivityLogMethod_FieldPathSelectorType}, nil 2620 case "version": 2621 return &ActivityLogMethod_FieldTerminalPath{selector: ActivityLogMethod_FieldPathSelectorVersion}, nil 2622 } 2623 } 2624 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Method", fp) 2625 } 2626 2627 func ParseActivityLogMethod_FieldPath(rawField string) (ActivityLogMethod_FieldPath, error) { 2628 fp, err := gotenobject.ParseRawFieldPath(rawField) 2629 if err != nil { 2630 return nil, err 2631 } 2632 return BuildActivityLogMethod_FieldPath(fp) 2633 } 2634 2635 func MustParseActivityLogMethod_FieldPath(rawField string) ActivityLogMethod_FieldPath { 2636 fp, err := ParseActivityLogMethod_FieldPath(rawField) 2637 if err != nil { 2638 panic(err) 2639 } 2640 return fp 2641 } 2642 2643 type ActivityLogMethod_FieldTerminalPath struct { 2644 selector ActivityLogMethod_FieldPathSelector 2645 } 2646 2647 var _ ActivityLogMethod_FieldPath = (*ActivityLogMethod_FieldTerminalPath)(nil) 2648 2649 func (fp *ActivityLogMethod_FieldTerminalPath) Selector() ActivityLogMethod_FieldPathSelector { 2650 return fp.selector 2651 } 2652 2653 // String returns path representation in proto convention 2654 func (fp *ActivityLogMethod_FieldTerminalPath) String() string { 2655 return fp.selector.String() 2656 } 2657 2658 // JSONString returns path representation is JSON convention 2659 func (fp *ActivityLogMethod_FieldTerminalPath) JSONString() string { 2660 return strcase.ToLowerCamel(fp.String()) 2661 } 2662 2663 // Get returns all values pointed by specific field from source ActivityLog_Method 2664 func (fp *ActivityLogMethod_FieldTerminalPath) Get(source *ActivityLog_Method) (values []interface{}) { 2665 if source != nil { 2666 switch fp.selector { 2667 case ActivityLogMethod_FieldPathSelectorType: 2668 values = append(values, source.Type) 2669 case ActivityLogMethod_FieldPathSelectorVersion: 2670 values = append(values, source.Version) 2671 default: 2672 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2673 } 2674 } 2675 return 2676 } 2677 2678 func (fp *ActivityLogMethod_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 2679 return fp.Get(source.(*ActivityLog_Method)) 2680 } 2681 2682 // GetSingle returns value pointed by specific field of from source ActivityLog_Method 2683 func (fp *ActivityLogMethod_FieldTerminalPath) GetSingle(source *ActivityLog_Method) (interface{}, bool) { 2684 switch fp.selector { 2685 case ActivityLogMethod_FieldPathSelectorType: 2686 return source.GetType(), source != nil 2687 case ActivityLogMethod_FieldPathSelectorVersion: 2688 return source.GetVersion(), source != nil 2689 default: 2690 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2691 } 2692 } 2693 2694 func (fp *ActivityLogMethod_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 2695 return fp.GetSingle(source.(*ActivityLog_Method)) 2696 } 2697 2698 // GetDefault returns a default value of the field type 2699 func (fp *ActivityLogMethod_FieldTerminalPath) GetDefault() interface{} { 2700 switch fp.selector { 2701 case ActivityLogMethod_FieldPathSelectorType: 2702 return "" 2703 case ActivityLogMethod_FieldPathSelectorVersion: 2704 return "" 2705 default: 2706 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2707 } 2708 } 2709 2710 func (fp *ActivityLogMethod_FieldTerminalPath) ClearValue(item *ActivityLog_Method) { 2711 if item != nil { 2712 switch fp.selector { 2713 case ActivityLogMethod_FieldPathSelectorType: 2714 item.Type = "" 2715 case ActivityLogMethod_FieldPathSelectorVersion: 2716 item.Version = "" 2717 default: 2718 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2719 } 2720 } 2721 } 2722 2723 func (fp *ActivityLogMethod_FieldTerminalPath) ClearValueRaw(item proto.Message) { 2724 fp.ClearValue(item.(*ActivityLog_Method)) 2725 } 2726 2727 // IsLeaf - whether field path is holds simple value 2728 func (fp *ActivityLogMethod_FieldTerminalPath) IsLeaf() bool { 2729 return fp.selector == ActivityLogMethod_FieldPathSelectorType || 2730 fp.selector == ActivityLogMethod_FieldPathSelectorVersion 2731 } 2732 2733 func (fp *ActivityLogMethod_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 2734 return []gotenobject.FieldPath{fp} 2735 } 2736 2737 func (fp *ActivityLogMethod_FieldTerminalPath) WithIValue(value interface{}) ActivityLogMethod_FieldPathValue { 2738 switch fp.selector { 2739 case ActivityLogMethod_FieldPathSelectorType: 2740 return &ActivityLogMethod_FieldTerminalPathValue{ActivityLogMethod_FieldTerminalPath: *fp, value: value.(string)} 2741 case ActivityLogMethod_FieldPathSelectorVersion: 2742 return &ActivityLogMethod_FieldTerminalPathValue{ActivityLogMethod_FieldTerminalPath: *fp, value: value.(string)} 2743 default: 2744 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2745 } 2746 } 2747 2748 func (fp *ActivityLogMethod_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 2749 return fp.WithIValue(value) 2750 } 2751 2752 func (fp *ActivityLogMethod_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogMethod_FieldPathArrayOfValues { 2753 fpaov := &ActivityLogMethod_FieldTerminalPathArrayOfValues{ActivityLogMethod_FieldTerminalPath: *fp} 2754 switch fp.selector { 2755 case ActivityLogMethod_FieldPathSelectorType: 2756 return &ActivityLogMethod_FieldTerminalPathArrayOfValues{ActivityLogMethod_FieldTerminalPath: *fp, values: values.([]string)} 2757 case ActivityLogMethod_FieldPathSelectorVersion: 2758 return &ActivityLogMethod_FieldTerminalPathArrayOfValues{ActivityLogMethod_FieldTerminalPath: *fp, values: values.([]string)} 2759 default: 2760 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2761 } 2762 return fpaov 2763 } 2764 2765 func (fp *ActivityLogMethod_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 2766 return fp.WithIArrayOfValues(values) 2767 } 2768 2769 func (fp *ActivityLogMethod_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogMethod_FieldPathArrayItemValue { 2770 switch fp.selector { 2771 default: 2772 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fp.selector)) 2773 } 2774 } 2775 2776 func (fp *ActivityLogMethod_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 2777 return fp.WithIArrayItemValue(value) 2778 } 2779 2780 // ActivityLogMethod_FieldPathValue allows storing values for Method fields according to their type 2781 type ActivityLogMethod_FieldPathValue interface { 2782 ActivityLogMethod_FieldPath 2783 gotenobject.FieldPathValue 2784 SetTo(target **ActivityLog_Method) 2785 CompareWith(*ActivityLog_Method) (cmp int, comparable bool) 2786 } 2787 2788 func ParseActivityLogMethod_FieldPathValue(pathStr, valueStr string) (ActivityLogMethod_FieldPathValue, error) { 2789 fp, err := ParseActivityLogMethod_FieldPath(pathStr) 2790 if err != nil { 2791 return nil, err 2792 } 2793 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 2794 if err != nil { 2795 return nil, status.Errorf(codes.InvalidArgument, "error parsing Method field path value from %s: %v", valueStr, err) 2796 } 2797 return fpv.(ActivityLogMethod_FieldPathValue), nil 2798 } 2799 2800 func MustParseActivityLogMethod_FieldPathValue(pathStr, valueStr string) ActivityLogMethod_FieldPathValue { 2801 fpv, err := ParseActivityLogMethod_FieldPathValue(pathStr, valueStr) 2802 if err != nil { 2803 panic(err) 2804 } 2805 return fpv 2806 } 2807 2808 type ActivityLogMethod_FieldTerminalPathValue struct { 2809 ActivityLogMethod_FieldTerminalPath 2810 value interface{} 2811 } 2812 2813 var _ ActivityLogMethod_FieldPathValue = (*ActivityLogMethod_FieldTerminalPathValue)(nil) 2814 2815 // GetRawValue returns raw value stored under selected path for 'Method' as interface{} 2816 func (fpv *ActivityLogMethod_FieldTerminalPathValue) GetRawValue() interface{} { 2817 return fpv.value 2818 } 2819 func (fpv *ActivityLogMethod_FieldTerminalPathValue) AsTypeValue() (string, bool) { 2820 res, ok := fpv.value.(string) 2821 return res, ok 2822 } 2823 func (fpv *ActivityLogMethod_FieldTerminalPathValue) AsVersionValue() (string, bool) { 2824 res, ok := fpv.value.(string) 2825 return res, ok 2826 } 2827 2828 // SetTo stores value for selected field for object Method 2829 func (fpv *ActivityLogMethod_FieldTerminalPathValue) SetTo(target **ActivityLog_Method) { 2830 if *target == nil { 2831 *target = new(ActivityLog_Method) 2832 } 2833 switch fpv.selector { 2834 case ActivityLogMethod_FieldPathSelectorType: 2835 (*target).Type = fpv.value.(string) 2836 case ActivityLogMethod_FieldPathSelectorVersion: 2837 (*target).Version = fpv.value.(string) 2838 default: 2839 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fpv.selector)) 2840 } 2841 } 2842 2843 func (fpv *ActivityLogMethod_FieldTerminalPathValue) SetToRaw(target proto.Message) { 2844 typedObject := target.(*ActivityLog_Method) 2845 fpv.SetTo(&typedObject) 2846 } 2847 2848 // CompareWith compares value in the 'ActivityLogMethod_FieldTerminalPathValue' with the value under path in 'ActivityLog_Method'. 2849 func (fpv *ActivityLogMethod_FieldTerminalPathValue) CompareWith(source *ActivityLog_Method) (int, bool) { 2850 switch fpv.selector { 2851 case ActivityLogMethod_FieldPathSelectorType: 2852 leftValue := fpv.value.(string) 2853 rightValue := source.GetType() 2854 if (leftValue) == (rightValue) { 2855 return 0, true 2856 } else if (leftValue) < (rightValue) { 2857 return -1, true 2858 } else { 2859 return 1, true 2860 } 2861 case ActivityLogMethod_FieldPathSelectorVersion: 2862 leftValue := fpv.value.(string) 2863 rightValue := source.GetVersion() 2864 if (leftValue) == (rightValue) { 2865 return 0, true 2866 } else if (leftValue) < (rightValue) { 2867 return -1, true 2868 } else { 2869 return 1, true 2870 } 2871 default: 2872 panic(fmt.Sprintf("Invalid selector for ActivityLog_Method: %d", fpv.selector)) 2873 } 2874 } 2875 2876 func (fpv *ActivityLogMethod_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 2877 return fpv.CompareWith(source.(*ActivityLog_Method)) 2878 } 2879 2880 // ActivityLogMethod_FieldPathArrayItemValue allows storing single item in Path-specific values for Method according to their type 2881 // Present only for array (repeated) types. 2882 type ActivityLogMethod_FieldPathArrayItemValue interface { 2883 gotenobject.FieldPathArrayItemValue 2884 ActivityLogMethod_FieldPath 2885 ContainsValue(*ActivityLog_Method) bool 2886 } 2887 2888 // ParseActivityLogMethod_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 2889 func ParseActivityLogMethod_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogMethod_FieldPathArrayItemValue, error) { 2890 fp, err := ParseActivityLogMethod_FieldPath(pathStr) 2891 if err != nil { 2892 return nil, err 2893 } 2894 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 2895 if err != nil { 2896 return nil, status.Errorf(codes.InvalidArgument, "error parsing Method field path array item value from %s: %v", valueStr, err) 2897 } 2898 return fpaiv.(ActivityLogMethod_FieldPathArrayItemValue), nil 2899 } 2900 2901 func MustParseActivityLogMethod_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogMethod_FieldPathArrayItemValue { 2902 fpaiv, err := ParseActivityLogMethod_FieldPathArrayItemValue(pathStr, valueStr) 2903 if err != nil { 2904 panic(err) 2905 } 2906 return fpaiv 2907 } 2908 2909 type ActivityLogMethod_FieldTerminalPathArrayItemValue struct { 2910 ActivityLogMethod_FieldTerminalPath 2911 value interface{} 2912 } 2913 2914 var _ ActivityLogMethod_FieldPathArrayItemValue = (*ActivityLogMethod_FieldTerminalPathArrayItemValue)(nil) 2915 2916 // GetRawValue returns stored element value for array in object ActivityLog_Method as interface{} 2917 func (fpaiv *ActivityLogMethod_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 2918 return fpaiv.value 2919 } 2920 2921 func (fpaiv *ActivityLogMethod_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Method) (interface{}, bool) { 2922 return nil, false 2923 } 2924 2925 func (fpaiv *ActivityLogMethod_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 2926 return fpaiv.GetSingle(source.(*ActivityLog_Method)) 2927 } 2928 2929 // Contains returns a boolean indicating if value that is being held is present in given 'Method' 2930 func (fpaiv *ActivityLogMethod_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Method) bool { 2931 slice := fpaiv.ActivityLogMethod_FieldTerminalPath.Get(source) 2932 for _, v := range slice { 2933 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 2934 if proto.Equal(asProtoMsg, v.(proto.Message)) { 2935 return true 2936 } 2937 } else if reflect.DeepEqual(v, fpaiv.value) { 2938 return true 2939 } 2940 } 2941 return false 2942 } 2943 2944 // ActivityLogMethod_FieldPathArrayOfValues allows storing slice of values for Method fields according to their type 2945 type ActivityLogMethod_FieldPathArrayOfValues interface { 2946 gotenobject.FieldPathArrayOfValues 2947 ActivityLogMethod_FieldPath 2948 } 2949 2950 func ParseActivityLogMethod_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogMethod_FieldPathArrayOfValues, error) { 2951 fp, err := ParseActivityLogMethod_FieldPath(pathStr) 2952 if err != nil { 2953 return nil, err 2954 } 2955 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 2956 if err != nil { 2957 return nil, status.Errorf(codes.InvalidArgument, "error parsing Method field path array of values from %s: %v", valuesStr, err) 2958 } 2959 return fpaov.(ActivityLogMethod_FieldPathArrayOfValues), nil 2960 } 2961 2962 func MustParseActivityLogMethod_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogMethod_FieldPathArrayOfValues { 2963 fpaov, err := ParseActivityLogMethod_FieldPathArrayOfValues(pathStr, valuesStr) 2964 if err != nil { 2965 panic(err) 2966 } 2967 return fpaov 2968 } 2969 2970 type ActivityLogMethod_FieldTerminalPathArrayOfValues struct { 2971 ActivityLogMethod_FieldTerminalPath 2972 values interface{} 2973 } 2974 2975 var _ ActivityLogMethod_FieldPathArrayOfValues = (*ActivityLogMethod_FieldTerminalPathArrayOfValues)(nil) 2976 2977 func (fpaov *ActivityLogMethod_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 2978 switch fpaov.selector { 2979 case ActivityLogMethod_FieldPathSelectorType: 2980 for _, v := range fpaov.values.([]string) { 2981 values = append(values, v) 2982 } 2983 case ActivityLogMethod_FieldPathSelectorVersion: 2984 for _, v := range fpaov.values.([]string) { 2985 values = append(values, v) 2986 } 2987 } 2988 return 2989 } 2990 func (fpaov *ActivityLogMethod_FieldTerminalPathArrayOfValues) AsTypeArrayOfValues() ([]string, bool) { 2991 res, ok := fpaov.values.([]string) 2992 return res, ok 2993 } 2994 func (fpaov *ActivityLogMethod_FieldTerminalPathArrayOfValues) AsVersionArrayOfValues() ([]string, bool) { 2995 res, ok := fpaov.values.([]string) 2996 return res, ok 2997 } 2998 2999 // FieldPath provides implementation to handle 3000 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 3001 type ActivityLogRequestMetadata_FieldPath interface { 3002 gotenobject.FieldPath 3003 Selector() ActivityLogRequestMetadata_FieldPathSelector 3004 Get(source *ActivityLog_RequestMetadata) []interface{} 3005 GetSingle(source *ActivityLog_RequestMetadata) (interface{}, bool) 3006 ClearValue(item *ActivityLog_RequestMetadata) 3007 3008 // Those methods build corresponding ActivityLogRequestMetadata_FieldPathValue 3009 // (or array of values) and holds passed value. Panics if injected type is incorrect. 3010 WithIValue(value interface{}) ActivityLogRequestMetadata_FieldPathValue 3011 WithIArrayOfValues(values interface{}) ActivityLogRequestMetadata_FieldPathArrayOfValues 3012 WithIArrayItemValue(value interface{}) ActivityLogRequestMetadata_FieldPathArrayItemValue 3013 } 3014 3015 type ActivityLogRequestMetadata_FieldPathSelector int32 3016 3017 const ( 3018 ActivityLogRequestMetadata_FieldPathSelectorIpAddress ActivityLogRequestMetadata_FieldPathSelector = 0 3019 ActivityLogRequestMetadata_FieldPathSelectorUserAgent ActivityLogRequestMetadata_FieldPathSelector = 1 3020 ) 3021 3022 func (s ActivityLogRequestMetadata_FieldPathSelector) String() string { 3023 switch s { 3024 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3025 return "ip_address" 3026 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3027 return "user_agent" 3028 default: 3029 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", s)) 3030 } 3031 } 3032 3033 func BuildActivityLogRequestMetadata_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogRequestMetadata_FieldPath, error) { 3034 if len(fp) == 0 { 3035 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_RequestMetadata") 3036 } 3037 if len(fp) == 1 { 3038 switch fp[0] { 3039 case "ip_address", "ipAddress", "ip-address": 3040 return &ActivityLogRequestMetadata_FieldTerminalPath{selector: ActivityLogRequestMetadata_FieldPathSelectorIpAddress}, nil 3041 case "user_agent", "userAgent", "user-agent": 3042 return &ActivityLogRequestMetadata_FieldTerminalPath{selector: ActivityLogRequestMetadata_FieldPathSelectorUserAgent}, nil 3043 } 3044 } 3045 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_RequestMetadata", fp) 3046 } 3047 3048 func ParseActivityLogRequestMetadata_FieldPath(rawField string) (ActivityLogRequestMetadata_FieldPath, error) { 3049 fp, err := gotenobject.ParseRawFieldPath(rawField) 3050 if err != nil { 3051 return nil, err 3052 } 3053 return BuildActivityLogRequestMetadata_FieldPath(fp) 3054 } 3055 3056 func MustParseActivityLogRequestMetadata_FieldPath(rawField string) ActivityLogRequestMetadata_FieldPath { 3057 fp, err := ParseActivityLogRequestMetadata_FieldPath(rawField) 3058 if err != nil { 3059 panic(err) 3060 } 3061 return fp 3062 } 3063 3064 type ActivityLogRequestMetadata_FieldTerminalPath struct { 3065 selector ActivityLogRequestMetadata_FieldPathSelector 3066 } 3067 3068 var _ ActivityLogRequestMetadata_FieldPath = (*ActivityLogRequestMetadata_FieldTerminalPath)(nil) 3069 3070 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) Selector() ActivityLogRequestMetadata_FieldPathSelector { 3071 return fp.selector 3072 } 3073 3074 // String returns path representation in proto convention 3075 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) String() string { 3076 return fp.selector.String() 3077 } 3078 3079 // JSONString returns path representation is JSON convention 3080 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) JSONString() string { 3081 return strcase.ToLowerCamel(fp.String()) 3082 } 3083 3084 // Get returns all values pointed by specific field from source ActivityLog_RequestMetadata 3085 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) Get(source *ActivityLog_RequestMetadata) (values []interface{}) { 3086 if source != nil { 3087 switch fp.selector { 3088 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3089 values = append(values, source.IpAddress) 3090 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3091 values = append(values, source.UserAgent) 3092 default: 3093 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3094 } 3095 } 3096 return 3097 } 3098 3099 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 3100 return fp.Get(source.(*ActivityLog_RequestMetadata)) 3101 } 3102 3103 // GetSingle returns value pointed by specific field of from source ActivityLog_RequestMetadata 3104 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) GetSingle(source *ActivityLog_RequestMetadata) (interface{}, bool) { 3105 switch fp.selector { 3106 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3107 return source.GetIpAddress(), source != nil 3108 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3109 return source.GetUserAgent(), source != nil 3110 default: 3111 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3112 } 3113 } 3114 3115 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3116 return fp.GetSingle(source.(*ActivityLog_RequestMetadata)) 3117 } 3118 3119 // GetDefault returns a default value of the field type 3120 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) GetDefault() interface{} { 3121 switch fp.selector { 3122 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3123 return "" 3124 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3125 return "" 3126 default: 3127 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3128 } 3129 } 3130 3131 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) ClearValue(item *ActivityLog_RequestMetadata) { 3132 if item != nil { 3133 switch fp.selector { 3134 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3135 item.IpAddress = "" 3136 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3137 item.UserAgent = "" 3138 default: 3139 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3140 } 3141 } 3142 } 3143 3144 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) ClearValueRaw(item proto.Message) { 3145 fp.ClearValue(item.(*ActivityLog_RequestMetadata)) 3146 } 3147 3148 // IsLeaf - whether field path is holds simple value 3149 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) IsLeaf() bool { 3150 return fp.selector == ActivityLogRequestMetadata_FieldPathSelectorIpAddress || 3151 fp.selector == ActivityLogRequestMetadata_FieldPathSelectorUserAgent 3152 } 3153 3154 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3155 return []gotenobject.FieldPath{fp} 3156 } 3157 3158 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) WithIValue(value interface{}) ActivityLogRequestMetadata_FieldPathValue { 3159 switch fp.selector { 3160 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3161 return &ActivityLogRequestMetadata_FieldTerminalPathValue{ActivityLogRequestMetadata_FieldTerminalPath: *fp, value: value.(string)} 3162 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3163 return &ActivityLogRequestMetadata_FieldTerminalPathValue{ActivityLogRequestMetadata_FieldTerminalPath: *fp, value: value.(string)} 3164 default: 3165 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3166 } 3167 } 3168 3169 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3170 return fp.WithIValue(value) 3171 } 3172 3173 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogRequestMetadata_FieldPathArrayOfValues { 3174 fpaov := &ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues{ActivityLogRequestMetadata_FieldTerminalPath: *fp} 3175 switch fp.selector { 3176 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3177 return &ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues{ActivityLogRequestMetadata_FieldTerminalPath: *fp, values: values.([]string)} 3178 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3179 return &ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues{ActivityLogRequestMetadata_FieldTerminalPath: *fp, values: values.([]string)} 3180 default: 3181 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3182 } 3183 return fpaov 3184 } 3185 3186 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3187 return fp.WithIArrayOfValues(values) 3188 } 3189 3190 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogRequestMetadata_FieldPathArrayItemValue { 3191 switch fp.selector { 3192 default: 3193 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fp.selector)) 3194 } 3195 } 3196 3197 func (fp *ActivityLogRequestMetadata_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3198 return fp.WithIArrayItemValue(value) 3199 } 3200 3201 // ActivityLogRequestMetadata_FieldPathValue allows storing values for RequestMetadata fields according to their type 3202 type ActivityLogRequestMetadata_FieldPathValue interface { 3203 ActivityLogRequestMetadata_FieldPath 3204 gotenobject.FieldPathValue 3205 SetTo(target **ActivityLog_RequestMetadata) 3206 CompareWith(*ActivityLog_RequestMetadata) (cmp int, comparable bool) 3207 } 3208 3209 func ParseActivityLogRequestMetadata_FieldPathValue(pathStr, valueStr string) (ActivityLogRequestMetadata_FieldPathValue, error) { 3210 fp, err := ParseActivityLogRequestMetadata_FieldPath(pathStr) 3211 if err != nil { 3212 return nil, err 3213 } 3214 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 3215 if err != nil { 3216 return nil, status.Errorf(codes.InvalidArgument, "error parsing RequestMetadata field path value from %s: %v", valueStr, err) 3217 } 3218 return fpv.(ActivityLogRequestMetadata_FieldPathValue), nil 3219 } 3220 3221 func MustParseActivityLogRequestMetadata_FieldPathValue(pathStr, valueStr string) ActivityLogRequestMetadata_FieldPathValue { 3222 fpv, err := ParseActivityLogRequestMetadata_FieldPathValue(pathStr, valueStr) 3223 if err != nil { 3224 panic(err) 3225 } 3226 return fpv 3227 } 3228 3229 type ActivityLogRequestMetadata_FieldTerminalPathValue struct { 3230 ActivityLogRequestMetadata_FieldTerminalPath 3231 value interface{} 3232 } 3233 3234 var _ ActivityLogRequestMetadata_FieldPathValue = (*ActivityLogRequestMetadata_FieldTerminalPathValue)(nil) 3235 3236 // GetRawValue returns raw value stored under selected path for 'RequestMetadata' as interface{} 3237 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) GetRawValue() interface{} { 3238 return fpv.value 3239 } 3240 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) AsIpAddressValue() (string, bool) { 3241 res, ok := fpv.value.(string) 3242 return res, ok 3243 } 3244 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) AsUserAgentValue() (string, bool) { 3245 res, ok := fpv.value.(string) 3246 return res, ok 3247 } 3248 3249 // SetTo stores value for selected field for object RequestMetadata 3250 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) SetTo(target **ActivityLog_RequestMetadata) { 3251 if *target == nil { 3252 *target = new(ActivityLog_RequestMetadata) 3253 } 3254 switch fpv.selector { 3255 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3256 (*target).IpAddress = fpv.value.(string) 3257 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3258 (*target).UserAgent = fpv.value.(string) 3259 default: 3260 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fpv.selector)) 3261 } 3262 } 3263 3264 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) SetToRaw(target proto.Message) { 3265 typedObject := target.(*ActivityLog_RequestMetadata) 3266 fpv.SetTo(&typedObject) 3267 } 3268 3269 // CompareWith compares value in the 'ActivityLogRequestMetadata_FieldTerminalPathValue' with the value under path in 'ActivityLog_RequestMetadata'. 3270 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) CompareWith(source *ActivityLog_RequestMetadata) (int, bool) { 3271 switch fpv.selector { 3272 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3273 leftValue := fpv.value.(string) 3274 rightValue := source.GetIpAddress() 3275 if (leftValue) == (rightValue) { 3276 return 0, true 3277 } else if (leftValue) < (rightValue) { 3278 return -1, true 3279 } else { 3280 return 1, true 3281 } 3282 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3283 leftValue := fpv.value.(string) 3284 rightValue := source.GetUserAgent() 3285 if (leftValue) == (rightValue) { 3286 return 0, true 3287 } else if (leftValue) < (rightValue) { 3288 return -1, true 3289 } else { 3290 return 1, true 3291 } 3292 default: 3293 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestMetadata: %d", fpv.selector)) 3294 } 3295 } 3296 3297 func (fpv *ActivityLogRequestMetadata_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3298 return fpv.CompareWith(source.(*ActivityLog_RequestMetadata)) 3299 } 3300 3301 // ActivityLogRequestMetadata_FieldPathArrayItemValue allows storing single item in Path-specific values for RequestMetadata according to their type 3302 // Present only for array (repeated) types. 3303 type ActivityLogRequestMetadata_FieldPathArrayItemValue interface { 3304 gotenobject.FieldPathArrayItemValue 3305 ActivityLogRequestMetadata_FieldPath 3306 ContainsValue(*ActivityLog_RequestMetadata) bool 3307 } 3308 3309 // ParseActivityLogRequestMetadata_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 3310 func ParseActivityLogRequestMetadata_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogRequestMetadata_FieldPathArrayItemValue, error) { 3311 fp, err := ParseActivityLogRequestMetadata_FieldPath(pathStr) 3312 if err != nil { 3313 return nil, err 3314 } 3315 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 3316 if err != nil { 3317 return nil, status.Errorf(codes.InvalidArgument, "error parsing RequestMetadata field path array item value from %s: %v", valueStr, err) 3318 } 3319 return fpaiv.(ActivityLogRequestMetadata_FieldPathArrayItemValue), nil 3320 } 3321 3322 func MustParseActivityLogRequestMetadata_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogRequestMetadata_FieldPathArrayItemValue { 3323 fpaiv, err := ParseActivityLogRequestMetadata_FieldPathArrayItemValue(pathStr, valueStr) 3324 if err != nil { 3325 panic(err) 3326 } 3327 return fpaiv 3328 } 3329 3330 type ActivityLogRequestMetadata_FieldTerminalPathArrayItemValue struct { 3331 ActivityLogRequestMetadata_FieldTerminalPath 3332 value interface{} 3333 } 3334 3335 var _ ActivityLogRequestMetadata_FieldPathArrayItemValue = (*ActivityLogRequestMetadata_FieldTerminalPathArrayItemValue)(nil) 3336 3337 // GetRawValue returns stored element value for array in object ActivityLog_RequestMetadata as interface{} 3338 func (fpaiv *ActivityLogRequestMetadata_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 3339 return fpaiv.value 3340 } 3341 3342 func (fpaiv *ActivityLogRequestMetadata_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_RequestMetadata) (interface{}, bool) { 3343 return nil, false 3344 } 3345 3346 func (fpaiv *ActivityLogRequestMetadata_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 3347 return fpaiv.GetSingle(source.(*ActivityLog_RequestMetadata)) 3348 } 3349 3350 // Contains returns a boolean indicating if value that is being held is present in given 'RequestMetadata' 3351 func (fpaiv *ActivityLogRequestMetadata_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_RequestMetadata) bool { 3352 slice := fpaiv.ActivityLogRequestMetadata_FieldTerminalPath.Get(source) 3353 for _, v := range slice { 3354 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 3355 if proto.Equal(asProtoMsg, v.(proto.Message)) { 3356 return true 3357 } 3358 } else if reflect.DeepEqual(v, fpaiv.value) { 3359 return true 3360 } 3361 } 3362 return false 3363 } 3364 3365 // ActivityLogRequestMetadata_FieldPathArrayOfValues allows storing slice of values for RequestMetadata fields according to their type 3366 type ActivityLogRequestMetadata_FieldPathArrayOfValues interface { 3367 gotenobject.FieldPathArrayOfValues 3368 ActivityLogRequestMetadata_FieldPath 3369 } 3370 3371 func ParseActivityLogRequestMetadata_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogRequestMetadata_FieldPathArrayOfValues, error) { 3372 fp, err := ParseActivityLogRequestMetadata_FieldPath(pathStr) 3373 if err != nil { 3374 return nil, err 3375 } 3376 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 3377 if err != nil { 3378 return nil, status.Errorf(codes.InvalidArgument, "error parsing RequestMetadata field path array of values from %s: %v", valuesStr, err) 3379 } 3380 return fpaov.(ActivityLogRequestMetadata_FieldPathArrayOfValues), nil 3381 } 3382 3383 func MustParseActivityLogRequestMetadata_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogRequestMetadata_FieldPathArrayOfValues { 3384 fpaov, err := ParseActivityLogRequestMetadata_FieldPathArrayOfValues(pathStr, valuesStr) 3385 if err != nil { 3386 panic(err) 3387 } 3388 return fpaov 3389 } 3390 3391 type ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues struct { 3392 ActivityLogRequestMetadata_FieldTerminalPath 3393 values interface{} 3394 } 3395 3396 var _ ActivityLogRequestMetadata_FieldPathArrayOfValues = (*ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues)(nil) 3397 3398 func (fpaov *ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 3399 switch fpaov.selector { 3400 case ActivityLogRequestMetadata_FieldPathSelectorIpAddress: 3401 for _, v := range fpaov.values.([]string) { 3402 values = append(values, v) 3403 } 3404 case ActivityLogRequestMetadata_FieldPathSelectorUserAgent: 3405 for _, v := range fpaov.values.([]string) { 3406 values = append(values, v) 3407 } 3408 } 3409 return 3410 } 3411 func (fpaov *ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues) AsIpAddressArrayOfValues() ([]string, bool) { 3412 res, ok := fpaov.values.([]string) 3413 return res, ok 3414 } 3415 func (fpaov *ActivityLogRequestMetadata_FieldTerminalPathArrayOfValues) AsUserAgentArrayOfValues() ([]string, bool) { 3416 res, ok := fpaov.values.([]string) 3417 return res, ok 3418 } 3419 3420 // FieldPath provides implementation to handle 3421 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 3422 type ActivityLogRequestRouting_FieldPath interface { 3423 gotenobject.FieldPath 3424 Selector() ActivityLogRequestRouting_FieldPathSelector 3425 Get(source *ActivityLog_RequestRouting) []interface{} 3426 GetSingle(source *ActivityLog_RequestRouting) (interface{}, bool) 3427 ClearValue(item *ActivityLog_RequestRouting) 3428 3429 // Those methods build corresponding ActivityLogRequestRouting_FieldPathValue 3430 // (or array of values) and holds passed value. Panics if injected type is incorrect. 3431 WithIValue(value interface{}) ActivityLogRequestRouting_FieldPathValue 3432 WithIArrayOfValues(values interface{}) ActivityLogRequestRouting_FieldPathArrayOfValues 3433 WithIArrayItemValue(value interface{}) ActivityLogRequestRouting_FieldPathArrayItemValue 3434 } 3435 3436 type ActivityLogRequestRouting_FieldPathSelector int32 3437 3438 const ( 3439 ActivityLogRequestRouting_FieldPathSelectorViaRegion ActivityLogRequestRouting_FieldPathSelector = 0 3440 ActivityLogRequestRouting_FieldPathSelectorDestRegions ActivityLogRequestRouting_FieldPathSelector = 1 3441 ) 3442 3443 func (s ActivityLogRequestRouting_FieldPathSelector) String() string { 3444 switch s { 3445 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3446 return "via_region" 3447 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3448 return "dest_regions" 3449 default: 3450 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", s)) 3451 } 3452 } 3453 3454 func BuildActivityLogRequestRouting_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogRequestRouting_FieldPath, error) { 3455 if len(fp) == 0 { 3456 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_RequestRouting") 3457 } 3458 if len(fp) == 1 { 3459 switch fp[0] { 3460 case "via_region", "viaRegion", "via-region": 3461 return &ActivityLogRequestRouting_FieldTerminalPath{selector: ActivityLogRequestRouting_FieldPathSelectorViaRegion}, nil 3462 case "dest_regions", "destRegions", "dest-regions": 3463 return &ActivityLogRequestRouting_FieldTerminalPath{selector: ActivityLogRequestRouting_FieldPathSelectorDestRegions}, nil 3464 } 3465 } 3466 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_RequestRouting", fp) 3467 } 3468 3469 func ParseActivityLogRequestRouting_FieldPath(rawField string) (ActivityLogRequestRouting_FieldPath, error) { 3470 fp, err := gotenobject.ParseRawFieldPath(rawField) 3471 if err != nil { 3472 return nil, err 3473 } 3474 return BuildActivityLogRequestRouting_FieldPath(fp) 3475 } 3476 3477 func MustParseActivityLogRequestRouting_FieldPath(rawField string) ActivityLogRequestRouting_FieldPath { 3478 fp, err := ParseActivityLogRequestRouting_FieldPath(rawField) 3479 if err != nil { 3480 panic(err) 3481 } 3482 return fp 3483 } 3484 3485 type ActivityLogRequestRouting_FieldTerminalPath struct { 3486 selector ActivityLogRequestRouting_FieldPathSelector 3487 } 3488 3489 var _ ActivityLogRequestRouting_FieldPath = (*ActivityLogRequestRouting_FieldTerminalPath)(nil) 3490 3491 func (fp *ActivityLogRequestRouting_FieldTerminalPath) Selector() ActivityLogRequestRouting_FieldPathSelector { 3492 return fp.selector 3493 } 3494 3495 // String returns path representation in proto convention 3496 func (fp *ActivityLogRequestRouting_FieldTerminalPath) String() string { 3497 return fp.selector.String() 3498 } 3499 3500 // JSONString returns path representation is JSON convention 3501 func (fp *ActivityLogRequestRouting_FieldTerminalPath) JSONString() string { 3502 return strcase.ToLowerCamel(fp.String()) 3503 } 3504 3505 // Get returns all values pointed by specific field from source ActivityLog_RequestRouting 3506 func (fp *ActivityLogRequestRouting_FieldTerminalPath) Get(source *ActivityLog_RequestRouting) (values []interface{}) { 3507 if source != nil { 3508 switch fp.selector { 3509 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3510 values = append(values, source.ViaRegion) 3511 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3512 for _, value := range source.GetDestRegions() { 3513 values = append(values, value) 3514 } 3515 default: 3516 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3517 } 3518 } 3519 return 3520 } 3521 3522 func (fp *ActivityLogRequestRouting_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 3523 return fp.Get(source.(*ActivityLog_RequestRouting)) 3524 } 3525 3526 // GetSingle returns value pointed by specific field of from source ActivityLog_RequestRouting 3527 func (fp *ActivityLogRequestRouting_FieldTerminalPath) GetSingle(source *ActivityLog_RequestRouting) (interface{}, bool) { 3528 switch fp.selector { 3529 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3530 return source.GetViaRegion(), source != nil 3531 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3532 res := source.GetDestRegions() 3533 return res, res != nil 3534 default: 3535 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3536 } 3537 } 3538 3539 func (fp *ActivityLogRequestRouting_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3540 return fp.GetSingle(source.(*ActivityLog_RequestRouting)) 3541 } 3542 3543 // GetDefault returns a default value of the field type 3544 func (fp *ActivityLogRequestRouting_FieldTerminalPath) GetDefault() interface{} { 3545 switch fp.selector { 3546 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3547 return "" 3548 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3549 return ([]string)(nil) 3550 default: 3551 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3552 } 3553 } 3554 3555 func (fp *ActivityLogRequestRouting_FieldTerminalPath) ClearValue(item *ActivityLog_RequestRouting) { 3556 if item != nil { 3557 switch fp.selector { 3558 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3559 item.ViaRegion = "" 3560 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3561 item.DestRegions = nil 3562 default: 3563 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3564 } 3565 } 3566 } 3567 3568 func (fp *ActivityLogRequestRouting_FieldTerminalPath) ClearValueRaw(item proto.Message) { 3569 fp.ClearValue(item.(*ActivityLog_RequestRouting)) 3570 } 3571 3572 // IsLeaf - whether field path is holds simple value 3573 func (fp *ActivityLogRequestRouting_FieldTerminalPath) IsLeaf() bool { 3574 return fp.selector == ActivityLogRequestRouting_FieldPathSelectorViaRegion || 3575 fp.selector == ActivityLogRequestRouting_FieldPathSelectorDestRegions 3576 } 3577 3578 func (fp *ActivityLogRequestRouting_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3579 return []gotenobject.FieldPath{fp} 3580 } 3581 3582 func (fp *ActivityLogRequestRouting_FieldTerminalPath) WithIValue(value interface{}) ActivityLogRequestRouting_FieldPathValue { 3583 switch fp.selector { 3584 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3585 return &ActivityLogRequestRouting_FieldTerminalPathValue{ActivityLogRequestRouting_FieldTerminalPath: *fp, value: value.(string)} 3586 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3587 return &ActivityLogRequestRouting_FieldTerminalPathValue{ActivityLogRequestRouting_FieldTerminalPath: *fp, value: value.([]string)} 3588 default: 3589 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3590 } 3591 } 3592 3593 func (fp *ActivityLogRequestRouting_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3594 return fp.WithIValue(value) 3595 } 3596 3597 func (fp *ActivityLogRequestRouting_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogRequestRouting_FieldPathArrayOfValues { 3598 fpaov := &ActivityLogRequestRouting_FieldTerminalPathArrayOfValues{ActivityLogRequestRouting_FieldTerminalPath: *fp} 3599 switch fp.selector { 3600 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3601 return &ActivityLogRequestRouting_FieldTerminalPathArrayOfValues{ActivityLogRequestRouting_FieldTerminalPath: *fp, values: values.([]string)} 3602 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3603 return &ActivityLogRequestRouting_FieldTerminalPathArrayOfValues{ActivityLogRequestRouting_FieldTerminalPath: *fp, values: values.([][]string)} 3604 default: 3605 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3606 } 3607 return fpaov 3608 } 3609 3610 func (fp *ActivityLogRequestRouting_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3611 return fp.WithIArrayOfValues(values) 3612 } 3613 3614 func (fp *ActivityLogRequestRouting_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogRequestRouting_FieldPathArrayItemValue { 3615 switch fp.selector { 3616 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3617 return &ActivityLogRequestRouting_FieldTerminalPathArrayItemValue{ActivityLogRequestRouting_FieldTerminalPath: *fp, value: value.(string)} 3618 default: 3619 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fp.selector)) 3620 } 3621 } 3622 3623 func (fp *ActivityLogRequestRouting_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3624 return fp.WithIArrayItemValue(value) 3625 } 3626 3627 // ActivityLogRequestRouting_FieldPathValue allows storing values for RequestRouting fields according to their type 3628 type ActivityLogRequestRouting_FieldPathValue interface { 3629 ActivityLogRequestRouting_FieldPath 3630 gotenobject.FieldPathValue 3631 SetTo(target **ActivityLog_RequestRouting) 3632 CompareWith(*ActivityLog_RequestRouting) (cmp int, comparable bool) 3633 } 3634 3635 func ParseActivityLogRequestRouting_FieldPathValue(pathStr, valueStr string) (ActivityLogRequestRouting_FieldPathValue, error) { 3636 fp, err := ParseActivityLogRequestRouting_FieldPath(pathStr) 3637 if err != nil { 3638 return nil, err 3639 } 3640 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 3641 if err != nil { 3642 return nil, status.Errorf(codes.InvalidArgument, "error parsing RequestRouting field path value from %s: %v", valueStr, err) 3643 } 3644 return fpv.(ActivityLogRequestRouting_FieldPathValue), nil 3645 } 3646 3647 func MustParseActivityLogRequestRouting_FieldPathValue(pathStr, valueStr string) ActivityLogRequestRouting_FieldPathValue { 3648 fpv, err := ParseActivityLogRequestRouting_FieldPathValue(pathStr, valueStr) 3649 if err != nil { 3650 panic(err) 3651 } 3652 return fpv 3653 } 3654 3655 type ActivityLogRequestRouting_FieldTerminalPathValue struct { 3656 ActivityLogRequestRouting_FieldTerminalPath 3657 value interface{} 3658 } 3659 3660 var _ ActivityLogRequestRouting_FieldPathValue = (*ActivityLogRequestRouting_FieldTerminalPathValue)(nil) 3661 3662 // GetRawValue returns raw value stored under selected path for 'RequestRouting' as interface{} 3663 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) GetRawValue() interface{} { 3664 return fpv.value 3665 } 3666 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) AsViaRegionValue() (string, bool) { 3667 res, ok := fpv.value.(string) 3668 return res, ok 3669 } 3670 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) AsDestRegionsValue() ([]string, bool) { 3671 res, ok := fpv.value.([]string) 3672 return res, ok 3673 } 3674 3675 // SetTo stores value for selected field for object RequestRouting 3676 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) SetTo(target **ActivityLog_RequestRouting) { 3677 if *target == nil { 3678 *target = new(ActivityLog_RequestRouting) 3679 } 3680 switch fpv.selector { 3681 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3682 (*target).ViaRegion = fpv.value.(string) 3683 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3684 (*target).DestRegions = fpv.value.([]string) 3685 default: 3686 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fpv.selector)) 3687 } 3688 } 3689 3690 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) SetToRaw(target proto.Message) { 3691 typedObject := target.(*ActivityLog_RequestRouting) 3692 fpv.SetTo(&typedObject) 3693 } 3694 3695 // CompareWith compares value in the 'ActivityLogRequestRouting_FieldTerminalPathValue' with the value under path in 'ActivityLog_RequestRouting'. 3696 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) CompareWith(source *ActivityLog_RequestRouting) (int, bool) { 3697 switch fpv.selector { 3698 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3699 leftValue := fpv.value.(string) 3700 rightValue := source.GetViaRegion() 3701 if (leftValue) == (rightValue) { 3702 return 0, true 3703 } else if (leftValue) < (rightValue) { 3704 return -1, true 3705 } else { 3706 return 1, true 3707 } 3708 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3709 return 0, false 3710 default: 3711 panic(fmt.Sprintf("Invalid selector for ActivityLog_RequestRouting: %d", fpv.selector)) 3712 } 3713 } 3714 3715 func (fpv *ActivityLogRequestRouting_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3716 return fpv.CompareWith(source.(*ActivityLog_RequestRouting)) 3717 } 3718 3719 // ActivityLogRequestRouting_FieldPathArrayItemValue allows storing single item in Path-specific values for RequestRouting according to their type 3720 // Present only for array (repeated) types. 3721 type ActivityLogRequestRouting_FieldPathArrayItemValue interface { 3722 gotenobject.FieldPathArrayItemValue 3723 ActivityLogRequestRouting_FieldPath 3724 ContainsValue(*ActivityLog_RequestRouting) bool 3725 } 3726 3727 // ParseActivityLogRequestRouting_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 3728 func ParseActivityLogRequestRouting_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogRequestRouting_FieldPathArrayItemValue, error) { 3729 fp, err := ParseActivityLogRequestRouting_FieldPath(pathStr) 3730 if err != nil { 3731 return nil, err 3732 } 3733 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 3734 if err != nil { 3735 return nil, status.Errorf(codes.InvalidArgument, "error parsing RequestRouting field path array item value from %s: %v", valueStr, err) 3736 } 3737 return fpaiv.(ActivityLogRequestRouting_FieldPathArrayItemValue), nil 3738 } 3739 3740 func MustParseActivityLogRequestRouting_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogRequestRouting_FieldPathArrayItemValue { 3741 fpaiv, err := ParseActivityLogRequestRouting_FieldPathArrayItemValue(pathStr, valueStr) 3742 if err != nil { 3743 panic(err) 3744 } 3745 return fpaiv 3746 } 3747 3748 type ActivityLogRequestRouting_FieldTerminalPathArrayItemValue struct { 3749 ActivityLogRequestRouting_FieldTerminalPath 3750 value interface{} 3751 } 3752 3753 var _ ActivityLogRequestRouting_FieldPathArrayItemValue = (*ActivityLogRequestRouting_FieldTerminalPathArrayItemValue)(nil) 3754 3755 // GetRawValue returns stored element value for array in object ActivityLog_RequestRouting as interface{} 3756 func (fpaiv *ActivityLogRequestRouting_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 3757 return fpaiv.value 3758 } 3759 func (fpaiv *ActivityLogRequestRouting_FieldTerminalPathArrayItemValue) AsDestRegionsItemValue() (string, bool) { 3760 res, ok := fpaiv.value.(string) 3761 return res, ok 3762 } 3763 3764 func (fpaiv *ActivityLogRequestRouting_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_RequestRouting) (interface{}, bool) { 3765 return nil, false 3766 } 3767 3768 func (fpaiv *ActivityLogRequestRouting_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 3769 return fpaiv.GetSingle(source.(*ActivityLog_RequestRouting)) 3770 } 3771 3772 // Contains returns a boolean indicating if value that is being held is present in given 'RequestRouting' 3773 func (fpaiv *ActivityLogRequestRouting_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_RequestRouting) bool { 3774 slice := fpaiv.ActivityLogRequestRouting_FieldTerminalPath.Get(source) 3775 for _, v := range slice { 3776 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 3777 if proto.Equal(asProtoMsg, v.(proto.Message)) { 3778 return true 3779 } 3780 } else if reflect.DeepEqual(v, fpaiv.value) { 3781 return true 3782 } 3783 } 3784 return false 3785 } 3786 3787 // ActivityLogRequestRouting_FieldPathArrayOfValues allows storing slice of values for RequestRouting fields according to their type 3788 type ActivityLogRequestRouting_FieldPathArrayOfValues interface { 3789 gotenobject.FieldPathArrayOfValues 3790 ActivityLogRequestRouting_FieldPath 3791 } 3792 3793 func ParseActivityLogRequestRouting_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogRequestRouting_FieldPathArrayOfValues, error) { 3794 fp, err := ParseActivityLogRequestRouting_FieldPath(pathStr) 3795 if err != nil { 3796 return nil, err 3797 } 3798 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 3799 if err != nil { 3800 return nil, status.Errorf(codes.InvalidArgument, "error parsing RequestRouting field path array of values from %s: %v", valuesStr, err) 3801 } 3802 return fpaov.(ActivityLogRequestRouting_FieldPathArrayOfValues), nil 3803 } 3804 3805 func MustParseActivityLogRequestRouting_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogRequestRouting_FieldPathArrayOfValues { 3806 fpaov, err := ParseActivityLogRequestRouting_FieldPathArrayOfValues(pathStr, valuesStr) 3807 if err != nil { 3808 panic(err) 3809 } 3810 return fpaov 3811 } 3812 3813 type ActivityLogRequestRouting_FieldTerminalPathArrayOfValues struct { 3814 ActivityLogRequestRouting_FieldTerminalPath 3815 values interface{} 3816 } 3817 3818 var _ ActivityLogRequestRouting_FieldPathArrayOfValues = (*ActivityLogRequestRouting_FieldTerminalPathArrayOfValues)(nil) 3819 3820 func (fpaov *ActivityLogRequestRouting_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 3821 switch fpaov.selector { 3822 case ActivityLogRequestRouting_FieldPathSelectorViaRegion: 3823 for _, v := range fpaov.values.([]string) { 3824 values = append(values, v) 3825 } 3826 case ActivityLogRequestRouting_FieldPathSelectorDestRegions: 3827 for _, v := range fpaov.values.([][]string) { 3828 values = append(values, v) 3829 } 3830 } 3831 return 3832 } 3833 func (fpaov *ActivityLogRequestRouting_FieldTerminalPathArrayOfValues) AsViaRegionArrayOfValues() ([]string, bool) { 3834 res, ok := fpaov.values.([]string) 3835 return res, ok 3836 } 3837 func (fpaov *ActivityLogRequestRouting_FieldTerminalPathArrayOfValues) AsDestRegionsArrayOfValues() ([][]string, bool) { 3838 res, ok := fpaov.values.([][]string) 3839 return res, ok 3840 } 3841 3842 // FieldPath provides implementation to handle 3843 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 3844 type ActivityLogResource_FieldPath interface { 3845 gotenobject.FieldPath 3846 Selector() ActivityLogResource_FieldPathSelector 3847 Get(source *ActivityLog_Resource) []interface{} 3848 GetSingle(source *ActivityLog_Resource) (interface{}, bool) 3849 ClearValue(item *ActivityLog_Resource) 3850 3851 // Those methods build corresponding ActivityLogResource_FieldPathValue 3852 // (or array of values) and holds passed value. Panics if injected type is incorrect. 3853 WithIValue(value interface{}) ActivityLogResource_FieldPathValue 3854 WithIArrayOfValues(values interface{}) ActivityLogResource_FieldPathArrayOfValues 3855 WithIArrayItemValue(value interface{}) ActivityLogResource_FieldPathArrayItemValue 3856 } 3857 3858 type ActivityLogResource_FieldPathSelector int32 3859 3860 const ( 3861 ActivityLogResource_FieldPathSelectorName ActivityLogResource_FieldPathSelector = 0 3862 ActivityLogResource_FieldPathSelectorDifference ActivityLogResource_FieldPathSelector = 1 3863 ) 3864 3865 func (s ActivityLogResource_FieldPathSelector) String() string { 3866 switch s { 3867 case ActivityLogResource_FieldPathSelectorName: 3868 return "name" 3869 case ActivityLogResource_FieldPathSelectorDifference: 3870 return "difference" 3871 default: 3872 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", s)) 3873 } 3874 } 3875 3876 func BuildActivityLogResource_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogResource_FieldPath, error) { 3877 if len(fp) == 0 { 3878 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Resource") 3879 } 3880 if len(fp) == 1 { 3881 switch fp[0] { 3882 case "name": 3883 return &ActivityLogResource_FieldTerminalPath{selector: ActivityLogResource_FieldPathSelectorName}, nil 3884 case "difference": 3885 return &ActivityLogResource_FieldTerminalPath{selector: ActivityLogResource_FieldPathSelectorDifference}, nil 3886 } 3887 } else { 3888 switch fp[0] { 3889 case "difference": 3890 if subpath, err := BuildActivityLogResourceDifference_FieldPath(fp[1:]); err != nil { 3891 return nil, err 3892 } else { 3893 return &ActivityLogResource_FieldSubPath{selector: ActivityLogResource_FieldPathSelectorDifference, subPath: subpath}, nil 3894 } 3895 } 3896 } 3897 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Resource", fp) 3898 } 3899 3900 func ParseActivityLogResource_FieldPath(rawField string) (ActivityLogResource_FieldPath, error) { 3901 fp, err := gotenobject.ParseRawFieldPath(rawField) 3902 if err != nil { 3903 return nil, err 3904 } 3905 return BuildActivityLogResource_FieldPath(fp) 3906 } 3907 3908 func MustParseActivityLogResource_FieldPath(rawField string) ActivityLogResource_FieldPath { 3909 fp, err := ParseActivityLogResource_FieldPath(rawField) 3910 if err != nil { 3911 panic(err) 3912 } 3913 return fp 3914 } 3915 3916 type ActivityLogResource_FieldTerminalPath struct { 3917 selector ActivityLogResource_FieldPathSelector 3918 } 3919 3920 var _ ActivityLogResource_FieldPath = (*ActivityLogResource_FieldTerminalPath)(nil) 3921 3922 func (fp *ActivityLogResource_FieldTerminalPath) Selector() ActivityLogResource_FieldPathSelector { 3923 return fp.selector 3924 } 3925 3926 // String returns path representation in proto convention 3927 func (fp *ActivityLogResource_FieldTerminalPath) String() string { 3928 return fp.selector.String() 3929 } 3930 3931 // JSONString returns path representation is JSON convention 3932 func (fp *ActivityLogResource_FieldTerminalPath) JSONString() string { 3933 return strcase.ToLowerCamel(fp.String()) 3934 } 3935 3936 // Get returns all values pointed by specific field from source ActivityLog_Resource 3937 func (fp *ActivityLogResource_FieldTerminalPath) Get(source *ActivityLog_Resource) (values []interface{}) { 3938 if source != nil { 3939 switch fp.selector { 3940 case ActivityLogResource_FieldPathSelectorName: 3941 values = append(values, source.Name) 3942 case ActivityLogResource_FieldPathSelectorDifference: 3943 if source.Difference != nil { 3944 values = append(values, source.Difference) 3945 } 3946 default: 3947 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 3948 } 3949 } 3950 return 3951 } 3952 3953 func (fp *ActivityLogResource_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 3954 return fp.Get(source.(*ActivityLog_Resource)) 3955 } 3956 3957 // GetSingle returns value pointed by specific field of from source ActivityLog_Resource 3958 func (fp *ActivityLogResource_FieldTerminalPath) GetSingle(source *ActivityLog_Resource) (interface{}, bool) { 3959 switch fp.selector { 3960 case ActivityLogResource_FieldPathSelectorName: 3961 return source.GetName(), source != nil 3962 case ActivityLogResource_FieldPathSelectorDifference: 3963 res := source.GetDifference() 3964 return res, res != nil 3965 default: 3966 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 3967 } 3968 } 3969 3970 func (fp *ActivityLogResource_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3971 return fp.GetSingle(source.(*ActivityLog_Resource)) 3972 } 3973 3974 // GetDefault returns a default value of the field type 3975 func (fp *ActivityLogResource_FieldTerminalPath) GetDefault() interface{} { 3976 switch fp.selector { 3977 case ActivityLogResource_FieldPathSelectorName: 3978 return "" 3979 case ActivityLogResource_FieldPathSelectorDifference: 3980 return (*ActivityLog_Resource_Difference)(nil) 3981 default: 3982 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 3983 } 3984 } 3985 3986 func (fp *ActivityLogResource_FieldTerminalPath) ClearValue(item *ActivityLog_Resource) { 3987 if item != nil { 3988 switch fp.selector { 3989 case ActivityLogResource_FieldPathSelectorName: 3990 item.Name = "" 3991 case ActivityLogResource_FieldPathSelectorDifference: 3992 item.Difference = nil 3993 default: 3994 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 3995 } 3996 } 3997 } 3998 3999 func (fp *ActivityLogResource_FieldTerminalPath) ClearValueRaw(item proto.Message) { 4000 fp.ClearValue(item.(*ActivityLog_Resource)) 4001 } 4002 4003 // IsLeaf - whether field path is holds simple value 4004 func (fp *ActivityLogResource_FieldTerminalPath) IsLeaf() bool { 4005 return fp.selector == ActivityLogResource_FieldPathSelectorName 4006 } 4007 4008 func (fp *ActivityLogResource_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4009 return []gotenobject.FieldPath{fp} 4010 } 4011 4012 func (fp *ActivityLogResource_FieldTerminalPath) WithIValue(value interface{}) ActivityLogResource_FieldPathValue { 4013 switch fp.selector { 4014 case ActivityLogResource_FieldPathSelectorName: 4015 return &ActivityLogResource_FieldTerminalPathValue{ActivityLogResource_FieldTerminalPath: *fp, value: value.(string)} 4016 case ActivityLogResource_FieldPathSelectorDifference: 4017 return &ActivityLogResource_FieldTerminalPathValue{ActivityLogResource_FieldTerminalPath: *fp, value: value.(*ActivityLog_Resource_Difference)} 4018 default: 4019 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 4020 } 4021 } 4022 4023 func (fp *ActivityLogResource_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4024 return fp.WithIValue(value) 4025 } 4026 4027 func (fp *ActivityLogResource_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogResource_FieldPathArrayOfValues { 4028 fpaov := &ActivityLogResource_FieldTerminalPathArrayOfValues{ActivityLogResource_FieldTerminalPath: *fp} 4029 switch fp.selector { 4030 case ActivityLogResource_FieldPathSelectorName: 4031 return &ActivityLogResource_FieldTerminalPathArrayOfValues{ActivityLogResource_FieldTerminalPath: *fp, values: values.([]string)} 4032 case ActivityLogResource_FieldPathSelectorDifference: 4033 return &ActivityLogResource_FieldTerminalPathArrayOfValues{ActivityLogResource_FieldTerminalPath: *fp, values: values.([]*ActivityLog_Resource_Difference)} 4034 default: 4035 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 4036 } 4037 return fpaov 4038 } 4039 4040 func (fp *ActivityLogResource_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4041 return fp.WithIArrayOfValues(values) 4042 } 4043 4044 func (fp *ActivityLogResource_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogResource_FieldPathArrayItemValue { 4045 switch fp.selector { 4046 default: 4047 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fp.selector)) 4048 } 4049 } 4050 4051 func (fp *ActivityLogResource_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4052 return fp.WithIArrayItemValue(value) 4053 } 4054 4055 type ActivityLogResource_FieldSubPath struct { 4056 selector ActivityLogResource_FieldPathSelector 4057 subPath gotenobject.FieldPath 4058 } 4059 4060 var _ ActivityLogResource_FieldPath = (*ActivityLogResource_FieldSubPath)(nil) 4061 4062 func (fps *ActivityLogResource_FieldSubPath) Selector() ActivityLogResource_FieldPathSelector { 4063 return fps.selector 4064 } 4065 func (fps *ActivityLogResource_FieldSubPath) AsDifferenceSubPath() (ActivityLogResourceDifference_FieldPath, bool) { 4066 res, ok := fps.subPath.(ActivityLogResourceDifference_FieldPath) 4067 return res, ok 4068 } 4069 4070 // String returns path representation in proto convention 4071 func (fps *ActivityLogResource_FieldSubPath) String() string { 4072 return fps.selector.String() + "." + fps.subPath.String() 4073 } 4074 4075 // JSONString returns path representation is JSON convention 4076 func (fps *ActivityLogResource_FieldSubPath) JSONString() string { 4077 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 4078 } 4079 4080 // Get returns all values pointed by selected field from source ActivityLog_Resource 4081 func (fps *ActivityLogResource_FieldSubPath) Get(source *ActivityLog_Resource) (values []interface{}) { 4082 switch fps.selector { 4083 case ActivityLogResource_FieldPathSelectorDifference: 4084 values = append(values, fps.subPath.GetRaw(source.GetDifference())...) 4085 default: 4086 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fps.selector)) 4087 } 4088 return 4089 } 4090 4091 func (fps *ActivityLogResource_FieldSubPath) GetRaw(source proto.Message) []interface{} { 4092 return fps.Get(source.(*ActivityLog_Resource)) 4093 } 4094 4095 // GetSingle returns value of selected field from source ActivityLog_Resource 4096 func (fps *ActivityLogResource_FieldSubPath) GetSingle(source *ActivityLog_Resource) (interface{}, bool) { 4097 switch fps.selector { 4098 case ActivityLogResource_FieldPathSelectorDifference: 4099 if source.GetDifference() == nil { 4100 return nil, false 4101 } 4102 return fps.subPath.GetSingleRaw(source.GetDifference()) 4103 default: 4104 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fps.selector)) 4105 } 4106 } 4107 4108 func (fps *ActivityLogResource_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4109 return fps.GetSingle(source.(*ActivityLog_Resource)) 4110 } 4111 4112 // GetDefault returns a default value of the field type 4113 func (fps *ActivityLogResource_FieldSubPath) GetDefault() interface{} { 4114 return fps.subPath.GetDefault() 4115 } 4116 4117 func (fps *ActivityLogResource_FieldSubPath) ClearValue(item *ActivityLog_Resource) { 4118 if item != nil { 4119 switch fps.selector { 4120 case ActivityLogResource_FieldPathSelectorDifference: 4121 fps.subPath.ClearValueRaw(item.Difference) 4122 default: 4123 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fps.selector)) 4124 } 4125 } 4126 } 4127 4128 func (fps *ActivityLogResource_FieldSubPath) ClearValueRaw(item proto.Message) { 4129 fps.ClearValue(item.(*ActivityLog_Resource)) 4130 } 4131 4132 // IsLeaf - whether field path is holds simple value 4133 func (fps *ActivityLogResource_FieldSubPath) IsLeaf() bool { 4134 return fps.subPath.IsLeaf() 4135 } 4136 4137 func (fps *ActivityLogResource_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4138 iPaths := []gotenobject.FieldPath{&ActivityLogResource_FieldTerminalPath{selector: fps.selector}} 4139 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 4140 return iPaths 4141 } 4142 4143 func (fps *ActivityLogResource_FieldSubPath) WithIValue(value interface{}) ActivityLogResource_FieldPathValue { 4144 return &ActivityLogResource_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 4145 } 4146 4147 func (fps *ActivityLogResource_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4148 return fps.WithIValue(value) 4149 } 4150 4151 func (fps *ActivityLogResource_FieldSubPath) WithIArrayOfValues(values interface{}) ActivityLogResource_FieldPathArrayOfValues { 4152 return &ActivityLogResource_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 4153 } 4154 4155 func (fps *ActivityLogResource_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4156 return fps.WithIArrayOfValues(values) 4157 } 4158 4159 func (fps *ActivityLogResource_FieldSubPath) WithIArrayItemValue(value interface{}) ActivityLogResource_FieldPathArrayItemValue { 4160 return &ActivityLogResource_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 4161 } 4162 4163 func (fps *ActivityLogResource_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4164 return fps.WithIArrayItemValue(value) 4165 } 4166 4167 // ActivityLogResource_FieldPathValue allows storing values for Resource fields according to their type 4168 type ActivityLogResource_FieldPathValue interface { 4169 ActivityLogResource_FieldPath 4170 gotenobject.FieldPathValue 4171 SetTo(target **ActivityLog_Resource) 4172 CompareWith(*ActivityLog_Resource) (cmp int, comparable bool) 4173 } 4174 4175 func ParseActivityLogResource_FieldPathValue(pathStr, valueStr string) (ActivityLogResource_FieldPathValue, error) { 4176 fp, err := ParseActivityLogResource_FieldPath(pathStr) 4177 if err != nil { 4178 return nil, err 4179 } 4180 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 4181 if err != nil { 4182 return nil, status.Errorf(codes.InvalidArgument, "error parsing Resource field path value from %s: %v", valueStr, err) 4183 } 4184 return fpv.(ActivityLogResource_FieldPathValue), nil 4185 } 4186 4187 func MustParseActivityLogResource_FieldPathValue(pathStr, valueStr string) ActivityLogResource_FieldPathValue { 4188 fpv, err := ParseActivityLogResource_FieldPathValue(pathStr, valueStr) 4189 if err != nil { 4190 panic(err) 4191 } 4192 return fpv 4193 } 4194 4195 type ActivityLogResource_FieldTerminalPathValue struct { 4196 ActivityLogResource_FieldTerminalPath 4197 value interface{} 4198 } 4199 4200 var _ ActivityLogResource_FieldPathValue = (*ActivityLogResource_FieldTerminalPathValue)(nil) 4201 4202 // GetRawValue returns raw value stored under selected path for 'Resource' as interface{} 4203 func (fpv *ActivityLogResource_FieldTerminalPathValue) GetRawValue() interface{} { 4204 return fpv.value 4205 } 4206 func (fpv *ActivityLogResource_FieldTerminalPathValue) AsNameValue() (string, bool) { 4207 res, ok := fpv.value.(string) 4208 return res, ok 4209 } 4210 func (fpv *ActivityLogResource_FieldTerminalPathValue) AsDifferenceValue() (*ActivityLog_Resource_Difference, bool) { 4211 res, ok := fpv.value.(*ActivityLog_Resource_Difference) 4212 return res, ok 4213 } 4214 4215 // SetTo stores value for selected field for object Resource 4216 func (fpv *ActivityLogResource_FieldTerminalPathValue) SetTo(target **ActivityLog_Resource) { 4217 if *target == nil { 4218 *target = new(ActivityLog_Resource) 4219 } 4220 switch fpv.selector { 4221 case ActivityLogResource_FieldPathSelectorName: 4222 (*target).Name = fpv.value.(string) 4223 case ActivityLogResource_FieldPathSelectorDifference: 4224 (*target).Difference = fpv.value.(*ActivityLog_Resource_Difference) 4225 default: 4226 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fpv.selector)) 4227 } 4228 } 4229 4230 func (fpv *ActivityLogResource_FieldTerminalPathValue) SetToRaw(target proto.Message) { 4231 typedObject := target.(*ActivityLog_Resource) 4232 fpv.SetTo(&typedObject) 4233 } 4234 4235 // CompareWith compares value in the 'ActivityLogResource_FieldTerminalPathValue' with the value under path in 'ActivityLog_Resource'. 4236 func (fpv *ActivityLogResource_FieldTerminalPathValue) CompareWith(source *ActivityLog_Resource) (int, bool) { 4237 switch fpv.selector { 4238 case ActivityLogResource_FieldPathSelectorName: 4239 leftValue := fpv.value.(string) 4240 rightValue := source.GetName() 4241 if (leftValue) == (rightValue) { 4242 return 0, true 4243 } else if (leftValue) < (rightValue) { 4244 return -1, true 4245 } else { 4246 return 1, true 4247 } 4248 case ActivityLogResource_FieldPathSelectorDifference: 4249 return 0, false 4250 default: 4251 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fpv.selector)) 4252 } 4253 } 4254 4255 func (fpv *ActivityLogResource_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4256 return fpv.CompareWith(source.(*ActivityLog_Resource)) 4257 } 4258 4259 type ActivityLogResource_FieldSubPathValue struct { 4260 ActivityLogResource_FieldPath 4261 subPathValue gotenobject.FieldPathValue 4262 } 4263 4264 var _ ActivityLogResource_FieldPathValue = (*ActivityLogResource_FieldSubPathValue)(nil) 4265 4266 func (fpvs *ActivityLogResource_FieldSubPathValue) AsDifferencePathValue() (ActivityLogResourceDifference_FieldPathValue, bool) { 4267 res, ok := fpvs.subPathValue.(ActivityLogResourceDifference_FieldPathValue) 4268 return res, ok 4269 } 4270 4271 func (fpvs *ActivityLogResource_FieldSubPathValue) SetTo(target **ActivityLog_Resource) { 4272 if *target == nil { 4273 *target = new(ActivityLog_Resource) 4274 } 4275 switch fpvs.Selector() { 4276 case ActivityLogResource_FieldPathSelectorDifference: 4277 fpvs.subPathValue.(ActivityLogResourceDifference_FieldPathValue).SetTo(&(*target).Difference) 4278 default: 4279 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fpvs.Selector())) 4280 } 4281 } 4282 4283 func (fpvs *ActivityLogResource_FieldSubPathValue) SetToRaw(target proto.Message) { 4284 typedObject := target.(*ActivityLog_Resource) 4285 fpvs.SetTo(&typedObject) 4286 } 4287 4288 func (fpvs *ActivityLogResource_FieldSubPathValue) GetRawValue() interface{} { 4289 return fpvs.subPathValue.GetRawValue() 4290 } 4291 4292 func (fpvs *ActivityLogResource_FieldSubPathValue) CompareWith(source *ActivityLog_Resource) (int, bool) { 4293 switch fpvs.Selector() { 4294 case ActivityLogResource_FieldPathSelectorDifference: 4295 return fpvs.subPathValue.(ActivityLogResourceDifference_FieldPathValue).CompareWith(source.GetDifference()) 4296 default: 4297 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fpvs.Selector())) 4298 } 4299 } 4300 4301 func (fpvs *ActivityLogResource_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4302 return fpvs.CompareWith(source.(*ActivityLog_Resource)) 4303 } 4304 4305 // ActivityLogResource_FieldPathArrayItemValue allows storing single item in Path-specific values for Resource according to their type 4306 // Present only for array (repeated) types. 4307 type ActivityLogResource_FieldPathArrayItemValue interface { 4308 gotenobject.FieldPathArrayItemValue 4309 ActivityLogResource_FieldPath 4310 ContainsValue(*ActivityLog_Resource) bool 4311 } 4312 4313 // ParseActivityLogResource_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 4314 func ParseActivityLogResource_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogResource_FieldPathArrayItemValue, error) { 4315 fp, err := ParseActivityLogResource_FieldPath(pathStr) 4316 if err != nil { 4317 return nil, err 4318 } 4319 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 4320 if err != nil { 4321 return nil, status.Errorf(codes.InvalidArgument, "error parsing Resource field path array item value from %s: %v", valueStr, err) 4322 } 4323 return fpaiv.(ActivityLogResource_FieldPathArrayItemValue), nil 4324 } 4325 4326 func MustParseActivityLogResource_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogResource_FieldPathArrayItemValue { 4327 fpaiv, err := ParseActivityLogResource_FieldPathArrayItemValue(pathStr, valueStr) 4328 if err != nil { 4329 panic(err) 4330 } 4331 return fpaiv 4332 } 4333 4334 type ActivityLogResource_FieldTerminalPathArrayItemValue struct { 4335 ActivityLogResource_FieldTerminalPath 4336 value interface{} 4337 } 4338 4339 var _ ActivityLogResource_FieldPathArrayItemValue = (*ActivityLogResource_FieldTerminalPathArrayItemValue)(nil) 4340 4341 // GetRawValue returns stored element value for array in object ActivityLog_Resource as interface{} 4342 func (fpaiv *ActivityLogResource_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 4343 return fpaiv.value 4344 } 4345 4346 func (fpaiv *ActivityLogResource_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Resource) (interface{}, bool) { 4347 return nil, false 4348 } 4349 4350 func (fpaiv *ActivityLogResource_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 4351 return fpaiv.GetSingle(source.(*ActivityLog_Resource)) 4352 } 4353 4354 // Contains returns a boolean indicating if value that is being held is present in given 'Resource' 4355 func (fpaiv *ActivityLogResource_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Resource) bool { 4356 slice := fpaiv.ActivityLogResource_FieldTerminalPath.Get(source) 4357 for _, v := range slice { 4358 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 4359 if proto.Equal(asProtoMsg, v.(proto.Message)) { 4360 return true 4361 } 4362 } else if reflect.DeepEqual(v, fpaiv.value) { 4363 return true 4364 } 4365 } 4366 return false 4367 } 4368 4369 type ActivityLogResource_FieldSubPathArrayItemValue struct { 4370 ActivityLogResource_FieldPath 4371 subPathItemValue gotenobject.FieldPathArrayItemValue 4372 } 4373 4374 // GetRawValue returns stored array item value 4375 func (fpaivs *ActivityLogResource_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 4376 return fpaivs.subPathItemValue.GetRawItemValue() 4377 } 4378 func (fpaivs *ActivityLogResource_FieldSubPathArrayItemValue) AsDifferencePathItemValue() (ActivityLogResourceDifference_FieldPathArrayItemValue, bool) { 4379 res, ok := fpaivs.subPathItemValue.(ActivityLogResourceDifference_FieldPathArrayItemValue) 4380 return res, ok 4381 } 4382 4383 // Contains returns a boolean indicating if value that is being held is present in given 'Resource' 4384 func (fpaivs *ActivityLogResource_FieldSubPathArrayItemValue) ContainsValue(source *ActivityLog_Resource) bool { 4385 switch fpaivs.Selector() { 4386 case ActivityLogResource_FieldPathSelectorDifference: 4387 return fpaivs.subPathItemValue.(ActivityLogResourceDifference_FieldPathArrayItemValue).ContainsValue(source.GetDifference()) 4388 default: 4389 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource: %d", fpaivs.Selector())) 4390 } 4391 } 4392 4393 // ActivityLogResource_FieldPathArrayOfValues allows storing slice of values for Resource fields according to their type 4394 type ActivityLogResource_FieldPathArrayOfValues interface { 4395 gotenobject.FieldPathArrayOfValues 4396 ActivityLogResource_FieldPath 4397 } 4398 4399 func ParseActivityLogResource_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogResource_FieldPathArrayOfValues, error) { 4400 fp, err := ParseActivityLogResource_FieldPath(pathStr) 4401 if err != nil { 4402 return nil, err 4403 } 4404 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 4405 if err != nil { 4406 return nil, status.Errorf(codes.InvalidArgument, "error parsing Resource field path array of values from %s: %v", valuesStr, err) 4407 } 4408 return fpaov.(ActivityLogResource_FieldPathArrayOfValues), nil 4409 } 4410 4411 func MustParseActivityLogResource_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogResource_FieldPathArrayOfValues { 4412 fpaov, err := ParseActivityLogResource_FieldPathArrayOfValues(pathStr, valuesStr) 4413 if err != nil { 4414 panic(err) 4415 } 4416 return fpaov 4417 } 4418 4419 type ActivityLogResource_FieldTerminalPathArrayOfValues struct { 4420 ActivityLogResource_FieldTerminalPath 4421 values interface{} 4422 } 4423 4424 var _ ActivityLogResource_FieldPathArrayOfValues = (*ActivityLogResource_FieldTerminalPathArrayOfValues)(nil) 4425 4426 func (fpaov *ActivityLogResource_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 4427 switch fpaov.selector { 4428 case ActivityLogResource_FieldPathSelectorName: 4429 for _, v := range fpaov.values.([]string) { 4430 values = append(values, v) 4431 } 4432 case ActivityLogResource_FieldPathSelectorDifference: 4433 for _, v := range fpaov.values.([]*ActivityLog_Resource_Difference) { 4434 values = append(values, v) 4435 } 4436 } 4437 return 4438 } 4439 func (fpaov *ActivityLogResource_FieldTerminalPathArrayOfValues) AsNameArrayOfValues() ([]string, bool) { 4440 res, ok := fpaov.values.([]string) 4441 return res, ok 4442 } 4443 func (fpaov *ActivityLogResource_FieldTerminalPathArrayOfValues) AsDifferenceArrayOfValues() ([]*ActivityLog_Resource_Difference, bool) { 4444 res, ok := fpaov.values.([]*ActivityLog_Resource_Difference) 4445 return res, ok 4446 } 4447 4448 type ActivityLogResource_FieldSubPathArrayOfValues struct { 4449 ActivityLogResource_FieldPath 4450 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 4451 } 4452 4453 var _ ActivityLogResource_FieldPathArrayOfValues = (*ActivityLogResource_FieldSubPathArrayOfValues)(nil) 4454 4455 func (fpsaov *ActivityLogResource_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 4456 return fpsaov.subPathArrayOfValues.GetRawValues() 4457 } 4458 func (fpsaov *ActivityLogResource_FieldSubPathArrayOfValues) AsDifferencePathArrayOfValues() (ActivityLogResourceDifference_FieldPathArrayOfValues, bool) { 4459 res, ok := fpsaov.subPathArrayOfValues.(ActivityLogResourceDifference_FieldPathArrayOfValues) 4460 return res, ok 4461 } 4462 4463 // FieldPath provides implementation to handle 4464 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 4465 type ActivityLogEventClientMsgEvent_FieldPath interface { 4466 gotenobject.FieldPath 4467 Selector() ActivityLogEventClientMsgEvent_FieldPathSelector 4468 Get(source *ActivityLog_Event_ClientMsgEvent) []interface{} 4469 GetSingle(source *ActivityLog_Event_ClientMsgEvent) (interface{}, bool) 4470 ClearValue(item *ActivityLog_Event_ClientMsgEvent) 4471 4472 // Those methods build corresponding ActivityLogEventClientMsgEvent_FieldPathValue 4473 // (or array of values) and holds passed value. Panics if injected type is incorrect. 4474 WithIValue(value interface{}) ActivityLogEventClientMsgEvent_FieldPathValue 4475 WithIArrayOfValues(values interface{}) ActivityLogEventClientMsgEvent_FieldPathArrayOfValues 4476 WithIArrayItemValue(value interface{}) ActivityLogEventClientMsgEvent_FieldPathArrayItemValue 4477 } 4478 4479 type ActivityLogEventClientMsgEvent_FieldPathSelector int32 4480 4481 const ( 4482 ActivityLogEventClientMsgEvent_FieldPathSelectorData ActivityLogEventClientMsgEvent_FieldPathSelector = 0 4483 ActivityLogEventClientMsgEvent_FieldPathSelectorTime ActivityLogEventClientMsgEvent_FieldPathSelector = 1 4484 ) 4485 4486 func (s ActivityLogEventClientMsgEvent_FieldPathSelector) String() string { 4487 switch s { 4488 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4489 return "data" 4490 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4491 return "time" 4492 default: 4493 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", s)) 4494 } 4495 } 4496 4497 func BuildActivityLogEventClientMsgEvent_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogEventClientMsgEvent_FieldPath, error) { 4498 if len(fp) == 0 { 4499 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Event_ClientMsgEvent") 4500 } 4501 if len(fp) == 1 { 4502 switch fp[0] { 4503 case "data": 4504 return &ActivityLogEventClientMsgEvent_FieldTerminalPath{selector: ActivityLogEventClientMsgEvent_FieldPathSelectorData}, nil 4505 case "time": 4506 return &ActivityLogEventClientMsgEvent_FieldTerminalPath{selector: ActivityLogEventClientMsgEvent_FieldPathSelectorTime}, nil 4507 } 4508 } 4509 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Event_ClientMsgEvent", fp) 4510 } 4511 4512 func ParseActivityLogEventClientMsgEvent_FieldPath(rawField string) (ActivityLogEventClientMsgEvent_FieldPath, error) { 4513 fp, err := gotenobject.ParseRawFieldPath(rawField) 4514 if err != nil { 4515 return nil, err 4516 } 4517 return BuildActivityLogEventClientMsgEvent_FieldPath(fp) 4518 } 4519 4520 func MustParseActivityLogEventClientMsgEvent_FieldPath(rawField string) ActivityLogEventClientMsgEvent_FieldPath { 4521 fp, err := ParseActivityLogEventClientMsgEvent_FieldPath(rawField) 4522 if err != nil { 4523 panic(err) 4524 } 4525 return fp 4526 } 4527 4528 type ActivityLogEventClientMsgEvent_FieldTerminalPath struct { 4529 selector ActivityLogEventClientMsgEvent_FieldPathSelector 4530 } 4531 4532 var _ ActivityLogEventClientMsgEvent_FieldPath = (*ActivityLogEventClientMsgEvent_FieldTerminalPath)(nil) 4533 4534 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) Selector() ActivityLogEventClientMsgEvent_FieldPathSelector { 4535 return fp.selector 4536 } 4537 4538 // String returns path representation in proto convention 4539 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) String() string { 4540 return fp.selector.String() 4541 } 4542 4543 // JSONString returns path representation is JSON convention 4544 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) JSONString() string { 4545 return strcase.ToLowerCamel(fp.String()) 4546 } 4547 4548 // Get returns all values pointed by specific field from source ActivityLog_Event_ClientMsgEvent 4549 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) Get(source *ActivityLog_Event_ClientMsgEvent) (values []interface{}) { 4550 if source != nil { 4551 switch fp.selector { 4552 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4553 if source.Data != nil { 4554 values = append(values, source.Data) 4555 } 4556 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4557 if source.Time != nil { 4558 values = append(values, source.Time) 4559 } 4560 default: 4561 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4562 } 4563 } 4564 return 4565 } 4566 4567 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 4568 return fp.Get(source.(*ActivityLog_Event_ClientMsgEvent)) 4569 } 4570 4571 // GetSingle returns value pointed by specific field of from source ActivityLog_Event_ClientMsgEvent 4572 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) GetSingle(source *ActivityLog_Event_ClientMsgEvent) (interface{}, bool) { 4573 switch fp.selector { 4574 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4575 res := source.GetData() 4576 return res, res != nil 4577 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4578 res := source.GetTime() 4579 return res, res != nil 4580 default: 4581 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4582 } 4583 } 4584 4585 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4586 return fp.GetSingle(source.(*ActivityLog_Event_ClientMsgEvent)) 4587 } 4588 4589 // GetDefault returns a default value of the field type 4590 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) GetDefault() interface{} { 4591 switch fp.selector { 4592 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4593 return (*anypb.Any)(nil) 4594 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4595 return (*timestamppb.Timestamp)(nil) 4596 default: 4597 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4598 } 4599 } 4600 4601 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) ClearValue(item *ActivityLog_Event_ClientMsgEvent) { 4602 if item != nil { 4603 switch fp.selector { 4604 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4605 item.Data = nil 4606 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4607 item.Time = nil 4608 default: 4609 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4610 } 4611 } 4612 } 4613 4614 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) ClearValueRaw(item proto.Message) { 4615 fp.ClearValue(item.(*ActivityLog_Event_ClientMsgEvent)) 4616 } 4617 4618 // IsLeaf - whether field path is holds simple value 4619 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) IsLeaf() bool { 4620 return fp.selector == ActivityLogEventClientMsgEvent_FieldPathSelectorData || 4621 fp.selector == ActivityLogEventClientMsgEvent_FieldPathSelectorTime 4622 } 4623 4624 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4625 return []gotenobject.FieldPath{fp} 4626 } 4627 4628 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) WithIValue(value interface{}) ActivityLogEventClientMsgEvent_FieldPathValue { 4629 switch fp.selector { 4630 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4631 return &ActivityLogEventClientMsgEvent_FieldTerminalPathValue{ActivityLogEventClientMsgEvent_FieldTerminalPath: *fp, value: value.(*anypb.Any)} 4632 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4633 return &ActivityLogEventClientMsgEvent_FieldTerminalPathValue{ActivityLogEventClientMsgEvent_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 4634 default: 4635 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4636 } 4637 } 4638 4639 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4640 return fp.WithIValue(value) 4641 } 4642 4643 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogEventClientMsgEvent_FieldPathArrayOfValues { 4644 fpaov := &ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventClientMsgEvent_FieldTerminalPath: *fp} 4645 switch fp.selector { 4646 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4647 return &ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventClientMsgEvent_FieldTerminalPath: *fp, values: values.([]*anypb.Any)} 4648 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4649 return &ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventClientMsgEvent_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 4650 default: 4651 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4652 } 4653 return fpaov 4654 } 4655 4656 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4657 return fp.WithIArrayOfValues(values) 4658 } 4659 4660 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogEventClientMsgEvent_FieldPathArrayItemValue { 4661 switch fp.selector { 4662 default: 4663 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fp.selector)) 4664 } 4665 } 4666 4667 func (fp *ActivityLogEventClientMsgEvent_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4668 return fp.WithIArrayItemValue(value) 4669 } 4670 4671 // ActivityLogEventClientMsgEvent_FieldPathValue allows storing values for ClientMsgEvent fields according to their type 4672 type ActivityLogEventClientMsgEvent_FieldPathValue interface { 4673 ActivityLogEventClientMsgEvent_FieldPath 4674 gotenobject.FieldPathValue 4675 SetTo(target **ActivityLog_Event_ClientMsgEvent) 4676 CompareWith(*ActivityLog_Event_ClientMsgEvent) (cmp int, comparable bool) 4677 } 4678 4679 func ParseActivityLogEventClientMsgEvent_FieldPathValue(pathStr, valueStr string) (ActivityLogEventClientMsgEvent_FieldPathValue, error) { 4680 fp, err := ParseActivityLogEventClientMsgEvent_FieldPath(pathStr) 4681 if err != nil { 4682 return nil, err 4683 } 4684 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 4685 if err != nil { 4686 return nil, status.Errorf(codes.InvalidArgument, "error parsing ClientMsgEvent field path value from %s: %v", valueStr, err) 4687 } 4688 return fpv.(ActivityLogEventClientMsgEvent_FieldPathValue), nil 4689 } 4690 4691 func MustParseActivityLogEventClientMsgEvent_FieldPathValue(pathStr, valueStr string) ActivityLogEventClientMsgEvent_FieldPathValue { 4692 fpv, err := ParseActivityLogEventClientMsgEvent_FieldPathValue(pathStr, valueStr) 4693 if err != nil { 4694 panic(err) 4695 } 4696 return fpv 4697 } 4698 4699 type ActivityLogEventClientMsgEvent_FieldTerminalPathValue struct { 4700 ActivityLogEventClientMsgEvent_FieldTerminalPath 4701 value interface{} 4702 } 4703 4704 var _ ActivityLogEventClientMsgEvent_FieldPathValue = (*ActivityLogEventClientMsgEvent_FieldTerminalPathValue)(nil) 4705 4706 // GetRawValue returns raw value stored under selected path for 'ClientMsgEvent' as interface{} 4707 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) GetRawValue() interface{} { 4708 return fpv.value 4709 } 4710 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) AsDataValue() (*anypb.Any, bool) { 4711 res, ok := fpv.value.(*anypb.Any) 4712 return res, ok 4713 } 4714 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) AsTimeValue() (*timestamppb.Timestamp, bool) { 4715 res, ok := fpv.value.(*timestamppb.Timestamp) 4716 return res, ok 4717 } 4718 4719 // SetTo stores value for selected field for object ClientMsgEvent 4720 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) SetTo(target **ActivityLog_Event_ClientMsgEvent) { 4721 if *target == nil { 4722 *target = new(ActivityLog_Event_ClientMsgEvent) 4723 } 4724 switch fpv.selector { 4725 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4726 (*target).Data = fpv.value.(*anypb.Any) 4727 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4728 (*target).Time = fpv.value.(*timestamppb.Timestamp) 4729 default: 4730 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fpv.selector)) 4731 } 4732 } 4733 4734 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) SetToRaw(target proto.Message) { 4735 typedObject := target.(*ActivityLog_Event_ClientMsgEvent) 4736 fpv.SetTo(&typedObject) 4737 } 4738 4739 // CompareWith compares value in the 'ActivityLogEventClientMsgEvent_FieldTerminalPathValue' with the value under path in 'ActivityLog_Event_ClientMsgEvent'. 4740 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) CompareWith(source *ActivityLog_Event_ClientMsgEvent) (int, bool) { 4741 switch fpv.selector { 4742 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4743 return 0, false 4744 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4745 leftValue := fpv.value.(*timestamppb.Timestamp) 4746 rightValue := source.GetTime() 4747 if leftValue == nil { 4748 if rightValue != nil { 4749 return -1, true 4750 } 4751 return 0, true 4752 } 4753 if rightValue == nil { 4754 return 1, true 4755 } 4756 if leftValue.AsTime().Equal(rightValue.AsTime()) { 4757 return 0, true 4758 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 4759 return -1, true 4760 } else { 4761 return 1, true 4762 } 4763 default: 4764 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ClientMsgEvent: %d", fpv.selector)) 4765 } 4766 } 4767 4768 func (fpv *ActivityLogEventClientMsgEvent_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4769 return fpv.CompareWith(source.(*ActivityLog_Event_ClientMsgEvent)) 4770 } 4771 4772 // ActivityLogEventClientMsgEvent_FieldPathArrayItemValue allows storing single item in Path-specific values for ClientMsgEvent according to their type 4773 // Present only for array (repeated) types. 4774 type ActivityLogEventClientMsgEvent_FieldPathArrayItemValue interface { 4775 gotenobject.FieldPathArrayItemValue 4776 ActivityLogEventClientMsgEvent_FieldPath 4777 ContainsValue(*ActivityLog_Event_ClientMsgEvent) bool 4778 } 4779 4780 // ParseActivityLogEventClientMsgEvent_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 4781 func ParseActivityLogEventClientMsgEvent_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogEventClientMsgEvent_FieldPathArrayItemValue, error) { 4782 fp, err := ParseActivityLogEventClientMsgEvent_FieldPath(pathStr) 4783 if err != nil { 4784 return nil, err 4785 } 4786 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 4787 if err != nil { 4788 return nil, status.Errorf(codes.InvalidArgument, "error parsing ClientMsgEvent field path array item value from %s: %v", valueStr, err) 4789 } 4790 return fpaiv.(ActivityLogEventClientMsgEvent_FieldPathArrayItemValue), nil 4791 } 4792 4793 func MustParseActivityLogEventClientMsgEvent_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogEventClientMsgEvent_FieldPathArrayItemValue { 4794 fpaiv, err := ParseActivityLogEventClientMsgEvent_FieldPathArrayItemValue(pathStr, valueStr) 4795 if err != nil { 4796 panic(err) 4797 } 4798 return fpaiv 4799 } 4800 4801 type ActivityLogEventClientMsgEvent_FieldTerminalPathArrayItemValue struct { 4802 ActivityLogEventClientMsgEvent_FieldTerminalPath 4803 value interface{} 4804 } 4805 4806 var _ ActivityLogEventClientMsgEvent_FieldPathArrayItemValue = (*ActivityLogEventClientMsgEvent_FieldTerminalPathArrayItemValue)(nil) 4807 4808 // GetRawValue returns stored element value for array in object ActivityLog_Event_ClientMsgEvent as interface{} 4809 func (fpaiv *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 4810 return fpaiv.value 4811 } 4812 4813 func (fpaiv *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Event_ClientMsgEvent) (interface{}, bool) { 4814 return nil, false 4815 } 4816 4817 func (fpaiv *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 4818 return fpaiv.GetSingle(source.(*ActivityLog_Event_ClientMsgEvent)) 4819 } 4820 4821 // Contains returns a boolean indicating if value that is being held is present in given 'ClientMsgEvent' 4822 func (fpaiv *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Event_ClientMsgEvent) bool { 4823 slice := fpaiv.ActivityLogEventClientMsgEvent_FieldTerminalPath.Get(source) 4824 for _, v := range slice { 4825 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 4826 if proto.Equal(asProtoMsg, v.(proto.Message)) { 4827 return true 4828 } 4829 } else if reflect.DeepEqual(v, fpaiv.value) { 4830 return true 4831 } 4832 } 4833 return false 4834 } 4835 4836 // ActivityLogEventClientMsgEvent_FieldPathArrayOfValues allows storing slice of values for ClientMsgEvent fields according to their type 4837 type ActivityLogEventClientMsgEvent_FieldPathArrayOfValues interface { 4838 gotenobject.FieldPathArrayOfValues 4839 ActivityLogEventClientMsgEvent_FieldPath 4840 } 4841 4842 func ParseActivityLogEventClientMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogEventClientMsgEvent_FieldPathArrayOfValues, error) { 4843 fp, err := ParseActivityLogEventClientMsgEvent_FieldPath(pathStr) 4844 if err != nil { 4845 return nil, err 4846 } 4847 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 4848 if err != nil { 4849 return nil, status.Errorf(codes.InvalidArgument, "error parsing ClientMsgEvent field path array of values from %s: %v", valuesStr, err) 4850 } 4851 return fpaov.(ActivityLogEventClientMsgEvent_FieldPathArrayOfValues), nil 4852 } 4853 4854 func MustParseActivityLogEventClientMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogEventClientMsgEvent_FieldPathArrayOfValues { 4855 fpaov, err := ParseActivityLogEventClientMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr) 4856 if err != nil { 4857 panic(err) 4858 } 4859 return fpaov 4860 } 4861 4862 type ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues struct { 4863 ActivityLogEventClientMsgEvent_FieldTerminalPath 4864 values interface{} 4865 } 4866 4867 var _ ActivityLogEventClientMsgEvent_FieldPathArrayOfValues = (*ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues)(nil) 4868 4869 func (fpaov *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 4870 switch fpaov.selector { 4871 case ActivityLogEventClientMsgEvent_FieldPathSelectorData: 4872 for _, v := range fpaov.values.([]*anypb.Any) { 4873 values = append(values, v) 4874 } 4875 case ActivityLogEventClientMsgEvent_FieldPathSelectorTime: 4876 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 4877 values = append(values, v) 4878 } 4879 } 4880 return 4881 } 4882 func (fpaov *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues) AsDataArrayOfValues() ([]*anypb.Any, bool) { 4883 res, ok := fpaov.values.([]*anypb.Any) 4884 return res, ok 4885 } 4886 func (fpaov *ActivityLogEventClientMsgEvent_FieldTerminalPathArrayOfValues) AsTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 4887 res, ok := fpaov.values.([]*timestamppb.Timestamp) 4888 return res, ok 4889 } 4890 4891 // FieldPath provides implementation to handle 4892 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 4893 type ActivityLogEventRegionalServerMsgEvent_FieldPath interface { 4894 gotenobject.FieldPath 4895 Selector() ActivityLogEventRegionalServerMsgEvent_FieldPathSelector 4896 Get(source *ActivityLog_Event_RegionalServerMsgEvent) []interface{} 4897 GetSingle(source *ActivityLog_Event_RegionalServerMsgEvent) (interface{}, bool) 4898 ClearValue(item *ActivityLog_Event_RegionalServerMsgEvent) 4899 4900 // Those methods build corresponding ActivityLogEventRegionalServerMsgEvent_FieldPathValue 4901 // (or array of values) and holds passed value. Panics if injected type is incorrect. 4902 WithIValue(value interface{}) ActivityLogEventRegionalServerMsgEvent_FieldPathValue 4903 WithIArrayOfValues(values interface{}) ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues 4904 WithIArrayItemValue(value interface{}) ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue 4905 } 4906 4907 type ActivityLogEventRegionalServerMsgEvent_FieldPathSelector int32 4908 4909 const ( 4910 ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData ActivityLogEventRegionalServerMsgEvent_FieldPathSelector = 0 4911 ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime ActivityLogEventRegionalServerMsgEvent_FieldPathSelector = 1 4912 ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId ActivityLogEventRegionalServerMsgEvent_FieldPathSelector = 2 4913 ) 4914 4915 func (s ActivityLogEventRegionalServerMsgEvent_FieldPathSelector) String() string { 4916 switch s { 4917 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 4918 return "data" 4919 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 4920 return "time" 4921 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 4922 return "region_id" 4923 default: 4924 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", s)) 4925 } 4926 } 4927 4928 func BuildActivityLogEventRegionalServerMsgEvent_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogEventRegionalServerMsgEvent_FieldPath, error) { 4929 if len(fp) == 0 { 4930 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Event_RegionalServerMsgEvent") 4931 } 4932 if len(fp) == 1 { 4933 switch fp[0] { 4934 case "data": 4935 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath{selector: ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData}, nil 4936 case "time": 4937 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath{selector: ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime}, nil 4938 case "region_id", "regionId", "region-id": 4939 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath{selector: ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId}, nil 4940 } 4941 } 4942 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Event_RegionalServerMsgEvent", fp) 4943 } 4944 4945 func ParseActivityLogEventRegionalServerMsgEvent_FieldPath(rawField string) (ActivityLogEventRegionalServerMsgEvent_FieldPath, error) { 4946 fp, err := gotenobject.ParseRawFieldPath(rawField) 4947 if err != nil { 4948 return nil, err 4949 } 4950 return BuildActivityLogEventRegionalServerMsgEvent_FieldPath(fp) 4951 } 4952 4953 func MustParseActivityLogEventRegionalServerMsgEvent_FieldPath(rawField string) ActivityLogEventRegionalServerMsgEvent_FieldPath { 4954 fp, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPath(rawField) 4955 if err != nil { 4956 panic(err) 4957 } 4958 return fp 4959 } 4960 4961 type ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath struct { 4962 selector ActivityLogEventRegionalServerMsgEvent_FieldPathSelector 4963 } 4964 4965 var _ ActivityLogEventRegionalServerMsgEvent_FieldPath = (*ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath)(nil) 4966 4967 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) Selector() ActivityLogEventRegionalServerMsgEvent_FieldPathSelector { 4968 return fp.selector 4969 } 4970 4971 // String returns path representation in proto convention 4972 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) String() string { 4973 return fp.selector.String() 4974 } 4975 4976 // JSONString returns path representation is JSON convention 4977 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) JSONString() string { 4978 return strcase.ToLowerCamel(fp.String()) 4979 } 4980 4981 // Get returns all values pointed by specific field from source ActivityLog_Event_RegionalServerMsgEvent 4982 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) Get(source *ActivityLog_Event_RegionalServerMsgEvent) (values []interface{}) { 4983 if source != nil { 4984 switch fp.selector { 4985 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 4986 if source.Data != nil { 4987 values = append(values, source.Data) 4988 } 4989 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 4990 if source.Time != nil { 4991 values = append(values, source.Time) 4992 } 4993 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 4994 values = append(values, source.RegionId) 4995 default: 4996 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 4997 } 4998 } 4999 return 5000 } 5001 5002 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 5003 return fp.Get(source.(*ActivityLog_Event_RegionalServerMsgEvent)) 5004 } 5005 5006 // GetSingle returns value pointed by specific field of from source ActivityLog_Event_RegionalServerMsgEvent 5007 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) GetSingle(source *ActivityLog_Event_RegionalServerMsgEvent) (interface{}, bool) { 5008 switch fp.selector { 5009 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5010 res := source.GetData() 5011 return res, res != nil 5012 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5013 res := source.GetTime() 5014 return res, res != nil 5015 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5016 return source.GetRegionId(), source != nil 5017 default: 5018 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 5019 } 5020 } 5021 5022 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5023 return fp.GetSingle(source.(*ActivityLog_Event_RegionalServerMsgEvent)) 5024 } 5025 5026 // GetDefault returns a default value of the field type 5027 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) GetDefault() interface{} { 5028 switch fp.selector { 5029 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5030 return (*anypb.Any)(nil) 5031 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5032 return (*timestamppb.Timestamp)(nil) 5033 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5034 return "" 5035 default: 5036 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 5037 } 5038 } 5039 5040 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) ClearValue(item *ActivityLog_Event_RegionalServerMsgEvent) { 5041 if item != nil { 5042 switch fp.selector { 5043 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5044 item.Data = nil 5045 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5046 item.Time = nil 5047 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5048 item.RegionId = "" 5049 default: 5050 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 5051 } 5052 } 5053 } 5054 5055 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) ClearValueRaw(item proto.Message) { 5056 fp.ClearValue(item.(*ActivityLog_Event_RegionalServerMsgEvent)) 5057 } 5058 5059 // IsLeaf - whether field path is holds simple value 5060 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) IsLeaf() bool { 5061 return fp.selector == ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData || 5062 fp.selector == ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime || 5063 fp.selector == ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId 5064 } 5065 5066 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5067 return []gotenobject.FieldPath{fp} 5068 } 5069 5070 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) WithIValue(value interface{}) ActivityLogEventRegionalServerMsgEvent_FieldPathValue { 5071 switch fp.selector { 5072 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5073 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp, value: value.(*anypb.Any)} 5074 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5075 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 5076 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5077 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp, value: value.(string)} 5078 default: 5079 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 5080 } 5081 } 5082 5083 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5084 return fp.WithIValue(value) 5085 } 5086 5087 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues { 5088 fpaov := &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp} 5089 switch fp.selector { 5090 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5091 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp, values: values.([]*anypb.Any)} 5092 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5093 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 5094 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5095 return &ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath: *fp, values: values.([]string)} 5096 default: 5097 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 5098 } 5099 return fpaov 5100 } 5101 5102 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5103 return fp.WithIArrayOfValues(values) 5104 } 5105 5106 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue { 5107 switch fp.selector { 5108 default: 5109 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fp.selector)) 5110 } 5111 } 5112 5113 func (fp *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5114 return fp.WithIArrayItemValue(value) 5115 } 5116 5117 // ActivityLogEventRegionalServerMsgEvent_FieldPathValue allows storing values for RegionalServerMsgEvent fields according to their type 5118 type ActivityLogEventRegionalServerMsgEvent_FieldPathValue interface { 5119 ActivityLogEventRegionalServerMsgEvent_FieldPath 5120 gotenobject.FieldPathValue 5121 SetTo(target **ActivityLog_Event_RegionalServerMsgEvent) 5122 CompareWith(*ActivityLog_Event_RegionalServerMsgEvent) (cmp int, comparable bool) 5123 } 5124 5125 func ParseActivityLogEventRegionalServerMsgEvent_FieldPathValue(pathStr, valueStr string) (ActivityLogEventRegionalServerMsgEvent_FieldPathValue, error) { 5126 fp, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPath(pathStr) 5127 if err != nil { 5128 return nil, err 5129 } 5130 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 5131 if err != nil { 5132 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegionalServerMsgEvent field path value from %s: %v", valueStr, err) 5133 } 5134 return fpv.(ActivityLogEventRegionalServerMsgEvent_FieldPathValue), nil 5135 } 5136 5137 func MustParseActivityLogEventRegionalServerMsgEvent_FieldPathValue(pathStr, valueStr string) ActivityLogEventRegionalServerMsgEvent_FieldPathValue { 5138 fpv, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPathValue(pathStr, valueStr) 5139 if err != nil { 5140 panic(err) 5141 } 5142 return fpv 5143 } 5144 5145 type ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue struct { 5146 ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath 5147 value interface{} 5148 } 5149 5150 var _ ActivityLogEventRegionalServerMsgEvent_FieldPathValue = (*ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue)(nil) 5151 5152 // GetRawValue returns raw value stored under selected path for 'RegionalServerMsgEvent' as interface{} 5153 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) GetRawValue() interface{} { 5154 return fpv.value 5155 } 5156 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) AsDataValue() (*anypb.Any, bool) { 5157 res, ok := fpv.value.(*anypb.Any) 5158 return res, ok 5159 } 5160 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) AsTimeValue() (*timestamppb.Timestamp, bool) { 5161 res, ok := fpv.value.(*timestamppb.Timestamp) 5162 return res, ok 5163 } 5164 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) AsRegionIdValue() (string, bool) { 5165 res, ok := fpv.value.(string) 5166 return res, ok 5167 } 5168 5169 // SetTo stores value for selected field for object RegionalServerMsgEvent 5170 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) SetTo(target **ActivityLog_Event_RegionalServerMsgEvent) { 5171 if *target == nil { 5172 *target = new(ActivityLog_Event_RegionalServerMsgEvent) 5173 } 5174 switch fpv.selector { 5175 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5176 (*target).Data = fpv.value.(*anypb.Any) 5177 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5178 (*target).Time = fpv.value.(*timestamppb.Timestamp) 5179 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5180 (*target).RegionId = fpv.value.(string) 5181 default: 5182 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fpv.selector)) 5183 } 5184 } 5185 5186 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) SetToRaw(target proto.Message) { 5187 typedObject := target.(*ActivityLog_Event_RegionalServerMsgEvent) 5188 fpv.SetTo(&typedObject) 5189 } 5190 5191 // CompareWith compares value in the 'ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue' with the value under path in 'ActivityLog_Event_RegionalServerMsgEvent'. 5192 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) CompareWith(source *ActivityLog_Event_RegionalServerMsgEvent) (int, bool) { 5193 switch fpv.selector { 5194 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5195 return 0, false 5196 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5197 leftValue := fpv.value.(*timestamppb.Timestamp) 5198 rightValue := source.GetTime() 5199 if leftValue == nil { 5200 if rightValue != nil { 5201 return -1, true 5202 } 5203 return 0, true 5204 } 5205 if rightValue == nil { 5206 return 1, true 5207 } 5208 if leftValue.AsTime().Equal(rightValue.AsTime()) { 5209 return 0, true 5210 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 5211 return -1, true 5212 } else { 5213 return 1, true 5214 } 5215 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5216 leftValue := fpv.value.(string) 5217 rightValue := source.GetRegionId() 5218 if (leftValue) == (rightValue) { 5219 return 0, true 5220 } else if (leftValue) < (rightValue) { 5221 return -1, true 5222 } else { 5223 return 1, true 5224 } 5225 default: 5226 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalServerMsgEvent: %d", fpv.selector)) 5227 } 5228 } 5229 5230 func (fpv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5231 return fpv.CompareWith(source.(*ActivityLog_Event_RegionalServerMsgEvent)) 5232 } 5233 5234 // ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue allows storing single item in Path-specific values for RegionalServerMsgEvent according to their type 5235 // Present only for array (repeated) types. 5236 type ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue interface { 5237 gotenobject.FieldPathArrayItemValue 5238 ActivityLogEventRegionalServerMsgEvent_FieldPath 5239 ContainsValue(*ActivityLog_Event_RegionalServerMsgEvent) bool 5240 } 5241 5242 // ParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 5243 func ParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue, error) { 5244 fp, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPath(pathStr) 5245 if err != nil { 5246 return nil, err 5247 } 5248 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 5249 if err != nil { 5250 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegionalServerMsgEvent field path array item value from %s: %v", valueStr, err) 5251 } 5252 return fpaiv.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue), nil 5253 } 5254 5255 func MustParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue { 5256 fpaiv, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue(pathStr, valueStr) 5257 if err != nil { 5258 panic(err) 5259 } 5260 return fpaiv 5261 } 5262 5263 type ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayItemValue struct { 5264 ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath 5265 value interface{} 5266 } 5267 5268 var _ ActivityLogEventRegionalServerMsgEvent_FieldPathArrayItemValue = (*ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayItemValue)(nil) 5269 5270 // GetRawValue returns stored element value for array in object ActivityLog_Event_RegionalServerMsgEvent as interface{} 5271 func (fpaiv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 5272 return fpaiv.value 5273 } 5274 5275 func (fpaiv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Event_RegionalServerMsgEvent) (interface{}, bool) { 5276 return nil, false 5277 } 5278 5279 func (fpaiv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 5280 return fpaiv.GetSingle(source.(*ActivityLog_Event_RegionalServerMsgEvent)) 5281 } 5282 5283 // Contains returns a boolean indicating if value that is being held is present in given 'RegionalServerMsgEvent' 5284 func (fpaiv *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Event_RegionalServerMsgEvent) bool { 5285 slice := fpaiv.ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath.Get(source) 5286 for _, v := range slice { 5287 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 5288 if proto.Equal(asProtoMsg, v.(proto.Message)) { 5289 return true 5290 } 5291 } else if reflect.DeepEqual(v, fpaiv.value) { 5292 return true 5293 } 5294 } 5295 return false 5296 } 5297 5298 // ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues allows storing slice of values for RegionalServerMsgEvent fields according to their type 5299 type ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues interface { 5300 gotenobject.FieldPathArrayOfValues 5301 ActivityLogEventRegionalServerMsgEvent_FieldPath 5302 } 5303 5304 func ParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues, error) { 5305 fp, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPath(pathStr) 5306 if err != nil { 5307 return nil, err 5308 } 5309 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 5310 if err != nil { 5311 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegionalServerMsgEvent field path array of values from %s: %v", valuesStr, err) 5312 } 5313 return fpaov.(ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues), nil 5314 } 5315 5316 func MustParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues { 5317 fpaov, err := ParseActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr) 5318 if err != nil { 5319 panic(err) 5320 } 5321 return fpaov 5322 } 5323 5324 type ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues struct { 5325 ActivityLogEventRegionalServerMsgEvent_FieldTerminalPath 5326 values interface{} 5327 } 5328 5329 var _ ActivityLogEventRegionalServerMsgEvent_FieldPathArrayOfValues = (*ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues)(nil) 5330 5331 func (fpaov *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 5332 switch fpaov.selector { 5333 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorData: 5334 for _, v := range fpaov.values.([]*anypb.Any) { 5335 values = append(values, v) 5336 } 5337 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorTime: 5338 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 5339 values = append(values, v) 5340 } 5341 case ActivityLogEventRegionalServerMsgEvent_FieldPathSelectorRegionId: 5342 for _, v := range fpaov.values.([]string) { 5343 values = append(values, v) 5344 } 5345 } 5346 return 5347 } 5348 func (fpaov *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues) AsDataArrayOfValues() ([]*anypb.Any, bool) { 5349 res, ok := fpaov.values.([]*anypb.Any) 5350 return res, ok 5351 } 5352 func (fpaov *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues) AsTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 5353 res, ok := fpaov.values.([]*timestamppb.Timestamp) 5354 return res, ok 5355 } 5356 func (fpaov *ActivityLogEventRegionalServerMsgEvent_FieldTerminalPathArrayOfValues) AsRegionIdArrayOfValues() ([]string, bool) { 5357 res, ok := fpaov.values.([]string) 5358 return res, ok 5359 } 5360 5361 // FieldPath provides implementation to handle 5362 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 5363 type ActivityLogEventServerMsgEvent_FieldPath interface { 5364 gotenobject.FieldPath 5365 Selector() ActivityLogEventServerMsgEvent_FieldPathSelector 5366 Get(source *ActivityLog_Event_ServerMsgEvent) []interface{} 5367 GetSingle(source *ActivityLog_Event_ServerMsgEvent) (interface{}, bool) 5368 ClearValue(item *ActivityLog_Event_ServerMsgEvent) 5369 5370 // Those methods build corresponding ActivityLogEventServerMsgEvent_FieldPathValue 5371 // (or array of values) and holds passed value. Panics if injected type is incorrect. 5372 WithIValue(value interface{}) ActivityLogEventServerMsgEvent_FieldPathValue 5373 WithIArrayOfValues(values interface{}) ActivityLogEventServerMsgEvent_FieldPathArrayOfValues 5374 WithIArrayItemValue(value interface{}) ActivityLogEventServerMsgEvent_FieldPathArrayItemValue 5375 } 5376 5377 type ActivityLogEventServerMsgEvent_FieldPathSelector int32 5378 5379 const ( 5380 ActivityLogEventServerMsgEvent_FieldPathSelectorData ActivityLogEventServerMsgEvent_FieldPathSelector = 0 5381 ActivityLogEventServerMsgEvent_FieldPathSelectorTime ActivityLogEventServerMsgEvent_FieldPathSelector = 1 5382 ) 5383 5384 func (s ActivityLogEventServerMsgEvent_FieldPathSelector) String() string { 5385 switch s { 5386 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5387 return "data" 5388 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5389 return "time" 5390 default: 5391 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", s)) 5392 } 5393 } 5394 5395 func BuildActivityLogEventServerMsgEvent_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogEventServerMsgEvent_FieldPath, error) { 5396 if len(fp) == 0 { 5397 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Event_ServerMsgEvent") 5398 } 5399 if len(fp) == 1 { 5400 switch fp[0] { 5401 case "data": 5402 return &ActivityLogEventServerMsgEvent_FieldTerminalPath{selector: ActivityLogEventServerMsgEvent_FieldPathSelectorData}, nil 5403 case "time": 5404 return &ActivityLogEventServerMsgEvent_FieldTerminalPath{selector: ActivityLogEventServerMsgEvent_FieldPathSelectorTime}, nil 5405 } 5406 } 5407 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Event_ServerMsgEvent", fp) 5408 } 5409 5410 func ParseActivityLogEventServerMsgEvent_FieldPath(rawField string) (ActivityLogEventServerMsgEvent_FieldPath, error) { 5411 fp, err := gotenobject.ParseRawFieldPath(rawField) 5412 if err != nil { 5413 return nil, err 5414 } 5415 return BuildActivityLogEventServerMsgEvent_FieldPath(fp) 5416 } 5417 5418 func MustParseActivityLogEventServerMsgEvent_FieldPath(rawField string) ActivityLogEventServerMsgEvent_FieldPath { 5419 fp, err := ParseActivityLogEventServerMsgEvent_FieldPath(rawField) 5420 if err != nil { 5421 panic(err) 5422 } 5423 return fp 5424 } 5425 5426 type ActivityLogEventServerMsgEvent_FieldTerminalPath struct { 5427 selector ActivityLogEventServerMsgEvent_FieldPathSelector 5428 } 5429 5430 var _ ActivityLogEventServerMsgEvent_FieldPath = (*ActivityLogEventServerMsgEvent_FieldTerminalPath)(nil) 5431 5432 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) Selector() ActivityLogEventServerMsgEvent_FieldPathSelector { 5433 return fp.selector 5434 } 5435 5436 // String returns path representation in proto convention 5437 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) String() string { 5438 return fp.selector.String() 5439 } 5440 5441 // JSONString returns path representation is JSON convention 5442 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) JSONString() string { 5443 return strcase.ToLowerCamel(fp.String()) 5444 } 5445 5446 // Get returns all values pointed by specific field from source ActivityLog_Event_ServerMsgEvent 5447 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) Get(source *ActivityLog_Event_ServerMsgEvent) (values []interface{}) { 5448 if source != nil { 5449 switch fp.selector { 5450 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5451 if source.Data != nil { 5452 values = append(values, source.Data) 5453 } 5454 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5455 if source.Time != nil { 5456 values = append(values, source.Time) 5457 } 5458 default: 5459 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5460 } 5461 } 5462 return 5463 } 5464 5465 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 5466 return fp.Get(source.(*ActivityLog_Event_ServerMsgEvent)) 5467 } 5468 5469 // GetSingle returns value pointed by specific field of from source ActivityLog_Event_ServerMsgEvent 5470 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) GetSingle(source *ActivityLog_Event_ServerMsgEvent) (interface{}, bool) { 5471 switch fp.selector { 5472 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5473 res := source.GetData() 5474 return res, res != nil 5475 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5476 res := source.GetTime() 5477 return res, res != nil 5478 default: 5479 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5480 } 5481 } 5482 5483 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5484 return fp.GetSingle(source.(*ActivityLog_Event_ServerMsgEvent)) 5485 } 5486 5487 // GetDefault returns a default value of the field type 5488 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) GetDefault() interface{} { 5489 switch fp.selector { 5490 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5491 return (*anypb.Any)(nil) 5492 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5493 return (*timestamppb.Timestamp)(nil) 5494 default: 5495 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5496 } 5497 } 5498 5499 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) ClearValue(item *ActivityLog_Event_ServerMsgEvent) { 5500 if item != nil { 5501 switch fp.selector { 5502 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5503 item.Data = nil 5504 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5505 item.Time = nil 5506 default: 5507 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5508 } 5509 } 5510 } 5511 5512 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) ClearValueRaw(item proto.Message) { 5513 fp.ClearValue(item.(*ActivityLog_Event_ServerMsgEvent)) 5514 } 5515 5516 // IsLeaf - whether field path is holds simple value 5517 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) IsLeaf() bool { 5518 return fp.selector == ActivityLogEventServerMsgEvent_FieldPathSelectorData || 5519 fp.selector == ActivityLogEventServerMsgEvent_FieldPathSelectorTime 5520 } 5521 5522 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5523 return []gotenobject.FieldPath{fp} 5524 } 5525 5526 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) WithIValue(value interface{}) ActivityLogEventServerMsgEvent_FieldPathValue { 5527 switch fp.selector { 5528 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5529 return &ActivityLogEventServerMsgEvent_FieldTerminalPathValue{ActivityLogEventServerMsgEvent_FieldTerminalPath: *fp, value: value.(*anypb.Any)} 5530 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5531 return &ActivityLogEventServerMsgEvent_FieldTerminalPathValue{ActivityLogEventServerMsgEvent_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 5532 default: 5533 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5534 } 5535 } 5536 5537 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5538 return fp.WithIValue(value) 5539 } 5540 5541 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogEventServerMsgEvent_FieldPathArrayOfValues { 5542 fpaov := &ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventServerMsgEvent_FieldTerminalPath: *fp} 5543 switch fp.selector { 5544 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5545 return &ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventServerMsgEvent_FieldTerminalPath: *fp, values: values.([]*anypb.Any)} 5546 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5547 return &ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues{ActivityLogEventServerMsgEvent_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 5548 default: 5549 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5550 } 5551 return fpaov 5552 } 5553 5554 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5555 return fp.WithIArrayOfValues(values) 5556 } 5557 5558 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogEventServerMsgEvent_FieldPathArrayItemValue { 5559 switch fp.selector { 5560 default: 5561 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fp.selector)) 5562 } 5563 } 5564 5565 func (fp *ActivityLogEventServerMsgEvent_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5566 return fp.WithIArrayItemValue(value) 5567 } 5568 5569 // ActivityLogEventServerMsgEvent_FieldPathValue allows storing values for ServerMsgEvent fields according to their type 5570 type ActivityLogEventServerMsgEvent_FieldPathValue interface { 5571 ActivityLogEventServerMsgEvent_FieldPath 5572 gotenobject.FieldPathValue 5573 SetTo(target **ActivityLog_Event_ServerMsgEvent) 5574 CompareWith(*ActivityLog_Event_ServerMsgEvent) (cmp int, comparable bool) 5575 } 5576 5577 func ParseActivityLogEventServerMsgEvent_FieldPathValue(pathStr, valueStr string) (ActivityLogEventServerMsgEvent_FieldPathValue, error) { 5578 fp, err := ParseActivityLogEventServerMsgEvent_FieldPath(pathStr) 5579 if err != nil { 5580 return nil, err 5581 } 5582 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 5583 if err != nil { 5584 return nil, status.Errorf(codes.InvalidArgument, "error parsing ServerMsgEvent field path value from %s: %v", valueStr, err) 5585 } 5586 return fpv.(ActivityLogEventServerMsgEvent_FieldPathValue), nil 5587 } 5588 5589 func MustParseActivityLogEventServerMsgEvent_FieldPathValue(pathStr, valueStr string) ActivityLogEventServerMsgEvent_FieldPathValue { 5590 fpv, err := ParseActivityLogEventServerMsgEvent_FieldPathValue(pathStr, valueStr) 5591 if err != nil { 5592 panic(err) 5593 } 5594 return fpv 5595 } 5596 5597 type ActivityLogEventServerMsgEvent_FieldTerminalPathValue struct { 5598 ActivityLogEventServerMsgEvent_FieldTerminalPath 5599 value interface{} 5600 } 5601 5602 var _ ActivityLogEventServerMsgEvent_FieldPathValue = (*ActivityLogEventServerMsgEvent_FieldTerminalPathValue)(nil) 5603 5604 // GetRawValue returns raw value stored under selected path for 'ServerMsgEvent' as interface{} 5605 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) GetRawValue() interface{} { 5606 return fpv.value 5607 } 5608 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) AsDataValue() (*anypb.Any, bool) { 5609 res, ok := fpv.value.(*anypb.Any) 5610 return res, ok 5611 } 5612 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) AsTimeValue() (*timestamppb.Timestamp, bool) { 5613 res, ok := fpv.value.(*timestamppb.Timestamp) 5614 return res, ok 5615 } 5616 5617 // SetTo stores value for selected field for object ServerMsgEvent 5618 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) SetTo(target **ActivityLog_Event_ServerMsgEvent) { 5619 if *target == nil { 5620 *target = new(ActivityLog_Event_ServerMsgEvent) 5621 } 5622 switch fpv.selector { 5623 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5624 (*target).Data = fpv.value.(*anypb.Any) 5625 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5626 (*target).Time = fpv.value.(*timestamppb.Timestamp) 5627 default: 5628 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fpv.selector)) 5629 } 5630 } 5631 5632 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) SetToRaw(target proto.Message) { 5633 typedObject := target.(*ActivityLog_Event_ServerMsgEvent) 5634 fpv.SetTo(&typedObject) 5635 } 5636 5637 // CompareWith compares value in the 'ActivityLogEventServerMsgEvent_FieldTerminalPathValue' with the value under path in 'ActivityLog_Event_ServerMsgEvent'. 5638 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) CompareWith(source *ActivityLog_Event_ServerMsgEvent) (int, bool) { 5639 switch fpv.selector { 5640 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5641 return 0, false 5642 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5643 leftValue := fpv.value.(*timestamppb.Timestamp) 5644 rightValue := source.GetTime() 5645 if leftValue == nil { 5646 if rightValue != nil { 5647 return -1, true 5648 } 5649 return 0, true 5650 } 5651 if rightValue == nil { 5652 return 1, true 5653 } 5654 if leftValue.AsTime().Equal(rightValue.AsTime()) { 5655 return 0, true 5656 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 5657 return -1, true 5658 } else { 5659 return 1, true 5660 } 5661 default: 5662 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ServerMsgEvent: %d", fpv.selector)) 5663 } 5664 } 5665 5666 func (fpv *ActivityLogEventServerMsgEvent_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5667 return fpv.CompareWith(source.(*ActivityLog_Event_ServerMsgEvent)) 5668 } 5669 5670 // ActivityLogEventServerMsgEvent_FieldPathArrayItemValue allows storing single item in Path-specific values for ServerMsgEvent according to their type 5671 // Present only for array (repeated) types. 5672 type ActivityLogEventServerMsgEvent_FieldPathArrayItemValue interface { 5673 gotenobject.FieldPathArrayItemValue 5674 ActivityLogEventServerMsgEvent_FieldPath 5675 ContainsValue(*ActivityLog_Event_ServerMsgEvent) bool 5676 } 5677 5678 // ParseActivityLogEventServerMsgEvent_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 5679 func ParseActivityLogEventServerMsgEvent_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogEventServerMsgEvent_FieldPathArrayItemValue, error) { 5680 fp, err := ParseActivityLogEventServerMsgEvent_FieldPath(pathStr) 5681 if err != nil { 5682 return nil, err 5683 } 5684 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 5685 if err != nil { 5686 return nil, status.Errorf(codes.InvalidArgument, "error parsing ServerMsgEvent field path array item value from %s: %v", valueStr, err) 5687 } 5688 return fpaiv.(ActivityLogEventServerMsgEvent_FieldPathArrayItemValue), nil 5689 } 5690 5691 func MustParseActivityLogEventServerMsgEvent_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogEventServerMsgEvent_FieldPathArrayItemValue { 5692 fpaiv, err := ParseActivityLogEventServerMsgEvent_FieldPathArrayItemValue(pathStr, valueStr) 5693 if err != nil { 5694 panic(err) 5695 } 5696 return fpaiv 5697 } 5698 5699 type ActivityLogEventServerMsgEvent_FieldTerminalPathArrayItemValue struct { 5700 ActivityLogEventServerMsgEvent_FieldTerminalPath 5701 value interface{} 5702 } 5703 5704 var _ ActivityLogEventServerMsgEvent_FieldPathArrayItemValue = (*ActivityLogEventServerMsgEvent_FieldTerminalPathArrayItemValue)(nil) 5705 5706 // GetRawValue returns stored element value for array in object ActivityLog_Event_ServerMsgEvent as interface{} 5707 func (fpaiv *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 5708 return fpaiv.value 5709 } 5710 5711 func (fpaiv *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Event_ServerMsgEvent) (interface{}, bool) { 5712 return nil, false 5713 } 5714 5715 func (fpaiv *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 5716 return fpaiv.GetSingle(source.(*ActivityLog_Event_ServerMsgEvent)) 5717 } 5718 5719 // Contains returns a boolean indicating if value that is being held is present in given 'ServerMsgEvent' 5720 func (fpaiv *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Event_ServerMsgEvent) bool { 5721 slice := fpaiv.ActivityLogEventServerMsgEvent_FieldTerminalPath.Get(source) 5722 for _, v := range slice { 5723 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 5724 if proto.Equal(asProtoMsg, v.(proto.Message)) { 5725 return true 5726 } 5727 } else if reflect.DeepEqual(v, fpaiv.value) { 5728 return true 5729 } 5730 } 5731 return false 5732 } 5733 5734 // ActivityLogEventServerMsgEvent_FieldPathArrayOfValues allows storing slice of values for ServerMsgEvent fields according to their type 5735 type ActivityLogEventServerMsgEvent_FieldPathArrayOfValues interface { 5736 gotenobject.FieldPathArrayOfValues 5737 ActivityLogEventServerMsgEvent_FieldPath 5738 } 5739 5740 func ParseActivityLogEventServerMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogEventServerMsgEvent_FieldPathArrayOfValues, error) { 5741 fp, err := ParseActivityLogEventServerMsgEvent_FieldPath(pathStr) 5742 if err != nil { 5743 return nil, err 5744 } 5745 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 5746 if err != nil { 5747 return nil, status.Errorf(codes.InvalidArgument, "error parsing ServerMsgEvent field path array of values from %s: %v", valuesStr, err) 5748 } 5749 return fpaov.(ActivityLogEventServerMsgEvent_FieldPathArrayOfValues), nil 5750 } 5751 5752 func MustParseActivityLogEventServerMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogEventServerMsgEvent_FieldPathArrayOfValues { 5753 fpaov, err := ParseActivityLogEventServerMsgEvent_FieldPathArrayOfValues(pathStr, valuesStr) 5754 if err != nil { 5755 panic(err) 5756 } 5757 return fpaov 5758 } 5759 5760 type ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues struct { 5761 ActivityLogEventServerMsgEvent_FieldTerminalPath 5762 values interface{} 5763 } 5764 5765 var _ ActivityLogEventServerMsgEvent_FieldPathArrayOfValues = (*ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues)(nil) 5766 5767 func (fpaov *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 5768 switch fpaov.selector { 5769 case ActivityLogEventServerMsgEvent_FieldPathSelectorData: 5770 for _, v := range fpaov.values.([]*anypb.Any) { 5771 values = append(values, v) 5772 } 5773 case ActivityLogEventServerMsgEvent_FieldPathSelectorTime: 5774 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 5775 values = append(values, v) 5776 } 5777 } 5778 return 5779 } 5780 func (fpaov *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues) AsDataArrayOfValues() ([]*anypb.Any, bool) { 5781 res, ok := fpaov.values.([]*anypb.Any) 5782 return res, ok 5783 } 5784 func (fpaov *ActivityLogEventServerMsgEvent_FieldTerminalPathArrayOfValues) AsTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 5785 res, ok := fpaov.values.([]*timestamppb.Timestamp) 5786 return res, ok 5787 } 5788 5789 // FieldPath provides implementation to handle 5790 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 5791 type ActivityLogEventRegionalExitEvent_FieldPath interface { 5792 gotenobject.FieldPath 5793 Selector() ActivityLogEventRegionalExitEvent_FieldPathSelector 5794 Get(source *ActivityLog_Event_RegionalExitEvent) []interface{} 5795 GetSingle(source *ActivityLog_Event_RegionalExitEvent) (interface{}, bool) 5796 ClearValue(item *ActivityLog_Event_RegionalExitEvent) 5797 5798 // Those methods build corresponding ActivityLogEventRegionalExitEvent_FieldPathValue 5799 // (or array of values) and holds passed value. Panics if injected type is incorrect. 5800 WithIValue(value interface{}) ActivityLogEventRegionalExitEvent_FieldPathValue 5801 WithIArrayOfValues(values interface{}) ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues 5802 WithIArrayItemValue(value interface{}) ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue 5803 } 5804 5805 type ActivityLogEventRegionalExitEvent_FieldPathSelector int32 5806 5807 const ( 5808 ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus ActivityLogEventRegionalExitEvent_FieldPathSelector = 0 5809 ActivityLogEventRegionalExitEvent_FieldPathSelectorTime ActivityLogEventRegionalExitEvent_FieldPathSelector = 1 5810 ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId ActivityLogEventRegionalExitEvent_FieldPathSelector = 2 5811 ) 5812 5813 func (s ActivityLogEventRegionalExitEvent_FieldPathSelector) String() string { 5814 switch s { 5815 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5816 return "status" 5817 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5818 return "time" 5819 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 5820 return "region_id" 5821 default: 5822 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", s)) 5823 } 5824 } 5825 5826 func BuildActivityLogEventRegionalExitEvent_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogEventRegionalExitEvent_FieldPath, error) { 5827 if len(fp) == 0 { 5828 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Event_RegionalExitEvent") 5829 } 5830 if len(fp) == 1 { 5831 switch fp[0] { 5832 case "status": 5833 return &ActivityLogEventRegionalExitEvent_FieldTerminalPath{selector: ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus}, nil 5834 case "time": 5835 return &ActivityLogEventRegionalExitEvent_FieldTerminalPath{selector: ActivityLogEventRegionalExitEvent_FieldPathSelectorTime}, nil 5836 case "region_id", "regionId", "region-id": 5837 return &ActivityLogEventRegionalExitEvent_FieldTerminalPath{selector: ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId}, nil 5838 } 5839 } else { 5840 switch fp[0] { 5841 case "status": 5842 if subpath, err := rpc.BuildStatus_FieldPath(fp[1:]); err != nil { 5843 return nil, err 5844 } else { 5845 return &ActivityLogEventRegionalExitEvent_FieldSubPath{selector: ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus, subPath: subpath}, nil 5846 } 5847 } 5848 } 5849 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Event_RegionalExitEvent", fp) 5850 } 5851 5852 func ParseActivityLogEventRegionalExitEvent_FieldPath(rawField string) (ActivityLogEventRegionalExitEvent_FieldPath, error) { 5853 fp, err := gotenobject.ParseRawFieldPath(rawField) 5854 if err != nil { 5855 return nil, err 5856 } 5857 return BuildActivityLogEventRegionalExitEvent_FieldPath(fp) 5858 } 5859 5860 func MustParseActivityLogEventRegionalExitEvent_FieldPath(rawField string) ActivityLogEventRegionalExitEvent_FieldPath { 5861 fp, err := ParseActivityLogEventRegionalExitEvent_FieldPath(rawField) 5862 if err != nil { 5863 panic(err) 5864 } 5865 return fp 5866 } 5867 5868 type ActivityLogEventRegionalExitEvent_FieldTerminalPath struct { 5869 selector ActivityLogEventRegionalExitEvent_FieldPathSelector 5870 } 5871 5872 var _ ActivityLogEventRegionalExitEvent_FieldPath = (*ActivityLogEventRegionalExitEvent_FieldTerminalPath)(nil) 5873 5874 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) Selector() ActivityLogEventRegionalExitEvent_FieldPathSelector { 5875 return fp.selector 5876 } 5877 5878 // String returns path representation in proto convention 5879 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) String() string { 5880 return fp.selector.String() 5881 } 5882 5883 // JSONString returns path representation is JSON convention 5884 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) JSONString() string { 5885 return strcase.ToLowerCamel(fp.String()) 5886 } 5887 5888 // Get returns all values pointed by specific field from source ActivityLog_Event_RegionalExitEvent 5889 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) Get(source *ActivityLog_Event_RegionalExitEvent) (values []interface{}) { 5890 if source != nil { 5891 switch fp.selector { 5892 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5893 if source.Status != nil { 5894 values = append(values, source.Status) 5895 } 5896 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5897 if source.Time != nil { 5898 values = append(values, source.Time) 5899 } 5900 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 5901 values = append(values, source.RegionId) 5902 default: 5903 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 5904 } 5905 } 5906 return 5907 } 5908 5909 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 5910 return fp.Get(source.(*ActivityLog_Event_RegionalExitEvent)) 5911 } 5912 5913 // GetSingle returns value pointed by specific field of from source ActivityLog_Event_RegionalExitEvent 5914 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) GetSingle(source *ActivityLog_Event_RegionalExitEvent) (interface{}, bool) { 5915 switch fp.selector { 5916 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5917 res := source.GetStatus() 5918 return res, res != nil 5919 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5920 res := source.GetTime() 5921 return res, res != nil 5922 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 5923 return source.GetRegionId(), source != nil 5924 default: 5925 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 5926 } 5927 } 5928 5929 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5930 return fp.GetSingle(source.(*ActivityLog_Event_RegionalExitEvent)) 5931 } 5932 5933 // GetDefault returns a default value of the field type 5934 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) GetDefault() interface{} { 5935 switch fp.selector { 5936 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5937 return (*rpc.Status)(nil) 5938 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5939 return (*timestamppb.Timestamp)(nil) 5940 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 5941 return "" 5942 default: 5943 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 5944 } 5945 } 5946 5947 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) ClearValue(item *ActivityLog_Event_RegionalExitEvent) { 5948 if item != nil { 5949 switch fp.selector { 5950 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5951 item.Status = nil 5952 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5953 item.Time = nil 5954 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 5955 item.RegionId = "" 5956 default: 5957 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 5958 } 5959 } 5960 } 5961 5962 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) ClearValueRaw(item proto.Message) { 5963 fp.ClearValue(item.(*ActivityLog_Event_RegionalExitEvent)) 5964 } 5965 5966 // IsLeaf - whether field path is holds simple value 5967 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) IsLeaf() bool { 5968 return fp.selector == ActivityLogEventRegionalExitEvent_FieldPathSelectorTime || 5969 fp.selector == ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId 5970 } 5971 5972 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5973 return []gotenobject.FieldPath{fp} 5974 } 5975 5976 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) WithIValue(value interface{}) ActivityLogEventRegionalExitEvent_FieldPathValue { 5977 switch fp.selector { 5978 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5979 return &ActivityLogEventRegionalExitEvent_FieldTerminalPathValue{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp, value: value.(*rpc.Status)} 5980 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5981 return &ActivityLogEventRegionalExitEvent_FieldTerminalPathValue{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 5982 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 5983 return &ActivityLogEventRegionalExitEvent_FieldTerminalPathValue{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp, value: value.(string)} 5984 default: 5985 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 5986 } 5987 } 5988 5989 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5990 return fp.WithIValue(value) 5991 } 5992 5993 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues { 5994 fpaov := &ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp} 5995 switch fp.selector { 5996 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 5997 return &ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp, values: values.([]*rpc.Status)} 5998 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 5999 return &ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 6000 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 6001 return &ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventRegionalExitEvent_FieldTerminalPath: *fp, values: values.([]string)} 6002 default: 6003 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 6004 } 6005 return fpaov 6006 } 6007 6008 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6009 return fp.WithIArrayOfValues(values) 6010 } 6011 6012 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue { 6013 switch fp.selector { 6014 default: 6015 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fp.selector)) 6016 } 6017 } 6018 6019 func (fp *ActivityLogEventRegionalExitEvent_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6020 return fp.WithIArrayItemValue(value) 6021 } 6022 6023 type ActivityLogEventRegionalExitEvent_FieldSubPath struct { 6024 selector ActivityLogEventRegionalExitEvent_FieldPathSelector 6025 subPath gotenobject.FieldPath 6026 } 6027 6028 var _ ActivityLogEventRegionalExitEvent_FieldPath = (*ActivityLogEventRegionalExitEvent_FieldSubPath)(nil) 6029 6030 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) Selector() ActivityLogEventRegionalExitEvent_FieldPathSelector { 6031 return fps.selector 6032 } 6033 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) AsStatusSubPath() (rpc.Status_FieldPath, bool) { 6034 res, ok := fps.subPath.(rpc.Status_FieldPath) 6035 return res, ok 6036 } 6037 6038 // String returns path representation in proto convention 6039 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) String() string { 6040 return fps.selector.String() + "." + fps.subPath.String() 6041 } 6042 6043 // JSONString returns path representation is JSON convention 6044 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) JSONString() string { 6045 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 6046 } 6047 6048 // Get returns all values pointed by selected field from source ActivityLog_Event_RegionalExitEvent 6049 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) Get(source *ActivityLog_Event_RegionalExitEvent) (values []interface{}) { 6050 switch fps.selector { 6051 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6052 values = append(values, fps.subPath.GetRaw(source.GetStatus())...) 6053 default: 6054 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fps.selector)) 6055 } 6056 return 6057 } 6058 6059 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) GetRaw(source proto.Message) []interface{} { 6060 return fps.Get(source.(*ActivityLog_Event_RegionalExitEvent)) 6061 } 6062 6063 // GetSingle returns value of selected field from source ActivityLog_Event_RegionalExitEvent 6064 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) GetSingle(source *ActivityLog_Event_RegionalExitEvent) (interface{}, bool) { 6065 switch fps.selector { 6066 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6067 if source.GetStatus() == nil { 6068 return nil, false 6069 } 6070 return fps.subPath.GetSingleRaw(source.GetStatus()) 6071 default: 6072 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fps.selector)) 6073 } 6074 } 6075 6076 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6077 return fps.GetSingle(source.(*ActivityLog_Event_RegionalExitEvent)) 6078 } 6079 6080 // GetDefault returns a default value of the field type 6081 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) GetDefault() interface{} { 6082 return fps.subPath.GetDefault() 6083 } 6084 6085 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) ClearValue(item *ActivityLog_Event_RegionalExitEvent) { 6086 if item != nil { 6087 switch fps.selector { 6088 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6089 fps.subPath.ClearValueRaw(item.Status) 6090 default: 6091 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fps.selector)) 6092 } 6093 } 6094 } 6095 6096 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) ClearValueRaw(item proto.Message) { 6097 fps.ClearValue(item.(*ActivityLog_Event_RegionalExitEvent)) 6098 } 6099 6100 // IsLeaf - whether field path is holds simple value 6101 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) IsLeaf() bool { 6102 return fps.subPath.IsLeaf() 6103 } 6104 6105 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6106 iPaths := []gotenobject.FieldPath{&ActivityLogEventRegionalExitEvent_FieldTerminalPath{selector: fps.selector}} 6107 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 6108 return iPaths 6109 } 6110 6111 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) WithIValue(value interface{}) ActivityLogEventRegionalExitEvent_FieldPathValue { 6112 return &ActivityLogEventRegionalExitEvent_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 6113 } 6114 6115 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6116 return fps.WithIValue(value) 6117 } 6118 6119 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) WithIArrayOfValues(values interface{}) ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues { 6120 return &ActivityLogEventRegionalExitEvent_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 6121 } 6122 6123 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6124 return fps.WithIArrayOfValues(values) 6125 } 6126 6127 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) WithIArrayItemValue(value interface{}) ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue { 6128 return &ActivityLogEventRegionalExitEvent_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 6129 } 6130 6131 func (fps *ActivityLogEventRegionalExitEvent_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6132 return fps.WithIArrayItemValue(value) 6133 } 6134 6135 // ActivityLogEventRegionalExitEvent_FieldPathValue allows storing values for RegionalExitEvent fields according to their type 6136 type ActivityLogEventRegionalExitEvent_FieldPathValue interface { 6137 ActivityLogEventRegionalExitEvent_FieldPath 6138 gotenobject.FieldPathValue 6139 SetTo(target **ActivityLog_Event_RegionalExitEvent) 6140 CompareWith(*ActivityLog_Event_RegionalExitEvent) (cmp int, comparable bool) 6141 } 6142 6143 func ParseActivityLogEventRegionalExitEvent_FieldPathValue(pathStr, valueStr string) (ActivityLogEventRegionalExitEvent_FieldPathValue, error) { 6144 fp, err := ParseActivityLogEventRegionalExitEvent_FieldPath(pathStr) 6145 if err != nil { 6146 return nil, err 6147 } 6148 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 6149 if err != nil { 6150 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegionalExitEvent field path value from %s: %v", valueStr, err) 6151 } 6152 return fpv.(ActivityLogEventRegionalExitEvent_FieldPathValue), nil 6153 } 6154 6155 func MustParseActivityLogEventRegionalExitEvent_FieldPathValue(pathStr, valueStr string) ActivityLogEventRegionalExitEvent_FieldPathValue { 6156 fpv, err := ParseActivityLogEventRegionalExitEvent_FieldPathValue(pathStr, valueStr) 6157 if err != nil { 6158 panic(err) 6159 } 6160 return fpv 6161 } 6162 6163 type ActivityLogEventRegionalExitEvent_FieldTerminalPathValue struct { 6164 ActivityLogEventRegionalExitEvent_FieldTerminalPath 6165 value interface{} 6166 } 6167 6168 var _ ActivityLogEventRegionalExitEvent_FieldPathValue = (*ActivityLogEventRegionalExitEvent_FieldTerminalPathValue)(nil) 6169 6170 // GetRawValue returns raw value stored under selected path for 'RegionalExitEvent' as interface{} 6171 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) GetRawValue() interface{} { 6172 return fpv.value 6173 } 6174 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) AsStatusValue() (*rpc.Status, bool) { 6175 res, ok := fpv.value.(*rpc.Status) 6176 return res, ok 6177 } 6178 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) AsTimeValue() (*timestamppb.Timestamp, bool) { 6179 res, ok := fpv.value.(*timestamppb.Timestamp) 6180 return res, ok 6181 } 6182 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) AsRegionIdValue() (string, bool) { 6183 res, ok := fpv.value.(string) 6184 return res, ok 6185 } 6186 6187 // SetTo stores value for selected field for object RegionalExitEvent 6188 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) SetTo(target **ActivityLog_Event_RegionalExitEvent) { 6189 if *target == nil { 6190 *target = new(ActivityLog_Event_RegionalExitEvent) 6191 } 6192 switch fpv.selector { 6193 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6194 (*target).Status = fpv.value.(*rpc.Status) 6195 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 6196 (*target).Time = fpv.value.(*timestamppb.Timestamp) 6197 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 6198 (*target).RegionId = fpv.value.(string) 6199 default: 6200 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fpv.selector)) 6201 } 6202 } 6203 6204 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) SetToRaw(target proto.Message) { 6205 typedObject := target.(*ActivityLog_Event_RegionalExitEvent) 6206 fpv.SetTo(&typedObject) 6207 } 6208 6209 // CompareWith compares value in the 'ActivityLogEventRegionalExitEvent_FieldTerminalPathValue' with the value under path in 'ActivityLog_Event_RegionalExitEvent'. 6210 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) CompareWith(source *ActivityLog_Event_RegionalExitEvent) (int, bool) { 6211 switch fpv.selector { 6212 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6213 return 0, false 6214 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 6215 leftValue := fpv.value.(*timestamppb.Timestamp) 6216 rightValue := source.GetTime() 6217 if leftValue == nil { 6218 if rightValue != nil { 6219 return -1, true 6220 } 6221 return 0, true 6222 } 6223 if rightValue == nil { 6224 return 1, true 6225 } 6226 if leftValue.AsTime().Equal(rightValue.AsTime()) { 6227 return 0, true 6228 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 6229 return -1, true 6230 } else { 6231 return 1, true 6232 } 6233 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 6234 leftValue := fpv.value.(string) 6235 rightValue := source.GetRegionId() 6236 if (leftValue) == (rightValue) { 6237 return 0, true 6238 } else if (leftValue) < (rightValue) { 6239 return -1, true 6240 } else { 6241 return 1, true 6242 } 6243 default: 6244 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fpv.selector)) 6245 } 6246 } 6247 6248 func (fpv *ActivityLogEventRegionalExitEvent_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6249 return fpv.CompareWith(source.(*ActivityLog_Event_RegionalExitEvent)) 6250 } 6251 6252 type ActivityLogEventRegionalExitEvent_FieldSubPathValue struct { 6253 ActivityLogEventRegionalExitEvent_FieldPath 6254 subPathValue gotenobject.FieldPathValue 6255 } 6256 6257 var _ ActivityLogEventRegionalExitEvent_FieldPathValue = (*ActivityLogEventRegionalExitEvent_FieldSubPathValue)(nil) 6258 6259 func (fpvs *ActivityLogEventRegionalExitEvent_FieldSubPathValue) AsStatusPathValue() (rpc.Status_FieldPathValue, bool) { 6260 res, ok := fpvs.subPathValue.(rpc.Status_FieldPathValue) 6261 return res, ok 6262 } 6263 6264 func (fpvs *ActivityLogEventRegionalExitEvent_FieldSubPathValue) SetTo(target **ActivityLog_Event_RegionalExitEvent) { 6265 if *target == nil { 6266 *target = new(ActivityLog_Event_RegionalExitEvent) 6267 } 6268 switch fpvs.Selector() { 6269 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6270 fpvs.subPathValue.(rpc.Status_FieldPathValue).SetTo(&(*target).Status) 6271 default: 6272 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fpvs.Selector())) 6273 } 6274 } 6275 6276 func (fpvs *ActivityLogEventRegionalExitEvent_FieldSubPathValue) SetToRaw(target proto.Message) { 6277 typedObject := target.(*ActivityLog_Event_RegionalExitEvent) 6278 fpvs.SetTo(&typedObject) 6279 } 6280 6281 func (fpvs *ActivityLogEventRegionalExitEvent_FieldSubPathValue) GetRawValue() interface{} { 6282 return fpvs.subPathValue.GetRawValue() 6283 } 6284 6285 func (fpvs *ActivityLogEventRegionalExitEvent_FieldSubPathValue) CompareWith(source *ActivityLog_Event_RegionalExitEvent) (int, bool) { 6286 switch fpvs.Selector() { 6287 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6288 return fpvs.subPathValue.(rpc.Status_FieldPathValue).CompareWith(source.GetStatus()) 6289 default: 6290 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fpvs.Selector())) 6291 } 6292 } 6293 6294 func (fpvs *ActivityLogEventRegionalExitEvent_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6295 return fpvs.CompareWith(source.(*ActivityLog_Event_RegionalExitEvent)) 6296 } 6297 6298 // ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue allows storing single item in Path-specific values for RegionalExitEvent according to their type 6299 // Present only for array (repeated) types. 6300 type ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue interface { 6301 gotenobject.FieldPathArrayItemValue 6302 ActivityLogEventRegionalExitEvent_FieldPath 6303 ContainsValue(*ActivityLog_Event_RegionalExitEvent) bool 6304 } 6305 6306 // ParseActivityLogEventRegionalExitEvent_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 6307 func ParseActivityLogEventRegionalExitEvent_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue, error) { 6308 fp, err := ParseActivityLogEventRegionalExitEvent_FieldPath(pathStr) 6309 if err != nil { 6310 return nil, err 6311 } 6312 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 6313 if err != nil { 6314 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegionalExitEvent field path array item value from %s: %v", valueStr, err) 6315 } 6316 return fpaiv.(ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue), nil 6317 } 6318 6319 func MustParseActivityLogEventRegionalExitEvent_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue { 6320 fpaiv, err := ParseActivityLogEventRegionalExitEvent_FieldPathArrayItemValue(pathStr, valueStr) 6321 if err != nil { 6322 panic(err) 6323 } 6324 return fpaiv 6325 } 6326 6327 type ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayItemValue struct { 6328 ActivityLogEventRegionalExitEvent_FieldTerminalPath 6329 value interface{} 6330 } 6331 6332 var _ ActivityLogEventRegionalExitEvent_FieldPathArrayItemValue = (*ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayItemValue)(nil) 6333 6334 // GetRawValue returns stored element value for array in object ActivityLog_Event_RegionalExitEvent as interface{} 6335 func (fpaiv *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 6336 return fpaiv.value 6337 } 6338 6339 func (fpaiv *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Event_RegionalExitEvent) (interface{}, bool) { 6340 return nil, false 6341 } 6342 6343 func (fpaiv *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 6344 return fpaiv.GetSingle(source.(*ActivityLog_Event_RegionalExitEvent)) 6345 } 6346 6347 // Contains returns a boolean indicating if value that is being held is present in given 'RegionalExitEvent' 6348 func (fpaiv *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Event_RegionalExitEvent) bool { 6349 slice := fpaiv.ActivityLogEventRegionalExitEvent_FieldTerminalPath.Get(source) 6350 for _, v := range slice { 6351 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 6352 if proto.Equal(asProtoMsg, v.(proto.Message)) { 6353 return true 6354 } 6355 } else if reflect.DeepEqual(v, fpaiv.value) { 6356 return true 6357 } 6358 } 6359 return false 6360 } 6361 6362 type ActivityLogEventRegionalExitEvent_FieldSubPathArrayItemValue struct { 6363 ActivityLogEventRegionalExitEvent_FieldPath 6364 subPathItemValue gotenobject.FieldPathArrayItemValue 6365 } 6366 6367 // GetRawValue returns stored array item value 6368 func (fpaivs *ActivityLogEventRegionalExitEvent_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 6369 return fpaivs.subPathItemValue.GetRawItemValue() 6370 } 6371 func (fpaivs *ActivityLogEventRegionalExitEvent_FieldSubPathArrayItemValue) AsStatusPathItemValue() (rpc.Status_FieldPathArrayItemValue, bool) { 6372 res, ok := fpaivs.subPathItemValue.(rpc.Status_FieldPathArrayItemValue) 6373 return res, ok 6374 } 6375 6376 // Contains returns a boolean indicating if value that is being held is present in given 'RegionalExitEvent' 6377 func (fpaivs *ActivityLogEventRegionalExitEvent_FieldSubPathArrayItemValue) ContainsValue(source *ActivityLog_Event_RegionalExitEvent) bool { 6378 switch fpaivs.Selector() { 6379 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6380 return fpaivs.subPathItemValue.(rpc.Status_FieldPathArrayItemValue).ContainsValue(source.GetStatus()) 6381 default: 6382 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_RegionalExitEvent: %d", fpaivs.Selector())) 6383 } 6384 } 6385 6386 // ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues allows storing slice of values for RegionalExitEvent fields according to their type 6387 type ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues interface { 6388 gotenobject.FieldPathArrayOfValues 6389 ActivityLogEventRegionalExitEvent_FieldPath 6390 } 6391 6392 func ParseActivityLogEventRegionalExitEvent_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues, error) { 6393 fp, err := ParseActivityLogEventRegionalExitEvent_FieldPath(pathStr) 6394 if err != nil { 6395 return nil, err 6396 } 6397 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 6398 if err != nil { 6399 return nil, status.Errorf(codes.InvalidArgument, "error parsing RegionalExitEvent field path array of values from %s: %v", valuesStr, err) 6400 } 6401 return fpaov.(ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues), nil 6402 } 6403 6404 func MustParseActivityLogEventRegionalExitEvent_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues { 6405 fpaov, err := ParseActivityLogEventRegionalExitEvent_FieldPathArrayOfValues(pathStr, valuesStr) 6406 if err != nil { 6407 panic(err) 6408 } 6409 return fpaov 6410 } 6411 6412 type ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues struct { 6413 ActivityLogEventRegionalExitEvent_FieldTerminalPath 6414 values interface{} 6415 } 6416 6417 var _ ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues = (*ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues)(nil) 6418 6419 func (fpaov *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 6420 switch fpaov.selector { 6421 case ActivityLogEventRegionalExitEvent_FieldPathSelectorStatus: 6422 for _, v := range fpaov.values.([]*rpc.Status) { 6423 values = append(values, v) 6424 } 6425 case ActivityLogEventRegionalExitEvent_FieldPathSelectorTime: 6426 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 6427 values = append(values, v) 6428 } 6429 case ActivityLogEventRegionalExitEvent_FieldPathSelectorRegionId: 6430 for _, v := range fpaov.values.([]string) { 6431 values = append(values, v) 6432 } 6433 } 6434 return 6435 } 6436 func (fpaov *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues) AsStatusArrayOfValues() ([]*rpc.Status, bool) { 6437 res, ok := fpaov.values.([]*rpc.Status) 6438 return res, ok 6439 } 6440 func (fpaov *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues) AsTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 6441 res, ok := fpaov.values.([]*timestamppb.Timestamp) 6442 return res, ok 6443 } 6444 func (fpaov *ActivityLogEventRegionalExitEvent_FieldTerminalPathArrayOfValues) AsRegionIdArrayOfValues() ([]string, bool) { 6445 res, ok := fpaov.values.([]string) 6446 return res, ok 6447 } 6448 6449 type ActivityLogEventRegionalExitEvent_FieldSubPathArrayOfValues struct { 6450 ActivityLogEventRegionalExitEvent_FieldPath 6451 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 6452 } 6453 6454 var _ ActivityLogEventRegionalExitEvent_FieldPathArrayOfValues = (*ActivityLogEventRegionalExitEvent_FieldSubPathArrayOfValues)(nil) 6455 6456 func (fpsaov *ActivityLogEventRegionalExitEvent_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 6457 return fpsaov.subPathArrayOfValues.GetRawValues() 6458 } 6459 func (fpsaov *ActivityLogEventRegionalExitEvent_FieldSubPathArrayOfValues) AsStatusPathArrayOfValues() (rpc.Status_FieldPathArrayOfValues, bool) { 6460 res, ok := fpsaov.subPathArrayOfValues.(rpc.Status_FieldPathArrayOfValues) 6461 return res, ok 6462 } 6463 6464 // FieldPath provides implementation to handle 6465 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 6466 type ActivityLogEventExitEvent_FieldPath interface { 6467 gotenobject.FieldPath 6468 Selector() ActivityLogEventExitEvent_FieldPathSelector 6469 Get(source *ActivityLog_Event_ExitEvent) []interface{} 6470 GetSingle(source *ActivityLog_Event_ExitEvent) (interface{}, bool) 6471 ClearValue(item *ActivityLog_Event_ExitEvent) 6472 6473 // Those methods build corresponding ActivityLogEventExitEvent_FieldPathValue 6474 // (or array of values) and holds passed value. Panics if injected type is incorrect. 6475 WithIValue(value interface{}) ActivityLogEventExitEvent_FieldPathValue 6476 WithIArrayOfValues(values interface{}) ActivityLogEventExitEvent_FieldPathArrayOfValues 6477 WithIArrayItemValue(value interface{}) ActivityLogEventExitEvent_FieldPathArrayItemValue 6478 } 6479 6480 type ActivityLogEventExitEvent_FieldPathSelector int32 6481 6482 const ( 6483 ActivityLogEventExitEvent_FieldPathSelectorStatus ActivityLogEventExitEvent_FieldPathSelector = 0 6484 ActivityLogEventExitEvent_FieldPathSelectorTime ActivityLogEventExitEvent_FieldPathSelector = 1 6485 ) 6486 6487 func (s ActivityLogEventExitEvent_FieldPathSelector) String() string { 6488 switch s { 6489 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6490 return "status" 6491 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6492 return "time" 6493 default: 6494 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", s)) 6495 } 6496 } 6497 6498 func BuildActivityLogEventExitEvent_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogEventExitEvent_FieldPath, error) { 6499 if len(fp) == 0 { 6500 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Event_ExitEvent") 6501 } 6502 if len(fp) == 1 { 6503 switch fp[0] { 6504 case "status": 6505 return &ActivityLogEventExitEvent_FieldTerminalPath{selector: ActivityLogEventExitEvent_FieldPathSelectorStatus}, nil 6506 case "time": 6507 return &ActivityLogEventExitEvent_FieldTerminalPath{selector: ActivityLogEventExitEvent_FieldPathSelectorTime}, nil 6508 } 6509 } else { 6510 switch fp[0] { 6511 case "status": 6512 if subpath, err := rpc.BuildStatus_FieldPath(fp[1:]); err != nil { 6513 return nil, err 6514 } else { 6515 return &ActivityLogEventExitEvent_FieldSubPath{selector: ActivityLogEventExitEvent_FieldPathSelectorStatus, subPath: subpath}, nil 6516 } 6517 } 6518 } 6519 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Event_ExitEvent", fp) 6520 } 6521 6522 func ParseActivityLogEventExitEvent_FieldPath(rawField string) (ActivityLogEventExitEvent_FieldPath, error) { 6523 fp, err := gotenobject.ParseRawFieldPath(rawField) 6524 if err != nil { 6525 return nil, err 6526 } 6527 return BuildActivityLogEventExitEvent_FieldPath(fp) 6528 } 6529 6530 func MustParseActivityLogEventExitEvent_FieldPath(rawField string) ActivityLogEventExitEvent_FieldPath { 6531 fp, err := ParseActivityLogEventExitEvent_FieldPath(rawField) 6532 if err != nil { 6533 panic(err) 6534 } 6535 return fp 6536 } 6537 6538 type ActivityLogEventExitEvent_FieldTerminalPath struct { 6539 selector ActivityLogEventExitEvent_FieldPathSelector 6540 } 6541 6542 var _ ActivityLogEventExitEvent_FieldPath = (*ActivityLogEventExitEvent_FieldTerminalPath)(nil) 6543 6544 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) Selector() ActivityLogEventExitEvent_FieldPathSelector { 6545 return fp.selector 6546 } 6547 6548 // String returns path representation in proto convention 6549 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) String() string { 6550 return fp.selector.String() 6551 } 6552 6553 // JSONString returns path representation is JSON convention 6554 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) JSONString() string { 6555 return strcase.ToLowerCamel(fp.String()) 6556 } 6557 6558 // Get returns all values pointed by specific field from source ActivityLog_Event_ExitEvent 6559 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) Get(source *ActivityLog_Event_ExitEvent) (values []interface{}) { 6560 if source != nil { 6561 switch fp.selector { 6562 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6563 if source.Status != nil { 6564 values = append(values, source.Status) 6565 } 6566 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6567 if source.Time != nil { 6568 values = append(values, source.Time) 6569 } 6570 default: 6571 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6572 } 6573 } 6574 return 6575 } 6576 6577 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 6578 return fp.Get(source.(*ActivityLog_Event_ExitEvent)) 6579 } 6580 6581 // GetSingle returns value pointed by specific field of from source ActivityLog_Event_ExitEvent 6582 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) GetSingle(source *ActivityLog_Event_ExitEvent) (interface{}, bool) { 6583 switch fp.selector { 6584 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6585 res := source.GetStatus() 6586 return res, res != nil 6587 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6588 res := source.GetTime() 6589 return res, res != nil 6590 default: 6591 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6592 } 6593 } 6594 6595 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6596 return fp.GetSingle(source.(*ActivityLog_Event_ExitEvent)) 6597 } 6598 6599 // GetDefault returns a default value of the field type 6600 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) GetDefault() interface{} { 6601 switch fp.selector { 6602 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6603 return (*rpc.Status)(nil) 6604 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6605 return (*timestamppb.Timestamp)(nil) 6606 default: 6607 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6608 } 6609 } 6610 6611 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) ClearValue(item *ActivityLog_Event_ExitEvent) { 6612 if item != nil { 6613 switch fp.selector { 6614 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6615 item.Status = nil 6616 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6617 item.Time = nil 6618 default: 6619 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6620 } 6621 } 6622 } 6623 6624 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) ClearValueRaw(item proto.Message) { 6625 fp.ClearValue(item.(*ActivityLog_Event_ExitEvent)) 6626 } 6627 6628 // IsLeaf - whether field path is holds simple value 6629 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) IsLeaf() bool { 6630 return fp.selector == ActivityLogEventExitEvent_FieldPathSelectorTime 6631 } 6632 6633 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6634 return []gotenobject.FieldPath{fp} 6635 } 6636 6637 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) WithIValue(value interface{}) ActivityLogEventExitEvent_FieldPathValue { 6638 switch fp.selector { 6639 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6640 return &ActivityLogEventExitEvent_FieldTerminalPathValue{ActivityLogEventExitEvent_FieldTerminalPath: *fp, value: value.(*rpc.Status)} 6641 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6642 return &ActivityLogEventExitEvent_FieldTerminalPathValue{ActivityLogEventExitEvent_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 6643 default: 6644 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6645 } 6646 } 6647 6648 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6649 return fp.WithIValue(value) 6650 } 6651 6652 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogEventExitEvent_FieldPathArrayOfValues { 6653 fpaov := &ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventExitEvent_FieldTerminalPath: *fp} 6654 switch fp.selector { 6655 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6656 return &ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventExitEvent_FieldTerminalPath: *fp, values: values.([]*rpc.Status)} 6657 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6658 return &ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues{ActivityLogEventExitEvent_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 6659 default: 6660 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6661 } 6662 return fpaov 6663 } 6664 6665 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6666 return fp.WithIArrayOfValues(values) 6667 } 6668 6669 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogEventExitEvent_FieldPathArrayItemValue { 6670 switch fp.selector { 6671 default: 6672 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fp.selector)) 6673 } 6674 } 6675 6676 func (fp *ActivityLogEventExitEvent_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6677 return fp.WithIArrayItemValue(value) 6678 } 6679 6680 type ActivityLogEventExitEvent_FieldSubPath struct { 6681 selector ActivityLogEventExitEvent_FieldPathSelector 6682 subPath gotenobject.FieldPath 6683 } 6684 6685 var _ ActivityLogEventExitEvent_FieldPath = (*ActivityLogEventExitEvent_FieldSubPath)(nil) 6686 6687 func (fps *ActivityLogEventExitEvent_FieldSubPath) Selector() ActivityLogEventExitEvent_FieldPathSelector { 6688 return fps.selector 6689 } 6690 func (fps *ActivityLogEventExitEvent_FieldSubPath) AsStatusSubPath() (rpc.Status_FieldPath, bool) { 6691 res, ok := fps.subPath.(rpc.Status_FieldPath) 6692 return res, ok 6693 } 6694 6695 // String returns path representation in proto convention 6696 func (fps *ActivityLogEventExitEvent_FieldSubPath) String() string { 6697 return fps.selector.String() + "." + fps.subPath.String() 6698 } 6699 6700 // JSONString returns path representation is JSON convention 6701 func (fps *ActivityLogEventExitEvent_FieldSubPath) JSONString() string { 6702 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 6703 } 6704 6705 // Get returns all values pointed by selected field from source ActivityLog_Event_ExitEvent 6706 func (fps *ActivityLogEventExitEvent_FieldSubPath) Get(source *ActivityLog_Event_ExitEvent) (values []interface{}) { 6707 switch fps.selector { 6708 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6709 values = append(values, fps.subPath.GetRaw(source.GetStatus())...) 6710 default: 6711 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fps.selector)) 6712 } 6713 return 6714 } 6715 6716 func (fps *ActivityLogEventExitEvent_FieldSubPath) GetRaw(source proto.Message) []interface{} { 6717 return fps.Get(source.(*ActivityLog_Event_ExitEvent)) 6718 } 6719 6720 // GetSingle returns value of selected field from source ActivityLog_Event_ExitEvent 6721 func (fps *ActivityLogEventExitEvent_FieldSubPath) GetSingle(source *ActivityLog_Event_ExitEvent) (interface{}, bool) { 6722 switch fps.selector { 6723 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6724 if source.GetStatus() == nil { 6725 return nil, false 6726 } 6727 return fps.subPath.GetSingleRaw(source.GetStatus()) 6728 default: 6729 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fps.selector)) 6730 } 6731 } 6732 6733 func (fps *ActivityLogEventExitEvent_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6734 return fps.GetSingle(source.(*ActivityLog_Event_ExitEvent)) 6735 } 6736 6737 // GetDefault returns a default value of the field type 6738 func (fps *ActivityLogEventExitEvent_FieldSubPath) GetDefault() interface{} { 6739 return fps.subPath.GetDefault() 6740 } 6741 6742 func (fps *ActivityLogEventExitEvent_FieldSubPath) ClearValue(item *ActivityLog_Event_ExitEvent) { 6743 if item != nil { 6744 switch fps.selector { 6745 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6746 fps.subPath.ClearValueRaw(item.Status) 6747 default: 6748 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fps.selector)) 6749 } 6750 } 6751 } 6752 6753 func (fps *ActivityLogEventExitEvent_FieldSubPath) ClearValueRaw(item proto.Message) { 6754 fps.ClearValue(item.(*ActivityLog_Event_ExitEvent)) 6755 } 6756 6757 // IsLeaf - whether field path is holds simple value 6758 func (fps *ActivityLogEventExitEvent_FieldSubPath) IsLeaf() bool { 6759 return fps.subPath.IsLeaf() 6760 } 6761 6762 func (fps *ActivityLogEventExitEvent_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6763 iPaths := []gotenobject.FieldPath{&ActivityLogEventExitEvent_FieldTerminalPath{selector: fps.selector}} 6764 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 6765 return iPaths 6766 } 6767 6768 func (fps *ActivityLogEventExitEvent_FieldSubPath) WithIValue(value interface{}) ActivityLogEventExitEvent_FieldPathValue { 6769 return &ActivityLogEventExitEvent_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 6770 } 6771 6772 func (fps *ActivityLogEventExitEvent_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6773 return fps.WithIValue(value) 6774 } 6775 6776 func (fps *ActivityLogEventExitEvent_FieldSubPath) WithIArrayOfValues(values interface{}) ActivityLogEventExitEvent_FieldPathArrayOfValues { 6777 return &ActivityLogEventExitEvent_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 6778 } 6779 6780 func (fps *ActivityLogEventExitEvent_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6781 return fps.WithIArrayOfValues(values) 6782 } 6783 6784 func (fps *ActivityLogEventExitEvent_FieldSubPath) WithIArrayItemValue(value interface{}) ActivityLogEventExitEvent_FieldPathArrayItemValue { 6785 return &ActivityLogEventExitEvent_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 6786 } 6787 6788 func (fps *ActivityLogEventExitEvent_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6789 return fps.WithIArrayItemValue(value) 6790 } 6791 6792 // ActivityLogEventExitEvent_FieldPathValue allows storing values for ExitEvent fields according to their type 6793 type ActivityLogEventExitEvent_FieldPathValue interface { 6794 ActivityLogEventExitEvent_FieldPath 6795 gotenobject.FieldPathValue 6796 SetTo(target **ActivityLog_Event_ExitEvent) 6797 CompareWith(*ActivityLog_Event_ExitEvent) (cmp int, comparable bool) 6798 } 6799 6800 func ParseActivityLogEventExitEvent_FieldPathValue(pathStr, valueStr string) (ActivityLogEventExitEvent_FieldPathValue, error) { 6801 fp, err := ParseActivityLogEventExitEvent_FieldPath(pathStr) 6802 if err != nil { 6803 return nil, err 6804 } 6805 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 6806 if err != nil { 6807 return nil, status.Errorf(codes.InvalidArgument, "error parsing ExitEvent field path value from %s: %v", valueStr, err) 6808 } 6809 return fpv.(ActivityLogEventExitEvent_FieldPathValue), nil 6810 } 6811 6812 func MustParseActivityLogEventExitEvent_FieldPathValue(pathStr, valueStr string) ActivityLogEventExitEvent_FieldPathValue { 6813 fpv, err := ParseActivityLogEventExitEvent_FieldPathValue(pathStr, valueStr) 6814 if err != nil { 6815 panic(err) 6816 } 6817 return fpv 6818 } 6819 6820 type ActivityLogEventExitEvent_FieldTerminalPathValue struct { 6821 ActivityLogEventExitEvent_FieldTerminalPath 6822 value interface{} 6823 } 6824 6825 var _ ActivityLogEventExitEvent_FieldPathValue = (*ActivityLogEventExitEvent_FieldTerminalPathValue)(nil) 6826 6827 // GetRawValue returns raw value stored under selected path for 'ExitEvent' as interface{} 6828 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) GetRawValue() interface{} { 6829 return fpv.value 6830 } 6831 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) AsStatusValue() (*rpc.Status, bool) { 6832 res, ok := fpv.value.(*rpc.Status) 6833 return res, ok 6834 } 6835 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) AsTimeValue() (*timestamppb.Timestamp, bool) { 6836 res, ok := fpv.value.(*timestamppb.Timestamp) 6837 return res, ok 6838 } 6839 6840 // SetTo stores value for selected field for object ExitEvent 6841 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) SetTo(target **ActivityLog_Event_ExitEvent) { 6842 if *target == nil { 6843 *target = new(ActivityLog_Event_ExitEvent) 6844 } 6845 switch fpv.selector { 6846 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6847 (*target).Status = fpv.value.(*rpc.Status) 6848 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6849 (*target).Time = fpv.value.(*timestamppb.Timestamp) 6850 default: 6851 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fpv.selector)) 6852 } 6853 } 6854 6855 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) SetToRaw(target proto.Message) { 6856 typedObject := target.(*ActivityLog_Event_ExitEvent) 6857 fpv.SetTo(&typedObject) 6858 } 6859 6860 // CompareWith compares value in the 'ActivityLogEventExitEvent_FieldTerminalPathValue' with the value under path in 'ActivityLog_Event_ExitEvent'. 6861 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) CompareWith(source *ActivityLog_Event_ExitEvent) (int, bool) { 6862 switch fpv.selector { 6863 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6864 return 0, false 6865 case ActivityLogEventExitEvent_FieldPathSelectorTime: 6866 leftValue := fpv.value.(*timestamppb.Timestamp) 6867 rightValue := source.GetTime() 6868 if leftValue == nil { 6869 if rightValue != nil { 6870 return -1, true 6871 } 6872 return 0, true 6873 } 6874 if rightValue == nil { 6875 return 1, true 6876 } 6877 if leftValue.AsTime().Equal(rightValue.AsTime()) { 6878 return 0, true 6879 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 6880 return -1, true 6881 } else { 6882 return 1, true 6883 } 6884 default: 6885 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fpv.selector)) 6886 } 6887 } 6888 6889 func (fpv *ActivityLogEventExitEvent_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6890 return fpv.CompareWith(source.(*ActivityLog_Event_ExitEvent)) 6891 } 6892 6893 type ActivityLogEventExitEvent_FieldSubPathValue struct { 6894 ActivityLogEventExitEvent_FieldPath 6895 subPathValue gotenobject.FieldPathValue 6896 } 6897 6898 var _ ActivityLogEventExitEvent_FieldPathValue = (*ActivityLogEventExitEvent_FieldSubPathValue)(nil) 6899 6900 func (fpvs *ActivityLogEventExitEvent_FieldSubPathValue) AsStatusPathValue() (rpc.Status_FieldPathValue, bool) { 6901 res, ok := fpvs.subPathValue.(rpc.Status_FieldPathValue) 6902 return res, ok 6903 } 6904 6905 func (fpvs *ActivityLogEventExitEvent_FieldSubPathValue) SetTo(target **ActivityLog_Event_ExitEvent) { 6906 if *target == nil { 6907 *target = new(ActivityLog_Event_ExitEvent) 6908 } 6909 switch fpvs.Selector() { 6910 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6911 fpvs.subPathValue.(rpc.Status_FieldPathValue).SetTo(&(*target).Status) 6912 default: 6913 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fpvs.Selector())) 6914 } 6915 } 6916 6917 func (fpvs *ActivityLogEventExitEvent_FieldSubPathValue) SetToRaw(target proto.Message) { 6918 typedObject := target.(*ActivityLog_Event_ExitEvent) 6919 fpvs.SetTo(&typedObject) 6920 } 6921 6922 func (fpvs *ActivityLogEventExitEvent_FieldSubPathValue) GetRawValue() interface{} { 6923 return fpvs.subPathValue.GetRawValue() 6924 } 6925 6926 func (fpvs *ActivityLogEventExitEvent_FieldSubPathValue) CompareWith(source *ActivityLog_Event_ExitEvent) (int, bool) { 6927 switch fpvs.Selector() { 6928 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 6929 return fpvs.subPathValue.(rpc.Status_FieldPathValue).CompareWith(source.GetStatus()) 6930 default: 6931 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fpvs.Selector())) 6932 } 6933 } 6934 6935 func (fpvs *ActivityLogEventExitEvent_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6936 return fpvs.CompareWith(source.(*ActivityLog_Event_ExitEvent)) 6937 } 6938 6939 // ActivityLogEventExitEvent_FieldPathArrayItemValue allows storing single item in Path-specific values for ExitEvent according to their type 6940 // Present only for array (repeated) types. 6941 type ActivityLogEventExitEvent_FieldPathArrayItemValue interface { 6942 gotenobject.FieldPathArrayItemValue 6943 ActivityLogEventExitEvent_FieldPath 6944 ContainsValue(*ActivityLog_Event_ExitEvent) bool 6945 } 6946 6947 // ParseActivityLogEventExitEvent_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 6948 func ParseActivityLogEventExitEvent_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogEventExitEvent_FieldPathArrayItemValue, error) { 6949 fp, err := ParseActivityLogEventExitEvent_FieldPath(pathStr) 6950 if err != nil { 6951 return nil, err 6952 } 6953 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 6954 if err != nil { 6955 return nil, status.Errorf(codes.InvalidArgument, "error parsing ExitEvent field path array item value from %s: %v", valueStr, err) 6956 } 6957 return fpaiv.(ActivityLogEventExitEvent_FieldPathArrayItemValue), nil 6958 } 6959 6960 func MustParseActivityLogEventExitEvent_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogEventExitEvent_FieldPathArrayItemValue { 6961 fpaiv, err := ParseActivityLogEventExitEvent_FieldPathArrayItemValue(pathStr, valueStr) 6962 if err != nil { 6963 panic(err) 6964 } 6965 return fpaiv 6966 } 6967 6968 type ActivityLogEventExitEvent_FieldTerminalPathArrayItemValue struct { 6969 ActivityLogEventExitEvent_FieldTerminalPath 6970 value interface{} 6971 } 6972 6973 var _ ActivityLogEventExitEvent_FieldPathArrayItemValue = (*ActivityLogEventExitEvent_FieldTerminalPathArrayItemValue)(nil) 6974 6975 // GetRawValue returns stored element value for array in object ActivityLog_Event_ExitEvent as interface{} 6976 func (fpaiv *ActivityLogEventExitEvent_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 6977 return fpaiv.value 6978 } 6979 6980 func (fpaiv *ActivityLogEventExitEvent_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Event_ExitEvent) (interface{}, bool) { 6981 return nil, false 6982 } 6983 6984 func (fpaiv *ActivityLogEventExitEvent_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 6985 return fpaiv.GetSingle(source.(*ActivityLog_Event_ExitEvent)) 6986 } 6987 6988 // Contains returns a boolean indicating if value that is being held is present in given 'ExitEvent' 6989 func (fpaiv *ActivityLogEventExitEvent_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Event_ExitEvent) bool { 6990 slice := fpaiv.ActivityLogEventExitEvent_FieldTerminalPath.Get(source) 6991 for _, v := range slice { 6992 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 6993 if proto.Equal(asProtoMsg, v.(proto.Message)) { 6994 return true 6995 } 6996 } else if reflect.DeepEqual(v, fpaiv.value) { 6997 return true 6998 } 6999 } 7000 return false 7001 } 7002 7003 type ActivityLogEventExitEvent_FieldSubPathArrayItemValue struct { 7004 ActivityLogEventExitEvent_FieldPath 7005 subPathItemValue gotenobject.FieldPathArrayItemValue 7006 } 7007 7008 // GetRawValue returns stored array item value 7009 func (fpaivs *ActivityLogEventExitEvent_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 7010 return fpaivs.subPathItemValue.GetRawItemValue() 7011 } 7012 func (fpaivs *ActivityLogEventExitEvent_FieldSubPathArrayItemValue) AsStatusPathItemValue() (rpc.Status_FieldPathArrayItemValue, bool) { 7013 res, ok := fpaivs.subPathItemValue.(rpc.Status_FieldPathArrayItemValue) 7014 return res, ok 7015 } 7016 7017 // Contains returns a boolean indicating if value that is being held is present in given 'ExitEvent' 7018 func (fpaivs *ActivityLogEventExitEvent_FieldSubPathArrayItemValue) ContainsValue(source *ActivityLog_Event_ExitEvent) bool { 7019 switch fpaivs.Selector() { 7020 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 7021 return fpaivs.subPathItemValue.(rpc.Status_FieldPathArrayItemValue).ContainsValue(source.GetStatus()) 7022 default: 7023 panic(fmt.Sprintf("Invalid selector for ActivityLog_Event_ExitEvent: %d", fpaivs.Selector())) 7024 } 7025 } 7026 7027 // ActivityLogEventExitEvent_FieldPathArrayOfValues allows storing slice of values for ExitEvent fields according to their type 7028 type ActivityLogEventExitEvent_FieldPathArrayOfValues interface { 7029 gotenobject.FieldPathArrayOfValues 7030 ActivityLogEventExitEvent_FieldPath 7031 } 7032 7033 func ParseActivityLogEventExitEvent_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogEventExitEvent_FieldPathArrayOfValues, error) { 7034 fp, err := ParseActivityLogEventExitEvent_FieldPath(pathStr) 7035 if err != nil { 7036 return nil, err 7037 } 7038 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 7039 if err != nil { 7040 return nil, status.Errorf(codes.InvalidArgument, "error parsing ExitEvent field path array of values from %s: %v", valuesStr, err) 7041 } 7042 return fpaov.(ActivityLogEventExitEvent_FieldPathArrayOfValues), nil 7043 } 7044 7045 func MustParseActivityLogEventExitEvent_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogEventExitEvent_FieldPathArrayOfValues { 7046 fpaov, err := ParseActivityLogEventExitEvent_FieldPathArrayOfValues(pathStr, valuesStr) 7047 if err != nil { 7048 panic(err) 7049 } 7050 return fpaov 7051 } 7052 7053 type ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues struct { 7054 ActivityLogEventExitEvent_FieldTerminalPath 7055 values interface{} 7056 } 7057 7058 var _ ActivityLogEventExitEvent_FieldPathArrayOfValues = (*ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues)(nil) 7059 7060 func (fpaov *ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 7061 switch fpaov.selector { 7062 case ActivityLogEventExitEvent_FieldPathSelectorStatus: 7063 for _, v := range fpaov.values.([]*rpc.Status) { 7064 values = append(values, v) 7065 } 7066 case ActivityLogEventExitEvent_FieldPathSelectorTime: 7067 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 7068 values = append(values, v) 7069 } 7070 } 7071 return 7072 } 7073 func (fpaov *ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues) AsStatusArrayOfValues() ([]*rpc.Status, bool) { 7074 res, ok := fpaov.values.([]*rpc.Status) 7075 return res, ok 7076 } 7077 func (fpaov *ActivityLogEventExitEvent_FieldTerminalPathArrayOfValues) AsTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 7078 res, ok := fpaov.values.([]*timestamppb.Timestamp) 7079 return res, ok 7080 } 7081 7082 type ActivityLogEventExitEvent_FieldSubPathArrayOfValues struct { 7083 ActivityLogEventExitEvent_FieldPath 7084 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 7085 } 7086 7087 var _ ActivityLogEventExitEvent_FieldPathArrayOfValues = (*ActivityLogEventExitEvent_FieldSubPathArrayOfValues)(nil) 7088 7089 func (fpsaov *ActivityLogEventExitEvent_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 7090 return fpsaov.subPathArrayOfValues.GetRawValues() 7091 } 7092 func (fpsaov *ActivityLogEventExitEvent_FieldSubPathArrayOfValues) AsStatusPathArrayOfValues() (rpc.Status_FieldPathArrayOfValues, bool) { 7093 res, ok := fpsaov.subPathArrayOfValues.(rpc.Status_FieldPathArrayOfValues) 7094 return res, ok 7095 } 7096 7097 // FieldPath provides implementation to handle 7098 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 7099 type ActivityLogResourceDifference_FieldPath interface { 7100 gotenobject.FieldPath 7101 Selector() ActivityLogResourceDifference_FieldPathSelector 7102 Get(source *ActivityLog_Resource_Difference) []interface{} 7103 GetSingle(source *ActivityLog_Resource_Difference) (interface{}, bool) 7104 ClearValue(item *ActivityLog_Resource_Difference) 7105 7106 // Those methods build corresponding ActivityLogResourceDifference_FieldPathValue 7107 // (or array of values) and holds passed value. Panics if injected type is incorrect. 7108 WithIValue(value interface{}) ActivityLogResourceDifference_FieldPathValue 7109 WithIArrayOfValues(values interface{}) ActivityLogResourceDifference_FieldPathArrayOfValues 7110 WithIArrayItemValue(value interface{}) ActivityLogResourceDifference_FieldPathArrayItemValue 7111 } 7112 7113 type ActivityLogResourceDifference_FieldPathSelector int32 7114 7115 const ( 7116 ActivityLogResourceDifference_FieldPathSelectorFields ActivityLogResourceDifference_FieldPathSelector = 0 7117 ActivityLogResourceDifference_FieldPathSelectorBefore ActivityLogResourceDifference_FieldPathSelector = 1 7118 ActivityLogResourceDifference_FieldPathSelectorAfter ActivityLogResourceDifference_FieldPathSelector = 2 7119 ) 7120 7121 func (s ActivityLogResourceDifference_FieldPathSelector) String() string { 7122 switch s { 7123 case ActivityLogResourceDifference_FieldPathSelectorFields: 7124 return "fields" 7125 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7126 return "before" 7127 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7128 return "after" 7129 default: 7130 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", s)) 7131 } 7132 } 7133 7134 func BuildActivityLogResourceDifference_FieldPath(fp gotenobject.RawFieldPath) (ActivityLogResourceDifference_FieldPath, error) { 7135 if len(fp) == 0 { 7136 return nil, status.Error(codes.InvalidArgument, "empty field path for object ActivityLog_Resource_Difference") 7137 } 7138 if len(fp) == 1 { 7139 switch fp[0] { 7140 case "fields": 7141 return &ActivityLogResourceDifference_FieldTerminalPath{selector: ActivityLogResourceDifference_FieldPathSelectorFields}, nil 7142 case "before": 7143 return &ActivityLogResourceDifference_FieldTerminalPath{selector: ActivityLogResourceDifference_FieldPathSelectorBefore}, nil 7144 case "after": 7145 return &ActivityLogResourceDifference_FieldTerminalPath{selector: ActivityLogResourceDifference_FieldPathSelectorAfter}, nil 7146 } 7147 } 7148 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object ActivityLog_Resource_Difference", fp) 7149 } 7150 7151 func ParseActivityLogResourceDifference_FieldPath(rawField string) (ActivityLogResourceDifference_FieldPath, error) { 7152 fp, err := gotenobject.ParseRawFieldPath(rawField) 7153 if err != nil { 7154 return nil, err 7155 } 7156 return BuildActivityLogResourceDifference_FieldPath(fp) 7157 } 7158 7159 func MustParseActivityLogResourceDifference_FieldPath(rawField string) ActivityLogResourceDifference_FieldPath { 7160 fp, err := ParseActivityLogResourceDifference_FieldPath(rawField) 7161 if err != nil { 7162 panic(err) 7163 } 7164 return fp 7165 } 7166 7167 type ActivityLogResourceDifference_FieldTerminalPath struct { 7168 selector ActivityLogResourceDifference_FieldPathSelector 7169 } 7170 7171 var _ ActivityLogResourceDifference_FieldPath = (*ActivityLogResourceDifference_FieldTerminalPath)(nil) 7172 7173 func (fp *ActivityLogResourceDifference_FieldTerminalPath) Selector() ActivityLogResourceDifference_FieldPathSelector { 7174 return fp.selector 7175 } 7176 7177 // String returns path representation in proto convention 7178 func (fp *ActivityLogResourceDifference_FieldTerminalPath) String() string { 7179 return fp.selector.String() 7180 } 7181 7182 // JSONString returns path representation is JSON convention 7183 func (fp *ActivityLogResourceDifference_FieldTerminalPath) JSONString() string { 7184 return strcase.ToLowerCamel(fp.String()) 7185 } 7186 7187 // Get returns all values pointed by specific field from source ActivityLog_Resource_Difference 7188 func (fp *ActivityLogResourceDifference_FieldTerminalPath) Get(source *ActivityLog_Resource_Difference) (values []interface{}) { 7189 if source != nil { 7190 switch fp.selector { 7191 case ActivityLogResourceDifference_FieldPathSelectorFields: 7192 if source.Fields != nil { 7193 values = append(values, source.Fields) 7194 } 7195 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7196 if source.Before != nil { 7197 values = append(values, source.Before) 7198 } 7199 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7200 if source.After != nil { 7201 values = append(values, source.After) 7202 } 7203 default: 7204 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7205 } 7206 } 7207 return 7208 } 7209 7210 func (fp *ActivityLogResourceDifference_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 7211 return fp.Get(source.(*ActivityLog_Resource_Difference)) 7212 } 7213 7214 // GetSingle returns value pointed by specific field of from source ActivityLog_Resource_Difference 7215 func (fp *ActivityLogResourceDifference_FieldTerminalPath) GetSingle(source *ActivityLog_Resource_Difference) (interface{}, bool) { 7216 switch fp.selector { 7217 case ActivityLogResourceDifference_FieldPathSelectorFields: 7218 res := source.GetFields() 7219 return res, res != nil 7220 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7221 res := source.GetBefore() 7222 return res, res != nil 7223 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7224 res := source.GetAfter() 7225 return res, res != nil 7226 default: 7227 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7228 } 7229 } 7230 7231 func (fp *ActivityLogResourceDifference_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7232 return fp.GetSingle(source.(*ActivityLog_Resource_Difference)) 7233 } 7234 7235 // GetDefault returns a default value of the field type 7236 func (fp *ActivityLogResourceDifference_FieldTerminalPath) GetDefault() interface{} { 7237 switch fp.selector { 7238 case ActivityLogResourceDifference_FieldPathSelectorFields: 7239 return (*fieldmaskpb.FieldMask)(nil) 7240 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7241 return (*anypb.Any)(nil) 7242 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7243 return (*anypb.Any)(nil) 7244 default: 7245 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7246 } 7247 } 7248 7249 func (fp *ActivityLogResourceDifference_FieldTerminalPath) ClearValue(item *ActivityLog_Resource_Difference) { 7250 if item != nil { 7251 switch fp.selector { 7252 case ActivityLogResourceDifference_FieldPathSelectorFields: 7253 item.Fields = nil 7254 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7255 item.Before = nil 7256 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7257 item.After = nil 7258 default: 7259 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7260 } 7261 } 7262 } 7263 7264 func (fp *ActivityLogResourceDifference_FieldTerminalPath) ClearValueRaw(item proto.Message) { 7265 fp.ClearValue(item.(*ActivityLog_Resource_Difference)) 7266 } 7267 7268 // IsLeaf - whether field path is holds simple value 7269 func (fp *ActivityLogResourceDifference_FieldTerminalPath) IsLeaf() bool { 7270 return fp.selector == ActivityLogResourceDifference_FieldPathSelectorFields || 7271 fp.selector == ActivityLogResourceDifference_FieldPathSelectorBefore || 7272 fp.selector == ActivityLogResourceDifference_FieldPathSelectorAfter 7273 } 7274 7275 func (fp *ActivityLogResourceDifference_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 7276 return []gotenobject.FieldPath{fp} 7277 } 7278 7279 func (fp *ActivityLogResourceDifference_FieldTerminalPath) WithIValue(value interface{}) ActivityLogResourceDifference_FieldPathValue { 7280 switch fp.selector { 7281 case ActivityLogResourceDifference_FieldPathSelectorFields: 7282 return &ActivityLogResourceDifference_FieldTerminalPathValue{ActivityLogResourceDifference_FieldTerminalPath: *fp, value: value.(*fieldmaskpb.FieldMask)} 7283 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7284 return &ActivityLogResourceDifference_FieldTerminalPathValue{ActivityLogResourceDifference_FieldTerminalPath: *fp, value: value.(*anypb.Any)} 7285 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7286 return &ActivityLogResourceDifference_FieldTerminalPathValue{ActivityLogResourceDifference_FieldTerminalPath: *fp, value: value.(*anypb.Any)} 7287 default: 7288 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7289 } 7290 } 7291 7292 func (fp *ActivityLogResourceDifference_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 7293 return fp.WithIValue(value) 7294 } 7295 7296 func (fp *ActivityLogResourceDifference_FieldTerminalPath) WithIArrayOfValues(values interface{}) ActivityLogResourceDifference_FieldPathArrayOfValues { 7297 fpaov := &ActivityLogResourceDifference_FieldTerminalPathArrayOfValues{ActivityLogResourceDifference_FieldTerminalPath: *fp} 7298 switch fp.selector { 7299 case ActivityLogResourceDifference_FieldPathSelectorFields: 7300 return &ActivityLogResourceDifference_FieldTerminalPathArrayOfValues{ActivityLogResourceDifference_FieldTerminalPath: *fp, values: values.([]*fieldmaskpb.FieldMask)} 7301 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7302 return &ActivityLogResourceDifference_FieldTerminalPathArrayOfValues{ActivityLogResourceDifference_FieldTerminalPath: *fp, values: values.([]*anypb.Any)} 7303 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7304 return &ActivityLogResourceDifference_FieldTerminalPathArrayOfValues{ActivityLogResourceDifference_FieldTerminalPath: *fp, values: values.([]*anypb.Any)} 7305 default: 7306 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7307 } 7308 return fpaov 7309 } 7310 7311 func (fp *ActivityLogResourceDifference_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 7312 return fp.WithIArrayOfValues(values) 7313 } 7314 7315 func (fp *ActivityLogResourceDifference_FieldTerminalPath) WithIArrayItemValue(value interface{}) ActivityLogResourceDifference_FieldPathArrayItemValue { 7316 switch fp.selector { 7317 default: 7318 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fp.selector)) 7319 } 7320 } 7321 7322 func (fp *ActivityLogResourceDifference_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 7323 return fp.WithIArrayItemValue(value) 7324 } 7325 7326 // ActivityLogResourceDifference_FieldPathValue allows storing values for Difference fields according to their type 7327 type ActivityLogResourceDifference_FieldPathValue interface { 7328 ActivityLogResourceDifference_FieldPath 7329 gotenobject.FieldPathValue 7330 SetTo(target **ActivityLog_Resource_Difference) 7331 CompareWith(*ActivityLog_Resource_Difference) (cmp int, comparable bool) 7332 } 7333 7334 func ParseActivityLogResourceDifference_FieldPathValue(pathStr, valueStr string) (ActivityLogResourceDifference_FieldPathValue, error) { 7335 fp, err := ParseActivityLogResourceDifference_FieldPath(pathStr) 7336 if err != nil { 7337 return nil, err 7338 } 7339 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 7340 if err != nil { 7341 return nil, status.Errorf(codes.InvalidArgument, "error parsing Difference field path value from %s: %v", valueStr, err) 7342 } 7343 return fpv.(ActivityLogResourceDifference_FieldPathValue), nil 7344 } 7345 7346 func MustParseActivityLogResourceDifference_FieldPathValue(pathStr, valueStr string) ActivityLogResourceDifference_FieldPathValue { 7347 fpv, err := ParseActivityLogResourceDifference_FieldPathValue(pathStr, valueStr) 7348 if err != nil { 7349 panic(err) 7350 } 7351 return fpv 7352 } 7353 7354 type ActivityLogResourceDifference_FieldTerminalPathValue struct { 7355 ActivityLogResourceDifference_FieldTerminalPath 7356 value interface{} 7357 } 7358 7359 var _ ActivityLogResourceDifference_FieldPathValue = (*ActivityLogResourceDifference_FieldTerminalPathValue)(nil) 7360 7361 // GetRawValue returns raw value stored under selected path for 'Difference' as interface{} 7362 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) GetRawValue() interface{} { 7363 return fpv.value 7364 } 7365 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) AsFieldsValue() (*fieldmaskpb.FieldMask, bool) { 7366 res, ok := fpv.value.(*fieldmaskpb.FieldMask) 7367 return res, ok 7368 } 7369 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) AsBeforeValue() (*anypb.Any, bool) { 7370 res, ok := fpv.value.(*anypb.Any) 7371 return res, ok 7372 } 7373 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) AsAfterValue() (*anypb.Any, bool) { 7374 res, ok := fpv.value.(*anypb.Any) 7375 return res, ok 7376 } 7377 7378 // SetTo stores value for selected field for object Difference 7379 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) SetTo(target **ActivityLog_Resource_Difference) { 7380 if *target == nil { 7381 *target = new(ActivityLog_Resource_Difference) 7382 } 7383 switch fpv.selector { 7384 case ActivityLogResourceDifference_FieldPathSelectorFields: 7385 (*target).Fields = fpv.value.(*fieldmaskpb.FieldMask) 7386 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7387 (*target).Before = fpv.value.(*anypb.Any) 7388 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7389 (*target).After = fpv.value.(*anypb.Any) 7390 default: 7391 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fpv.selector)) 7392 } 7393 } 7394 7395 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) SetToRaw(target proto.Message) { 7396 typedObject := target.(*ActivityLog_Resource_Difference) 7397 fpv.SetTo(&typedObject) 7398 } 7399 7400 // CompareWith compares value in the 'ActivityLogResourceDifference_FieldTerminalPathValue' with the value under path in 'ActivityLog_Resource_Difference'. 7401 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) CompareWith(source *ActivityLog_Resource_Difference) (int, bool) { 7402 switch fpv.selector { 7403 case ActivityLogResourceDifference_FieldPathSelectorFields: 7404 return 0, false 7405 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7406 return 0, false 7407 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7408 return 0, false 7409 default: 7410 panic(fmt.Sprintf("Invalid selector for ActivityLog_Resource_Difference: %d", fpv.selector)) 7411 } 7412 } 7413 7414 func (fpv *ActivityLogResourceDifference_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 7415 return fpv.CompareWith(source.(*ActivityLog_Resource_Difference)) 7416 } 7417 7418 // ActivityLogResourceDifference_FieldPathArrayItemValue allows storing single item in Path-specific values for Difference according to their type 7419 // Present only for array (repeated) types. 7420 type ActivityLogResourceDifference_FieldPathArrayItemValue interface { 7421 gotenobject.FieldPathArrayItemValue 7422 ActivityLogResourceDifference_FieldPath 7423 ContainsValue(*ActivityLog_Resource_Difference) bool 7424 } 7425 7426 // ParseActivityLogResourceDifference_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 7427 func ParseActivityLogResourceDifference_FieldPathArrayItemValue(pathStr, valueStr string) (ActivityLogResourceDifference_FieldPathArrayItemValue, error) { 7428 fp, err := ParseActivityLogResourceDifference_FieldPath(pathStr) 7429 if err != nil { 7430 return nil, err 7431 } 7432 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 7433 if err != nil { 7434 return nil, status.Errorf(codes.InvalidArgument, "error parsing Difference field path array item value from %s: %v", valueStr, err) 7435 } 7436 return fpaiv.(ActivityLogResourceDifference_FieldPathArrayItemValue), nil 7437 } 7438 7439 func MustParseActivityLogResourceDifference_FieldPathArrayItemValue(pathStr, valueStr string) ActivityLogResourceDifference_FieldPathArrayItemValue { 7440 fpaiv, err := ParseActivityLogResourceDifference_FieldPathArrayItemValue(pathStr, valueStr) 7441 if err != nil { 7442 panic(err) 7443 } 7444 return fpaiv 7445 } 7446 7447 type ActivityLogResourceDifference_FieldTerminalPathArrayItemValue struct { 7448 ActivityLogResourceDifference_FieldTerminalPath 7449 value interface{} 7450 } 7451 7452 var _ ActivityLogResourceDifference_FieldPathArrayItemValue = (*ActivityLogResourceDifference_FieldTerminalPathArrayItemValue)(nil) 7453 7454 // GetRawValue returns stored element value for array in object ActivityLog_Resource_Difference as interface{} 7455 func (fpaiv *ActivityLogResourceDifference_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 7456 return fpaiv.value 7457 } 7458 7459 func (fpaiv *ActivityLogResourceDifference_FieldTerminalPathArrayItemValue) GetSingle(source *ActivityLog_Resource_Difference) (interface{}, bool) { 7460 return nil, false 7461 } 7462 7463 func (fpaiv *ActivityLogResourceDifference_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 7464 return fpaiv.GetSingle(source.(*ActivityLog_Resource_Difference)) 7465 } 7466 7467 // Contains returns a boolean indicating if value that is being held is present in given 'Difference' 7468 func (fpaiv *ActivityLogResourceDifference_FieldTerminalPathArrayItemValue) ContainsValue(source *ActivityLog_Resource_Difference) bool { 7469 slice := fpaiv.ActivityLogResourceDifference_FieldTerminalPath.Get(source) 7470 for _, v := range slice { 7471 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 7472 if proto.Equal(asProtoMsg, v.(proto.Message)) { 7473 return true 7474 } 7475 } else if reflect.DeepEqual(v, fpaiv.value) { 7476 return true 7477 } 7478 } 7479 return false 7480 } 7481 7482 // ActivityLogResourceDifference_FieldPathArrayOfValues allows storing slice of values for Difference fields according to their type 7483 type ActivityLogResourceDifference_FieldPathArrayOfValues interface { 7484 gotenobject.FieldPathArrayOfValues 7485 ActivityLogResourceDifference_FieldPath 7486 } 7487 7488 func ParseActivityLogResourceDifference_FieldPathArrayOfValues(pathStr, valuesStr string) (ActivityLogResourceDifference_FieldPathArrayOfValues, error) { 7489 fp, err := ParseActivityLogResourceDifference_FieldPath(pathStr) 7490 if err != nil { 7491 return nil, err 7492 } 7493 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 7494 if err != nil { 7495 return nil, status.Errorf(codes.InvalidArgument, "error parsing Difference field path array of values from %s: %v", valuesStr, err) 7496 } 7497 return fpaov.(ActivityLogResourceDifference_FieldPathArrayOfValues), nil 7498 } 7499 7500 func MustParseActivityLogResourceDifference_FieldPathArrayOfValues(pathStr, valuesStr string) ActivityLogResourceDifference_FieldPathArrayOfValues { 7501 fpaov, err := ParseActivityLogResourceDifference_FieldPathArrayOfValues(pathStr, valuesStr) 7502 if err != nil { 7503 panic(err) 7504 } 7505 return fpaov 7506 } 7507 7508 type ActivityLogResourceDifference_FieldTerminalPathArrayOfValues struct { 7509 ActivityLogResourceDifference_FieldTerminalPath 7510 values interface{} 7511 } 7512 7513 var _ ActivityLogResourceDifference_FieldPathArrayOfValues = (*ActivityLogResourceDifference_FieldTerminalPathArrayOfValues)(nil) 7514 7515 func (fpaov *ActivityLogResourceDifference_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 7516 switch fpaov.selector { 7517 case ActivityLogResourceDifference_FieldPathSelectorFields: 7518 for _, v := range fpaov.values.([]*fieldmaskpb.FieldMask) { 7519 values = append(values, v) 7520 } 7521 case ActivityLogResourceDifference_FieldPathSelectorBefore: 7522 for _, v := range fpaov.values.([]*anypb.Any) { 7523 values = append(values, v) 7524 } 7525 case ActivityLogResourceDifference_FieldPathSelectorAfter: 7526 for _, v := range fpaov.values.([]*anypb.Any) { 7527 values = append(values, v) 7528 } 7529 } 7530 return 7531 } 7532 func (fpaov *ActivityLogResourceDifference_FieldTerminalPathArrayOfValues) AsFieldsArrayOfValues() ([]*fieldmaskpb.FieldMask, bool) { 7533 res, ok := fpaov.values.([]*fieldmaskpb.FieldMask) 7534 return res, ok 7535 } 7536 func (fpaov *ActivityLogResourceDifference_FieldTerminalPathArrayOfValues) AsBeforeArrayOfValues() ([]*anypb.Any, bool) { 7537 res, ok := fpaov.values.([]*anypb.Any) 7538 return res, ok 7539 } 7540 func (fpaov *ActivityLogResourceDifference_FieldTerminalPathArrayOfValues) AsAfterArrayOfValues() ([]*anypb.Any, bool) { 7541 res, ok := fpaov.values.([]*anypb.Any) 7542 return res, ok 7543 }