github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/resources/v1/notifications/notification_msg.pb.fieldpath.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/alerting/proto/v1/notification_msg.proto 3 // DO NOT EDIT!!! 4 5 package notification_msg 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 alert "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/alert" 27 rcommon "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/common" 28 log_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/log_condition" 29 policy "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/policy" 30 ts_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_condition" 31 iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization" 32 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project" 33 monitoring_common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 34 durationpb "google.golang.org/protobuf/types/known/durationpb" 35 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 36 ) 37 38 // ensure the imports are used 39 var ( 40 _ = new(json.Marshaler) 41 _ = new(fmt.Stringer) 42 _ = reflect.DeepEqual 43 _ = strings.Builder{} 44 _ = time.Second 45 46 _ = strcase.ToLowerCamel 47 _ = codes.NotFound 48 _ = status.Status{} 49 _ = protojson.UnmarshalOptions{} 50 _ = new(proto.Message) 51 _ = protoregistry.GlobalTypes 52 53 _ = new(gotenobject.FieldPath) 54 ) 55 56 // make sure we're using proto imports 57 var ( 58 _ = &alert.Alert{} 59 _ = &log_condition.LogCondition{} 60 _ = &policy.Policy{} 61 _ = &rcommon.LogCndSpec{} 62 _ = &ts_condition.TsCondition{} 63 _ = &iam_organization.Organization{} 64 _ = &iam_project.Project{} 65 _ = &monitoring_common.LabelDescriptor{} 66 _ = &durationpb.Duration{} 67 _ = ×tamppb.Timestamp{} 68 ) 69 70 // FieldPath provides implementation to handle 71 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 72 type NotificationMsg_FieldPath interface { 73 gotenobject.FieldPath 74 Selector() NotificationMsg_FieldPathSelector 75 Get(source *NotificationMsg) []interface{} 76 GetSingle(source *NotificationMsg) (interface{}, bool) 77 ClearValue(item *NotificationMsg) 78 79 // Those methods build corresponding NotificationMsg_FieldPathValue 80 // (or array of values) and holds passed value. Panics if injected type is incorrect. 81 WithIValue(value interface{}) NotificationMsg_FieldPathValue 82 WithIArrayOfValues(values interface{}) NotificationMsg_FieldPathArrayOfValues 83 WithIArrayItemValue(value interface{}) NotificationMsg_FieldPathArrayItemValue 84 } 85 86 type NotificationMsg_FieldPathSelector int32 87 88 const ( 89 NotificationMsg_FieldPathSelectorProjectFqn NotificationMsg_FieldPathSelector = 0 90 NotificationMsg_FieldPathSelectorProjectDisplayName NotificationMsg_FieldPathSelector = 1 91 NotificationMsg_FieldPathSelectorOrganizationFqn NotificationMsg_FieldPathSelector = 2 92 NotificationMsg_FieldPathSelectorOrganizationDisplayName NotificationMsg_FieldPathSelector = 3 93 NotificationMsg_FieldPathSelectorPolicyFqn NotificationMsg_FieldPathSelector = 4 94 NotificationMsg_FieldPathSelectorPolicyDisplayName NotificationMsg_FieldPathSelector = 5 95 NotificationMsg_FieldPathSelectorNewFiringAlerts NotificationMsg_FieldPathSelector = 6 96 NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator NotificationMsg_FieldPathSelector = 7 97 NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation NotificationMsg_FieldPathSelector = 8 98 NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi NotificationMsg_FieldPathSelector = 9 99 NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi NotificationMsg_FieldPathSelector = 10 100 NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied NotificationMsg_FieldPathSelector = 11 101 NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied NotificationMsg_FieldPathSelector = 12 102 NotificationMsg_FieldPathSelectorStoppedAlerts NotificationMsg_FieldPathSelector = 13 103 ) 104 105 func (s NotificationMsg_FieldPathSelector) String() string { 106 switch s { 107 case NotificationMsg_FieldPathSelectorProjectFqn: 108 return "project_fqn" 109 case NotificationMsg_FieldPathSelectorProjectDisplayName: 110 return "project_display_name" 111 case NotificationMsg_FieldPathSelectorOrganizationFqn: 112 return "organization_fqn" 113 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 114 return "organization_display_name" 115 case NotificationMsg_FieldPathSelectorPolicyFqn: 116 return "policy_fqn" 117 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 118 return "policy_display_name" 119 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 120 return "new_firing_alerts" 121 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 122 return "alerts_escalated_by_ai_to_operator" 123 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 124 return "alerts_awaiting_for_approval_with_ai_remediation" 125 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 126 return "alerts_flagged_to_ignore_by_ai" 127 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 128 return "alerts_with_condition_marked_for_adjusting_by_ai" 129 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 130 return "alerts_with_ai_remediation_applied" 131 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 132 return "alerts_with_operator_remediation_applied" 133 case NotificationMsg_FieldPathSelectorStoppedAlerts: 134 return "stopped_alerts" 135 default: 136 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", s)) 137 } 138 } 139 140 func BuildNotificationMsg_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsg_FieldPath, error) { 141 if len(fp) == 0 { 142 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg") 143 } 144 if len(fp) == 1 { 145 switch fp[0] { 146 case "project_fqn", "projectFqn", "project-fqn": 147 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorProjectFqn}, nil 148 case "project_display_name", "projectDisplayName", "project-display-name": 149 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorProjectDisplayName}, nil 150 case "organization_fqn", "organizationFqn", "organization-fqn": 151 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorOrganizationFqn}, nil 152 case "organization_display_name", "organizationDisplayName", "organization-display-name": 153 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorOrganizationDisplayName}, nil 154 case "policy_fqn", "policyFqn", "policy-fqn": 155 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorPolicyFqn}, nil 156 case "policy_display_name", "policyDisplayName", "policy-display-name": 157 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorPolicyDisplayName}, nil 158 case "new_firing_alerts", "newFiringAlerts", "new-firing-alerts": 159 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorNewFiringAlerts}, nil 160 case "alerts_escalated_by_ai_to_operator", "alertsEscalatedByAiToOperator", "alerts-escalated-by-ai-to-operator": 161 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator}, nil 162 case "alerts_awaiting_for_approval_with_ai_remediation", "alertsAwaitingForApprovalWithAiRemediation", "alerts-awaiting-for-approval-with-ai-remediation": 163 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation}, nil 164 case "alerts_flagged_to_ignore_by_ai", "alertsFlaggedToIgnoreByAi", "alerts-flagged-to-ignore-by-ai": 165 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi}, nil 166 case "alerts_with_condition_marked_for_adjusting_by_ai", "alertsWithConditionMarkedForAdjustingByAi", "alerts-with-condition-marked-for-adjusting-by-ai": 167 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi}, nil 168 case "alerts_with_ai_remediation_applied", "alertsWithAiRemediationApplied", "alerts-with-ai-remediation-applied": 169 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied}, nil 170 case "alerts_with_operator_remediation_applied", "alertsWithOperatorRemediationApplied", "alerts-with-operator-remediation-applied": 171 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied}, nil 172 case "stopped_alerts", "stoppedAlerts", "stopped-alerts": 173 return &NotificationMsg_FieldTerminalPath{selector: NotificationMsg_FieldPathSelectorStoppedAlerts}, nil 174 } 175 } else { 176 switch fp[0] { 177 case "new_firing_alerts", "newFiringAlerts", "new-firing-alerts": 178 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 179 return nil, err 180 } else { 181 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorNewFiringAlerts, subPath: subpath}, nil 182 } 183 case "alerts_escalated_by_ai_to_operator", "alertsEscalatedByAiToOperator", "alerts-escalated-by-ai-to-operator": 184 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 185 return nil, err 186 } else { 187 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator, subPath: subpath}, nil 188 } 189 case "alerts_awaiting_for_approval_with_ai_remediation", "alertsAwaitingForApprovalWithAiRemediation", "alerts-awaiting-for-approval-with-ai-remediation": 190 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 191 return nil, err 192 } else { 193 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation, subPath: subpath}, nil 194 } 195 case "alerts_flagged_to_ignore_by_ai", "alertsFlaggedToIgnoreByAi", "alerts-flagged-to-ignore-by-ai": 196 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 197 return nil, err 198 } else { 199 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi, subPath: subpath}, nil 200 } 201 case "alerts_with_condition_marked_for_adjusting_by_ai", "alertsWithConditionMarkedForAdjustingByAi", "alerts-with-condition-marked-for-adjusting-by-ai": 202 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 203 return nil, err 204 } else { 205 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi, subPath: subpath}, nil 206 } 207 case "alerts_with_ai_remediation_applied", "alertsWithAiRemediationApplied", "alerts-with-ai-remediation-applied": 208 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 209 return nil, err 210 } else { 211 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied, subPath: subpath}, nil 212 } 213 case "alerts_with_operator_remediation_applied", "alertsWithOperatorRemediationApplied", "alerts-with-operator-remediation-applied": 214 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 215 return nil, err 216 } else { 217 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied, subPath: subpath}, nil 218 } 219 case "stopped_alerts", "stoppedAlerts", "stopped-alerts": 220 if subpath, err := BuildNotificationMsgAlertsGroup_FieldPath(fp[1:]); err != nil { 221 return nil, err 222 } else { 223 return &NotificationMsg_FieldSubPath{selector: NotificationMsg_FieldPathSelectorStoppedAlerts, subPath: subpath}, nil 224 } 225 } 226 } 227 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg", fp) 228 } 229 230 func ParseNotificationMsg_FieldPath(rawField string) (NotificationMsg_FieldPath, error) { 231 fp, err := gotenobject.ParseRawFieldPath(rawField) 232 if err != nil { 233 return nil, err 234 } 235 return BuildNotificationMsg_FieldPath(fp) 236 } 237 238 func MustParseNotificationMsg_FieldPath(rawField string) NotificationMsg_FieldPath { 239 fp, err := ParseNotificationMsg_FieldPath(rawField) 240 if err != nil { 241 panic(err) 242 } 243 return fp 244 } 245 246 type NotificationMsg_FieldTerminalPath struct { 247 selector NotificationMsg_FieldPathSelector 248 } 249 250 var _ NotificationMsg_FieldPath = (*NotificationMsg_FieldTerminalPath)(nil) 251 252 func (fp *NotificationMsg_FieldTerminalPath) Selector() NotificationMsg_FieldPathSelector { 253 return fp.selector 254 } 255 256 // String returns path representation in proto convention 257 func (fp *NotificationMsg_FieldTerminalPath) String() string { 258 return fp.selector.String() 259 } 260 261 // JSONString returns path representation is JSON convention 262 func (fp *NotificationMsg_FieldTerminalPath) JSONString() string { 263 return strcase.ToLowerCamel(fp.String()) 264 } 265 266 // Get returns all values pointed by specific field from source NotificationMsg 267 func (fp *NotificationMsg_FieldTerminalPath) Get(source *NotificationMsg) (values []interface{}) { 268 if source != nil { 269 switch fp.selector { 270 case NotificationMsg_FieldPathSelectorProjectFqn: 271 if source.ProjectFqn != nil { 272 values = append(values, source.ProjectFqn) 273 } 274 case NotificationMsg_FieldPathSelectorProjectDisplayName: 275 values = append(values, source.ProjectDisplayName) 276 case NotificationMsg_FieldPathSelectorOrganizationFqn: 277 if source.OrganizationFqn != nil { 278 values = append(values, source.OrganizationFqn) 279 } 280 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 281 values = append(values, source.OrganizationDisplayName) 282 case NotificationMsg_FieldPathSelectorPolicyFqn: 283 if source.PolicyFqn != nil { 284 values = append(values, source.PolicyFqn) 285 } 286 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 287 values = append(values, source.PolicyDisplayName) 288 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 289 if source.NewFiringAlerts != nil { 290 values = append(values, source.NewFiringAlerts) 291 } 292 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 293 if source.AlertsEscalatedByAiToOperator != nil { 294 values = append(values, source.AlertsEscalatedByAiToOperator) 295 } 296 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 297 if source.AlertsAwaitingForApprovalWithAiRemediation != nil { 298 values = append(values, source.AlertsAwaitingForApprovalWithAiRemediation) 299 } 300 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 301 if source.AlertsFlaggedToIgnoreByAi != nil { 302 values = append(values, source.AlertsFlaggedToIgnoreByAi) 303 } 304 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 305 if source.AlertsWithConditionMarkedForAdjustingByAi != nil { 306 values = append(values, source.AlertsWithConditionMarkedForAdjustingByAi) 307 } 308 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 309 if source.AlertsWithAiRemediationApplied != nil { 310 values = append(values, source.AlertsWithAiRemediationApplied) 311 } 312 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 313 if source.AlertsWithOperatorRemediationApplied != nil { 314 values = append(values, source.AlertsWithOperatorRemediationApplied) 315 } 316 case NotificationMsg_FieldPathSelectorStoppedAlerts: 317 if source.StoppedAlerts != nil { 318 values = append(values, source.StoppedAlerts) 319 } 320 default: 321 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 322 } 323 } 324 return 325 } 326 327 func (fp *NotificationMsg_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 328 return fp.Get(source.(*NotificationMsg)) 329 } 330 331 // GetSingle returns value pointed by specific field of from source NotificationMsg 332 func (fp *NotificationMsg_FieldTerminalPath) GetSingle(source *NotificationMsg) (interface{}, bool) { 333 switch fp.selector { 334 case NotificationMsg_FieldPathSelectorProjectFqn: 335 res := source.GetProjectFqn() 336 return res, res != nil 337 case NotificationMsg_FieldPathSelectorProjectDisplayName: 338 return source.GetProjectDisplayName(), source != nil 339 case NotificationMsg_FieldPathSelectorOrganizationFqn: 340 res := source.GetOrganizationFqn() 341 return res, res != nil 342 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 343 return source.GetOrganizationDisplayName(), source != nil 344 case NotificationMsg_FieldPathSelectorPolicyFqn: 345 res := source.GetPolicyFqn() 346 return res, res != nil 347 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 348 return source.GetPolicyDisplayName(), source != nil 349 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 350 res := source.GetNewFiringAlerts() 351 return res, res != nil 352 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 353 res := source.GetAlertsEscalatedByAiToOperator() 354 return res, res != nil 355 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 356 res := source.GetAlertsAwaitingForApprovalWithAiRemediation() 357 return res, res != nil 358 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 359 res := source.GetAlertsFlaggedToIgnoreByAi() 360 return res, res != nil 361 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 362 res := source.GetAlertsWithConditionMarkedForAdjustingByAi() 363 return res, res != nil 364 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 365 res := source.GetAlertsWithAiRemediationApplied() 366 return res, res != nil 367 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 368 res := source.GetAlertsWithOperatorRemediationApplied() 369 return res, res != nil 370 case NotificationMsg_FieldPathSelectorStoppedAlerts: 371 res := source.GetStoppedAlerts() 372 return res, res != nil 373 default: 374 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 375 } 376 } 377 378 func (fp *NotificationMsg_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 379 return fp.GetSingle(source.(*NotificationMsg)) 380 } 381 382 // GetDefault returns a default value of the field type 383 func (fp *NotificationMsg_FieldTerminalPath) GetDefault() interface{} { 384 switch fp.selector { 385 case NotificationMsg_FieldPathSelectorProjectFqn: 386 return (*iam_project.Name)(nil) 387 case NotificationMsg_FieldPathSelectorProjectDisplayName: 388 return "" 389 case NotificationMsg_FieldPathSelectorOrganizationFqn: 390 return (*iam_organization.Name)(nil) 391 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 392 return "" 393 case NotificationMsg_FieldPathSelectorPolicyFqn: 394 return (*policy.Name)(nil) 395 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 396 return "" 397 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 398 return (*NotificationMsg_AlertsGroup)(nil) 399 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 400 return (*NotificationMsg_AlertsGroup)(nil) 401 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 402 return (*NotificationMsg_AlertsGroup)(nil) 403 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 404 return (*NotificationMsg_AlertsGroup)(nil) 405 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 406 return (*NotificationMsg_AlertsGroup)(nil) 407 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 408 return (*NotificationMsg_AlertsGroup)(nil) 409 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 410 return (*NotificationMsg_AlertsGroup)(nil) 411 case NotificationMsg_FieldPathSelectorStoppedAlerts: 412 return (*NotificationMsg_AlertsGroup)(nil) 413 default: 414 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 415 } 416 } 417 418 func (fp *NotificationMsg_FieldTerminalPath) ClearValue(item *NotificationMsg) { 419 if item != nil { 420 switch fp.selector { 421 case NotificationMsg_FieldPathSelectorProjectFqn: 422 item.ProjectFqn = nil 423 case NotificationMsg_FieldPathSelectorProjectDisplayName: 424 item.ProjectDisplayName = "" 425 case NotificationMsg_FieldPathSelectorOrganizationFqn: 426 item.OrganizationFqn = nil 427 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 428 item.OrganizationDisplayName = "" 429 case NotificationMsg_FieldPathSelectorPolicyFqn: 430 item.PolicyFqn = nil 431 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 432 item.PolicyDisplayName = "" 433 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 434 item.NewFiringAlerts = nil 435 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 436 item.AlertsEscalatedByAiToOperator = nil 437 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 438 item.AlertsAwaitingForApprovalWithAiRemediation = nil 439 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 440 item.AlertsFlaggedToIgnoreByAi = nil 441 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 442 item.AlertsWithConditionMarkedForAdjustingByAi = nil 443 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 444 item.AlertsWithAiRemediationApplied = nil 445 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 446 item.AlertsWithOperatorRemediationApplied = nil 447 case NotificationMsg_FieldPathSelectorStoppedAlerts: 448 item.StoppedAlerts = nil 449 default: 450 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 451 } 452 } 453 } 454 455 func (fp *NotificationMsg_FieldTerminalPath) ClearValueRaw(item proto.Message) { 456 fp.ClearValue(item.(*NotificationMsg)) 457 } 458 459 // IsLeaf - whether field path is holds simple value 460 func (fp *NotificationMsg_FieldTerminalPath) IsLeaf() bool { 461 return fp.selector == NotificationMsg_FieldPathSelectorProjectFqn || 462 fp.selector == NotificationMsg_FieldPathSelectorProjectDisplayName || 463 fp.selector == NotificationMsg_FieldPathSelectorOrganizationFqn || 464 fp.selector == NotificationMsg_FieldPathSelectorOrganizationDisplayName || 465 fp.selector == NotificationMsg_FieldPathSelectorPolicyFqn || 466 fp.selector == NotificationMsg_FieldPathSelectorPolicyDisplayName 467 } 468 469 func (fp *NotificationMsg_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 470 return []gotenobject.FieldPath{fp} 471 } 472 473 func (fp *NotificationMsg_FieldTerminalPath) WithIValue(value interface{}) NotificationMsg_FieldPathValue { 474 switch fp.selector { 475 case NotificationMsg_FieldPathSelectorProjectFqn: 476 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*iam_project.Name)} 477 case NotificationMsg_FieldPathSelectorProjectDisplayName: 478 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(string)} 479 case NotificationMsg_FieldPathSelectorOrganizationFqn: 480 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*iam_organization.Name)} 481 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 482 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(string)} 483 case NotificationMsg_FieldPathSelectorPolicyFqn: 484 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*policy.Name)} 485 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 486 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(string)} 487 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 488 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 489 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 490 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 491 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 492 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 493 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 494 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 495 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 496 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 497 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 498 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 499 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 500 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 501 case NotificationMsg_FieldPathSelectorStoppedAlerts: 502 return &NotificationMsg_FieldTerminalPathValue{NotificationMsg_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup)} 503 default: 504 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 505 } 506 } 507 508 func (fp *NotificationMsg_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 509 return fp.WithIValue(value) 510 } 511 512 func (fp *NotificationMsg_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsg_FieldPathArrayOfValues { 513 fpaov := &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp} 514 switch fp.selector { 515 case NotificationMsg_FieldPathSelectorProjectFqn: 516 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*iam_project.Name)} 517 case NotificationMsg_FieldPathSelectorProjectDisplayName: 518 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]string)} 519 case NotificationMsg_FieldPathSelectorOrganizationFqn: 520 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*iam_organization.Name)} 521 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 522 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]string)} 523 case NotificationMsg_FieldPathSelectorPolicyFqn: 524 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*policy.Name)} 525 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 526 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]string)} 527 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 528 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 529 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 530 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 531 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 532 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 533 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 534 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 535 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 536 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 537 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 538 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 539 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 540 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 541 case NotificationMsg_FieldPathSelectorStoppedAlerts: 542 return &NotificationMsg_FieldTerminalPathArrayOfValues{NotificationMsg_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup)} 543 default: 544 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 545 } 546 return fpaov 547 } 548 549 func (fp *NotificationMsg_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 550 return fp.WithIArrayOfValues(values) 551 } 552 553 func (fp *NotificationMsg_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsg_FieldPathArrayItemValue { 554 switch fp.selector { 555 default: 556 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fp.selector)) 557 } 558 } 559 560 func (fp *NotificationMsg_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 561 return fp.WithIArrayItemValue(value) 562 } 563 564 type NotificationMsg_FieldSubPath struct { 565 selector NotificationMsg_FieldPathSelector 566 subPath gotenobject.FieldPath 567 } 568 569 var _ NotificationMsg_FieldPath = (*NotificationMsg_FieldSubPath)(nil) 570 571 func (fps *NotificationMsg_FieldSubPath) Selector() NotificationMsg_FieldPathSelector { 572 return fps.selector 573 } 574 func (fps *NotificationMsg_FieldSubPath) AsNewFiringAlertsSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 575 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 576 return res, ok 577 } 578 func (fps *NotificationMsg_FieldSubPath) AsAlertsEscalatedByAiToOperatorSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 579 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 580 return res, ok 581 } 582 func (fps *NotificationMsg_FieldSubPath) AsAlertsAwaitingForApprovalWithAiRemediationSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 583 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 584 return res, ok 585 } 586 func (fps *NotificationMsg_FieldSubPath) AsAlertsFlaggedToIgnoreByAiSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 587 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 588 return res, ok 589 } 590 func (fps *NotificationMsg_FieldSubPath) AsAlertsWithConditionMarkedForAdjustingByAiSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 591 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 592 return res, ok 593 } 594 func (fps *NotificationMsg_FieldSubPath) AsAlertsWithAiRemediationAppliedSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 595 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 596 return res, ok 597 } 598 func (fps *NotificationMsg_FieldSubPath) AsAlertsWithOperatorRemediationAppliedSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 599 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 600 return res, ok 601 } 602 func (fps *NotificationMsg_FieldSubPath) AsStoppedAlertsSubPath() (NotificationMsgAlertsGroup_FieldPath, bool) { 603 res, ok := fps.subPath.(NotificationMsgAlertsGroup_FieldPath) 604 return res, ok 605 } 606 607 // String returns path representation in proto convention 608 func (fps *NotificationMsg_FieldSubPath) String() string { 609 return fps.selector.String() + "." + fps.subPath.String() 610 } 611 612 // JSONString returns path representation is JSON convention 613 func (fps *NotificationMsg_FieldSubPath) JSONString() string { 614 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 615 } 616 617 // Get returns all values pointed by selected field from source NotificationMsg 618 func (fps *NotificationMsg_FieldSubPath) Get(source *NotificationMsg) (values []interface{}) { 619 switch fps.selector { 620 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 621 values = append(values, fps.subPath.GetRaw(source.GetNewFiringAlerts())...) 622 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 623 values = append(values, fps.subPath.GetRaw(source.GetAlertsEscalatedByAiToOperator())...) 624 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 625 values = append(values, fps.subPath.GetRaw(source.GetAlertsAwaitingForApprovalWithAiRemediation())...) 626 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 627 values = append(values, fps.subPath.GetRaw(source.GetAlertsFlaggedToIgnoreByAi())...) 628 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 629 values = append(values, fps.subPath.GetRaw(source.GetAlertsWithConditionMarkedForAdjustingByAi())...) 630 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 631 values = append(values, fps.subPath.GetRaw(source.GetAlertsWithAiRemediationApplied())...) 632 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 633 values = append(values, fps.subPath.GetRaw(source.GetAlertsWithOperatorRemediationApplied())...) 634 case NotificationMsg_FieldPathSelectorStoppedAlerts: 635 values = append(values, fps.subPath.GetRaw(source.GetStoppedAlerts())...) 636 default: 637 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fps.selector)) 638 } 639 return 640 } 641 642 func (fps *NotificationMsg_FieldSubPath) GetRaw(source proto.Message) []interface{} { 643 return fps.Get(source.(*NotificationMsg)) 644 } 645 646 // GetSingle returns value of selected field from source NotificationMsg 647 func (fps *NotificationMsg_FieldSubPath) GetSingle(source *NotificationMsg) (interface{}, bool) { 648 switch fps.selector { 649 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 650 if source.GetNewFiringAlerts() == nil { 651 return nil, false 652 } 653 return fps.subPath.GetSingleRaw(source.GetNewFiringAlerts()) 654 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 655 if source.GetAlertsEscalatedByAiToOperator() == nil { 656 return nil, false 657 } 658 return fps.subPath.GetSingleRaw(source.GetAlertsEscalatedByAiToOperator()) 659 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 660 if source.GetAlertsAwaitingForApprovalWithAiRemediation() == nil { 661 return nil, false 662 } 663 return fps.subPath.GetSingleRaw(source.GetAlertsAwaitingForApprovalWithAiRemediation()) 664 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 665 if source.GetAlertsFlaggedToIgnoreByAi() == nil { 666 return nil, false 667 } 668 return fps.subPath.GetSingleRaw(source.GetAlertsFlaggedToIgnoreByAi()) 669 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 670 if source.GetAlertsWithConditionMarkedForAdjustingByAi() == nil { 671 return nil, false 672 } 673 return fps.subPath.GetSingleRaw(source.GetAlertsWithConditionMarkedForAdjustingByAi()) 674 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 675 if source.GetAlertsWithAiRemediationApplied() == nil { 676 return nil, false 677 } 678 return fps.subPath.GetSingleRaw(source.GetAlertsWithAiRemediationApplied()) 679 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 680 if source.GetAlertsWithOperatorRemediationApplied() == nil { 681 return nil, false 682 } 683 return fps.subPath.GetSingleRaw(source.GetAlertsWithOperatorRemediationApplied()) 684 case NotificationMsg_FieldPathSelectorStoppedAlerts: 685 if source.GetStoppedAlerts() == nil { 686 return nil, false 687 } 688 return fps.subPath.GetSingleRaw(source.GetStoppedAlerts()) 689 default: 690 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fps.selector)) 691 } 692 } 693 694 func (fps *NotificationMsg_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 695 return fps.GetSingle(source.(*NotificationMsg)) 696 } 697 698 // GetDefault returns a default value of the field type 699 func (fps *NotificationMsg_FieldSubPath) GetDefault() interface{} { 700 return fps.subPath.GetDefault() 701 } 702 703 func (fps *NotificationMsg_FieldSubPath) ClearValue(item *NotificationMsg) { 704 if item != nil { 705 switch fps.selector { 706 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 707 fps.subPath.ClearValueRaw(item.NewFiringAlerts) 708 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 709 fps.subPath.ClearValueRaw(item.AlertsEscalatedByAiToOperator) 710 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 711 fps.subPath.ClearValueRaw(item.AlertsAwaitingForApprovalWithAiRemediation) 712 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 713 fps.subPath.ClearValueRaw(item.AlertsFlaggedToIgnoreByAi) 714 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 715 fps.subPath.ClearValueRaw(item.AlertsWithConditionMarkedForAdjustingByAi) 716 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 717 fps.subPath.ClearValueRaw(item.AlertsWithAiRemediationApplied) 718 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 719 fps.subPath.ClearValueRaw(item.AlertsWithOperatorRemediationApplied) 720 case NotificationMsg_FieldPathSelectorStoppedAlerts: 721 fps.subPath.ClearValueRaw(item.StoppedAlerts) 722 default: 723 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fps.selector)) 724 } 725 } 726 } 727 728 func (fps *NotificationMsg_FieldSubPath) ClearValueRaw(item proto.Message) { 729 fps.ClearValue(item.(*NotificationMsg)) 730 } 731 732 // IsLeaf - whether field path is holds simple value 733 func (fps *NotificationMsg_FieldSubPath) IsLeaf() bool { 734 return fps.subPath.IsLeaf() 735 } 736 737 func (fps *NotificationMsg_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 738 iPaths := []gotenobject.FieldPath{&NotificationMsg_FieldTerminalPath{selector: fps.selector}} 739 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 740 return iPaths 741 } 742 743 func (fps *NotificationMsg_FieldSubPath) WithIValue(value interface{}) NotificationMsg_FieldPathValue { 744 return &NotificationMsg_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 745 } 746 747 func (fps *NotificationMsg_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 748 return fps.WithIValue(value) 749 } 750 751 func (fps *NotificationMsg_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsg_FieldPathArrayOfValues { 752 return &NotificationMsg_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 753 } 754 755 func (fps *NotificationMsg_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 756 return fps.WithIArrayOfValues(values) 757 } 758 759 func (fps *NotificationMsg_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsg_FieldPathArrayItemValue { 760 return &NotificationMsg_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 761 } 762 763 func (fps *NotificationMsg_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 764 return fps.WithIArrayItemValue(value) 765 } 766 767 // NotificationMsg_FieldPathValue allows storing values for NotificationMsg fields according to their type 768 type NotificationMsg_FieldPathValue interface { 769 NotificationMsg_FieldPath 770 gotenobject.FieldPathValue 771 SetTo(target **NotificationMsg) 772 CompareWith(*NotificationMsg) (cmp int, comparable bool) 773 } 774 775 func ParseNotificationMsg_FieldPathValue(pathStr, valueStr string) (NotificationMsg_FieldPathValue, error) { 776 fp, err := ParseNotificationMsg_FieldPath(pathStr) 777 if err != nil { 778 return nil, err 779 } 780 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 781 if err != nil { 782 return nil, status.Errorf(codes.InvalidArgument, "error parsing NotificationMsg field path value from %s: %v", valueStr, err) 783 } 784 return fpv.(NotificationMsg_FieldPathValue), nil 785 } 786 787 func MustParseNotificationMsg_FieldPathValue(pathStr, valueStr string) NotificationMsg_FieldPathValue { 788 fpv, err := ParseNotificationMsg_FieldPathValue(pathStr, valueStr) 789 if err != nil { 790 panic(err) 791 } 792 return fpv 793 } 794 795 type NotificationMsg_FieldTerminalPathValue struct { 796 NotificationMsg_FieldTerminalPath 797 value interface{} 798 } 799 800 var _ NotificationMsg_FieldPathValue = (*NotificationMsg_FieldTerminalPathValue)(nil) 801 802 // GetRawValue returns raw value stored under selected path for 'NotificationMsg' as interface{} 803 func (fpv *NotificationMsg_FieldTerminalPathValue) GetRawValue() interface{} { 804 return fpv.value 805 } 806 func (fpv *NotificationMsg_FieldTerminalPathValue) AsProjectFqnValue() (*iam_project.Name, bool) { 807 res, ok := fpv.value.(*iam_project.Name) 808 return res, ok 809 } 810 func (fpv *NotificationMsg_FieldTerminalPathValue) AsProjectDisplayNameValue() (string, bool) { 811 res, ok := fpv.value.(string) 812 return res, ok 813 } 814 func (fpv *NotificationMsg_FieldTerminalPathValue) AsOrganizationFqnValue() (*iam_organization.Name, bool) { 815 res, ok := fpv.value.(*iam_organization.Name) 816 return res, ok 817 } 818 func (fpv *NotificationMsg_FieldTerminalPathValue) AsOrganizationDisplayNameValue() (string, bool) { 819 res, ok := fpv.value.(string) 820 return res, ok 821 } 822 func (fpv *NotificationMsg_FieldTerminalPathValue) AsPolicyFqnValue() (*policy.Name, bool) { 823 res, ok := fpv.value.(*policy.Name) 824 return res, ok 825 } 826 func (fpv *NotificationMsg_FieldTerminalPathValue) AsPolicyDisplayNameValue() (string, bool) { 827 res, ok := fpv.value.(string) 828 return res, ok 829 } 830 func (fpv *NotificationMsg_FieldTerminalPathValue) AsNewFiringAlertsValue() (*NotificationMsg_AlertsGroup, bool) { 831 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 832 return res, ok 833 } 834 func (fpv *NotificationMsg_FieldTerminalPathValue) AsAlertsEscalatedByAiToOperatorValue() (*NotificationMsg_AlertsGroup, bool) { 835 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 836 return res, ok 837 } 838 func (fpv *NotificationMsg_FieldTerminalPathValue) AsAlertsAwaitingForApprovalWithAiRemediationValue() (*NotificationMsg_AlertsGroup, bool) { 839 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 840 return res, ok 841 } 842 func (fpv *NotificationMsg_FieldTerminalPathValue) AsAlertsFlaggedToIgnoreByAiValue() (*NotificationMsg_AlertsGroup, bool) { 843 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 844 return res, ok 845 } 846 func (fpv *NotificationMsg_FieldTerminalPathValue) AsAlertsWithConditionMarkedForAdjustingByAiValue() (*NotificationMsg_AlertsGroup, bool) { 847 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 848 return res, ok 849 } 850 func (fpv *NotificationMsg_FieldTerminalPathValue) AsAlertsWithAiRemediationAppliedValue() (*NotificationMsg_AlertsGroup, bool) { 851 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 852 return res, ok 853 } 854 func (fpv *NotificationMsg_FieldTerminalPathValue) AsAlertsWithOperatorRemediationAppliedValue() (*NotificationMsg_AlertsGroup, bool) { 855 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 856 return res, ok 857 } 858 func (fpv *NotificationMsg_FieldTerminalPathValue) AsStoppedAlertsValue() (*NotificationMsg_AlertsGroup, bool) { 859 res, ok := fpv.value.(*NotificationMsg_AlertsGroup) 860 return res, ok 861 } 862 863 // SetTo stores value for selected field for object NotificationMsg 864 func (fpv *NotificationMsg_FieldTerminalPathValue) SetTo(target **NotificationMsg) { 865 if *target == nil { 866 *target = new(NotificationMsg) 867 } 868 switch fpv.selector { 869 case NotificationMsg_FieldPathSelectorProjectFqn: 870 (*target).ProjectFqn = fpv.value.(*iam_project.Name) 871 case NotificationMsg_FieldPathSelectorProjectDisplayName: 872 (*target).ProjectDisplayName = fpv.value.(string) 873 case NotificationMsg_FieldPathSelectorOrganizationFqn: 874 (*target).OrganizationFqn = fpv.value.(*iam_organization.Name) 875 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 876 (*target).OrganizationDisplayName = fpv.value.(string) 877 case NotificationMsg_FieldPathSelectorPolicyFqn: 878 (*target).PolicyFqn = fpv.value.(*policy.Name) 879 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 880 (*target).PolicyDisplayName = fpv.value.(string) 881 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 882 (*target).NewFiringAlerts = fpv.value.(*NotificationMsg_AlertsGroup) 883 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 884 (*target).AlertsEscalatedByAiToOperator = fpv.value.(*NotificationMsg_AlertsGroup) 885 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 886 (*target).AlertsAwaitingForApprovalWithAiRemediation = fpv.value.(*NotificationMsg_AlertsGroup) 887 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 888 (*target).AlertsFlaggedToIgnoreByAi = fpv.value.(*NotificationMsg_AlertsGroup) 889 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 890 (*target).AlertsWithConditionMarkedForAdjustingByAi = fpv.value.(*NotificationMsg_AlertsGroup) 891 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 892 (*target).AlertsWithAiRemediationApplied = fpv.value.(*NotificationMsg_AlertsGroup) 893 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 894 (*target).AlertsWithOperatorRemediationApplied = fpv.value.(*NotificationMsg_AlertsGroup) 895 case NotificationMsg_FieldPathSelectorStoppedAlerts: 896 (*target).StoppedAlerts = fpv.value.(*NotificationMsg_AlertsGroup) 897 default: 898 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fpv.selector)) 899 } 900 } 901 902 func (fpv *NotificationMsg_FieldTerminalPathValue) SetToRaw(target proto.Message) { 903 typedObject := target.(*NotificationMsg) 904 fpv.SetTo(&typedObject) 905 } 906 907 // CompareWith compares value in the 'NotificationMsg_FieldTerminalPathValue' with the value under path in 'NotificationMsg'. 908 func (fpv *NotificationMsg_FieldTerminalPathValue) CompareWith(source *NotificationMsg) (int, bool) { 909 switch fpv.selector { 910 case NotificationMsg_FieldPathSelectorProjectFqn: 911 leftValue := fpv.value.(*iam_project.Name) 912 rightValue := source.GetProjectFqn() 913 if leftValue == nil { 914 if rightValue != nil { 915 return -1, true 916 } 917 return 0, true 918 } 919 if rightValue == nil { 920 return 1, true 921 } 922 if leftValue.String() == rightValue.String() { 923 return 0, true 924 } else if leftValue.String() < rightValue.String() { 925 return -1, true 926 } else { 927 return 1, true 928 } 929 case NotificationMsg_FieldPathSelectorProjectDisplayName: 930 leftValue := fpv.value.(string) 931 rightValue := source.GetProjectDisplayName() 932 if (leftValue) == (rightValue) { 933 return 0, true 934 } else if (leftValue) < (rightValue) { 935 return -1, true 936 } else { 937 return 1, true 938 } 939 case NotificationMsg_FieldPathSelectorOrganizationFqn: 940 leftValue := fpv.value.(*iam_organization.Name) 941 rightValue := source.GetOrganizationFqn() 942 if leftValue == nil { 943 if rightValue != nil { 944 return -1, true 945 } 946 return 0, true 947 } 948 if rightValue == nil { 949 return 1, true 950 } 951 if leftValue.String() == rightValue.String() { 952 return 0, true 953 } else if leftValue.String() < rightValue.String() { 954 return -1, true 955 } else { 956 return 1, true 957 } 958 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 959 leftValue := fpv.value.(string) 960 rightValue := source.GetOrganizationDisplayName() 961 if (leftValue) == (rightValue) { 962 return 0, true 963 } else if (leftValue) < (rightValue) { 964 return -1, true 965 } else { 966 return 1, true 967 } 968 case NotificationMsg_FieldPathSelectorPolicyFqn: 969 leftValue := fpv.value.(*policy.Name) 970 rightValue := source.GetPolicyFqn() 971 if leftValue == nil { 972 if rightValue != nil { 973 return -1, true 974 } 975 return 0, true 976 } 977 if rightValue == nil { 978 return 1, true 979 } 980 if leftValue.String() == rightValue.String() { 981 return 0, true 982 } else if leftValue.String() < rightValue.String() { 983 return -1, true 984 } else { 985 return 1, true 986 } 987 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 988 leftValue := fpv.value.(string) 989 rightValue := source.GetPolicyDisplayName() 990 if (leftValue) == (rightValue) { 991 return 0, true 992 } else if (leftValue) < (rightValue) { 993 return -1, true 994 } else { 995 return 1, true 996 } 997 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 998 return 0, false 999 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 1000 return 0, false 1001 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 1002 return 0, false 1003 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 1004 return 0, false 1005 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 1006 return 0, false 1007 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 1008 return 0, false 1009 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 1010 return 0, false 1011 case NotificationMsg_FieldPathSelectorStoppedAlerts: 1012 return 0, false 1013 default: 1014 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fpv.selector)) 1015 } 1016 } 1017 1018 func (fpv *NotificationMsg_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1019 return fpv.CompareWith(source.(*NotificationMsg)) 1020 } 1021 1022 type NotificationMsg_FieldSubPathValue struct { 1023 NotificationMsg_FieldPath 1024 subPathValue gotenobject.FieldPathValue 1025 } 1026 1027 var _ NotificationMsg_FieldPathValue = (*NotificationMsg_FieldSubPathValue)(nil) 1028 1029 func (fpvs *NotificationMsg_FieldSubPathValue) AsNewFiringAlertsPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1030 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1031 return res, ok 1032 } 1033 func (fpvs *NotificationMsg_FieldSubPathValue) AsAlertsEscalatedByAiToOperatorPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1034 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1035 return res, ok 1036 } 1037 func (fpvs *NotificationMsg_FieldSubPathValue) AsAlertsAwaitingForApprovalWithAiRemediationPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1038 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1039 return res, ok 1040 } 1041 func (fpvs *NotificationMsg_FieldSubPathValue) AsAlertsFlaggedToIgnoreByAiPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1042 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1043 return res, ok 1044 } 1045 func (fpvs *NotificationMsg_FieldSubPathValue) AsAlertsWithConditionMarkedForAdjustingByAiPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1046 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1047 return res, ok 1048 } 1049 func (fpvs *NotificationMsg_FieldSubPathValue) AsAlertsWithAiRemediationAppliedPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1050 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1051 return res, ok 1052 } 1053 func (fpvs *NotificationMsg_FieldSubPathValue) AsAlertsWithOperatorRemediationAppliedPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1054 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1055 return res, ok 1056 } 1057 func (fpvs *NotificationMsg_FieldSubPathValue) AsStoppedAlertsPathValue() (NotificationMsgAlertsGroup_FieldPathValue, bool) { 1058 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue) 1059 return res, ok 1060 } 1061 1062 func (fpvs *NotificationMsg_FieldSubPathValue) SetTo(target **NotificationMsg) { 1063 if *target == nil { 1064 *target = new(NotificationMsg) 1065 } 1066 switch fpvs.Selector() { 1067 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 1068 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).NewFiringAlerts) 1069 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 1070 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).AlertsEscalatedByAiToOperator) 1071 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 1072 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).AlertsAwaitingForApprovalWithAiRemediation) 1073 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 1074 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).AlertsFlaggedToIgnoreByAi) 1075 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 1076 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).AlertsWithConditionMarkedForAdjustingByAi) 1077 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 1078 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).AlertsWithAiRemediationApplied) 1079 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 1080 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).AlertsWithOperatorRemediationApplied) 1081 case NotificationMsg_FieldPathSelectorStoppedAlerts: 1082 fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).SetTo(&(*target).StoppedAlerts) 1083 default: 1084 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fpvs.Selector())) 1085 } 1086 } 1087 1088 func (fpvs *NotificationMsg_FieldSubPathValue) SetToRaw(target proto.Message) { 1089 typedObject := target.(*NotificationMsg) 1090 fpvs.SetTo(&typedObject) 1091 } 1092 1093 func (fpvs *NotificationMsg_FieldSubPathValue) GetRawValue() interface{} { 1094 return fpvs.subPathValue.GetRawValue() 1095 } 1096 1097 func (fpvs *NotificationMsg_FieldSubPathValue) CompareWith(source *NotificationMsg) (int, bool) { 1098 switch fpvs.Selector() { 1099 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 1100 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetNewFiringAlerts()) 1101 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 1102 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetAlertsEscalatedByAiToOperator()) 1103 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 1104 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetAlertsAwaitingForApprovalWithAiRemediation()) 1105 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 1106 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetAlertsFlaggedToIgnoreByAi()) 1107 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 1108 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetAlertsWithConditionMarkedForAdjustingByAi()) 1109 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 1110 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetAlertsWithAiRemediationApplied()) 1111 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 1112 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetAlertsWithOperatorRemediationApplied()) 1113 case NotificationMsg_FieldPathSelectorStoppedAlerts: 1114 return fpvs.subPathValue.(NotificationMsgAlertsGroup_FieldPathValue).CompareWith(source.GetStoppedAlerts()) 1115 default: 1116 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fpvs.Selector())) 1117 } 1118 } 1119 1120 func (fpvs *NotificationMsg_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1121 return fpvs.CompareWith(source.(*NotificationMsg)) 1122 } 1123 1124 // NotificationMsg_FieldPathArrayItemValue allows storing single item in Path-specific values for NotificationMsg according to their type 1125 // Present only for array (repeated) types. 1126 type NotificationMsg_FieldPathArrayItemValue interface { 1127 gotenobject.FieldPathArrayItemValue 1128 NotificationMsg_FieldPath 1129 ContainsValue(*NotificationMsg) bool 1130 } 1131 1132 // ParseNotificationMsg_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 1133 func ParseNotificationMsg_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsg_FieldPathArrayItemValue, error) { 1134 fp, err := ParseNotificationMsg_FieldPath(pathStr) 1135 if err != nil { 1136 return nil, err 1137 } 1138 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 1139 if err != nil { 1140 return nil, status.Errorf(codes.InvalidArgument, "error parsing NotificationMsg field path array item value from %s: %v", valueStr, err) 1141 } 1142 return fpaiv.(NotificationMsg_FieldPathArrayItemValue), nil 1143 } 1144 1145 func MustParseNotificationMsg_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsg_FieldPathArrayItemValue { 1146 fpaiv, err := ParseNotificationMsg_FieldPathArrayItemValue(pathStr, valueStr) 1147 if err != nil { 1148 panic(err) 1149 } 1150 return fpaiv 1151 } 1152 1153 type NotificationMsg_FieldTerminalPathArrayItemValue struct { 1154 NotificationMsg_FieldTerminalPath 1155 value interface{} 1156 } 1157 1158 var _ NotificationMsg_FieldPathArrayItemValue = (*NotificationMsg_FieldTerminalPathArrayItemValue)(nil) 1159 1160 // GetRawValue returns stored element value for array in object NotificationMsg as interface{} 1161 func (fpaiv *NotificationMsg_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 1162 return fpaiv.value 1163 } 1164 1165 func (fpaiv *NotificationMsg_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg) (interface{}, bool) { 1166 return nil, false 1167 } 1168 1169 func (fpaiv *NotificationMsg_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 1170 return fpaiv.GetSingle(source.(*NotificationMsg)) 1171 } 1172 1173 // Contains returns a boolean indicating if value that is being held is present in given 'NotificationMsg' 1174 func (fpaiv *NotificationMsg_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg) bool { 1175 slice := fpaiv.NotificationMsg_FieldTerminalPath.Get(source) 1176 for _, v := range slice { 1177 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 1178 if proto.Equal(asProtoMsg, v.(proto.Message)) { 1179 return true 1180 } 1181 } else if reflect.DeepEqual(v, fpaiv.value) { 1182 return true 1183 } 1184 } 1185 return false 1186 } 1187 1188 type NotificationMsg_FieldSubPathArrayItemValue struct { 1189 NotificationMsg_FieldPath 1190 subPathItemValue gotenobject.FieldPathArrayItemValue 1191 } 1192 1193 // GetRawValue returns stored array item value 1194 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 1195 return fpaivs.subPathItemValue.GetRawItemValue() 1196 } 1197 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsNewFiringAlertsPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1198 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1199 return res, ok 1200 } 1201 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsAlertsEscalatedByAiToOperatorPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1202 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1203 return res, ok 1204 } 1205 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsAlertsAwaitingForApprovalWithAiRemediationPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1206 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1207 return res, ok 1208 } 1209 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsAlertsFlaggedToIgnoreByAiPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1210 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1211 return res, ok 1212 } 1213 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsAlertsWithConditionMarkedForAdjustingByAiPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1214 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1215 return res, ok 1216 } 1217 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsAlertsWithAiRemediationAppliedPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1218 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1219 return res, ok 1220 } 1221 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsAlertsWithOperatorRemediationAppliedPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1222 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1223 return res, ok 1224 } 1225 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) AsStoppedAlertsPathItemValue() (NotificationMsgAlertsGroup_FieldPathArrayItemValue, bool) { 1226 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue) 1227 return res, ok 1228 } 1229 1230 // Contains returns a boolean indicating if value that is being held is present in given 'NotificationMsg' 1231 func (fpaivs *NotificationMsg_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg) bool { 1232 switch fpaivs.Selector() { 1233 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 1234 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetNewFiringAlerts()) 1235 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 1236 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetAlertsEscalatedByAiToOperator()) 1237 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 1238 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetAlertsAwaitingForApprovalWithAiRemediation()) 1239 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 1240 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetAlertsFlaggedToIgnoreByAi()) 1241 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 1242 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetAlertsWithConditionMarkedForAdjustingByAi()) 1243 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 1244 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetAlertsWithAiRemediationApplied()) 1245 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 1246 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetAlertsWithOperatorRemediationApplied()) 1247 case NotificationMsg_FieldPathSelectorStoppedAlerts: 1248 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroup_FieldPathArrayItemValue).ContainsValue(source.GetStoppedAlerts()) 1249 default: 1250 panic(fmt.Sprintf("Invalid selector for NotificationMsg: %d", fpaivs.Selector())) 1251 } 1252 } 1253 1254 // NotificationMsg_FieldPathArrayOfValues allows storing slice of values for NotificationMsg fields according to their type 1255 type NotificationMsg_FieldPathArrayOfValues interface { 1256 gotenobject.FieldPathArrayOfValues 1257 NotificationMsg_FieldPath 1258 } 1259 1260 func ParseNotificationMsg_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsg_FieldPathArrayOfValues, error) { 1261 fp, err := ParseNotificationMsg_FieldPath(pathStr) 1262 if err != nil { 1263 return nil, err 1264 } 1265 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 1266 if err != nil { 1267 return nil, status.Errorf(codes.InvalidArgument, "error parsing NotificationMsg field path array of values from %s: %v", valuesStr, err) 1268 } 1269 return fpaov.(NotificationMsg_FieldPathArrayOfValues), nil 1270 } 1271 1272 func MustParseNotificationMsg_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsg_FieldPathArrayOfValues { 1273 fpaov, err := ParseNotificationMsg_FieldPathArrayOfValues(pathStr, valuesStr) 1274 if err != nil { 1275 panic(err) 1276 } 1277 return fpaov 1278 } 1279 1280 type NotificationMsg_FieldTerminalPathArrayOfValues struct { 1281 NotificationMsg_FieldTerminalPath 1282 values interface{} 1283 } 1284 1285 var _ NotificationMsg_FieldPathArrayOfValues = (*NotificationMsg_FieldTerminalPathArrayOfValues)(nil) 1286 1287 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 1288 switch fpaov.selector { 1289 case NotificationMsg_FieldPathSelectorProjectFqn: 1290 for _, v := range fpaov.values.([]*iam_project.Name) { 1291 values = append(values, v) 1292 } 1293 case NotificationMsg_FieldPathSelectorProjectDisplayName: 1294 for _, v := range fpaov.values.([]string) { 1295 values = append(values, v) 1296 } 1297 case NotificationMsg_FieldPathSelectorOrganizationFqn: 1298 for _, v := range fpaov.values.([]*iam_organization.Name) { 1299 values = append(values, v) 1300 } 1301 case NotificationMsg_FieldPathSelectorOrganizationDisplayName: 1302 for _, v := range fpaov.values.([]string) { 1303 values = append(values, v) 1304 } 1305 case NotificationMsg_FieldPathSelectorPolicyFqn: 1306 for _, v := range fpaov.values.([]*policy.Name) { 1307 values = append(values, v) 1308 } 1309 case NotificationMsg_FieldPathSelectorPolicyDisplayName: 1310 for _, v := range fpaov.values.([]string) { 1311 values = append(values, v) 1312 } 1313 case NotificationMsg_FieldPathSelectorNewFiringAlerts: 1314 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1315 values = append(values, v) 1316 } 1317 case NotificationMsg_FieldPathSelectorAlertsEscalatedByAiToOperator: 1318 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1319 values = append(values, v) 1320 } 1321 case NotificationMsg_FieldPathSelectorAlertsAwaitingForApprovalWithAiRemediation: 1322 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1323 values = append(values, v) 1324 } 1325 case NotificationMsg_FieldPathSelectorAlertsFlaggedToIgnoreByAi: 1326 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1327 values = append(values, v) 1328 } 1329 case NotificationMsg_FieldPathSelectorAlertsWithConditionMarkedForAdjustingByAi: 1330 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1331 values = append(values, v) 1332 } 1333 case NotificationMsg_FieldPathSelectorAlertsWithAiRemediationApplied: 1334 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1335 values = append(values, v) 1336 } 1337 case NotificationMsg_FieldPathSelectorAlertsWithOperatorRemediationApplied: 1338 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1339 values = append(values, v) 1340 } 1341 case NotificationMsg_FieldPathSelectorStoppedAlerts: 1342 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup) { 1343 values = append(values, v) 1344 } 1345 } 1346 return 1347 } 1348 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsProjectFqnArrayOfValues() ([]*iam_project.Name, bool) { 1349 res, ok := fpaov.values.([]*iam_project.Name) 1350 return res, ok 1351 } 1352 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsProjectDisplayNameArrayOfValues() ([]string, bool) { 1353 res, ok := fpaov.values.([]string) 1354 return res, ok 1355 } 1356 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsOrganizationFqnArrayOfValues() ([]*iam_organization.Name, bool) { 1357 res, ok := fpaov.values.([]*iam_organization.Name) 1358 return res, ok 1359 } 1360 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsOrganizationDisplayNameArrayOfValues() ([]string, bool) { 1361 res, ok := fpaov.values.([]string) 1362 return res, ok 1363 } 1364 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsPolicyFqnArrayOfValues() ([]*policy.Name, bool) { 1365 res, ok := fpaov.values.([]*policy.Name) 1366 return res, ok 1367 } 1368 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsPolicyDisplayNameArrayOfValues() ([]string, bool) { 1369 res, ok := fpaov.values.([]string) 1370 return res, ok 1371 } 1372 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsNewFiringAlertsArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1373 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1374 return res, ok 1375 } 1376 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsAlertsEscalatedByAiToOperatorArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1377 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1378 return res, ok 1379 } 1380 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsAlertsAwaitingForApprovalWithAiRemediationArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1381 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1382 return res, ok 1383 } 1384 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsAlertsFlaggedToIgnoreByAiArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1385 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1386 return res, ok 1387 } 1388 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsAlertsWithConditionMarkedForAdjustingByAiArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1389 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1390 return res, ok 1391 } 1392 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsAlertsWithAiRemediationAppliedArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1393 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1394 return res, ok 1395 } 1396 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsAlertsWithOperatorRemediationAppliedArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1397 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1398 return res, ok 1399 } 1400 func (fpaov *NotificationMsg_FieldTerminalPathArrayOfValues) AsStoppedAlertsArrayOfValues() ([]*NotificationMsg_AlertsGroup, bool) { 1401 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup) 1402 return res, ok 1403 } 1404 1405 type NotificationMsg_FieldSubPathArrayOfValues struct { 1406 NotificationMsg_FieldPath 1407 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 1408 } 1409 1410 var _ NotificationMsg_FieldPathArrayOfValues = (*NotificationMsg_FieldSubPathArrayOfValues)(nil) 1411 1412 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 1413 return fpsaov.subPathArrayOfValues.GetRawValues() 1414 } 1415 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsNewFiringAlertsPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1416 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1417 return res, ok 1418 } 1419 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsAlertsEscalatedByAiToOperatorPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1420 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1421 return res, ok 1422 } 1423 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsAlertsAwaitingForApprovalWithAiRemediationPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1424 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1425 return res, ok 1426 } 1427 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsAlertsFlaggedToIgnoreByAiPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1428 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1429 return res, ok 1430 } 1431 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsAlertsWithConditionMarkedForAdjustingByAiPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1432 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1433 return res, ok 1434 } 1435 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsAlertsWithAiRemediationAppliedPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1436 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1437 return res, ok 1438 } 1439 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsAlertsWithOperatorRemediationAppliedPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1440 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1441 return res, ok 1442 } 1443 func (fpsaov *NotificationMsg_FieldSubPathArrayOfValues) AsStoppedAlertsPathArrayOfValues() (NotificationMsgAlertsGroup_FieldPathArrayOfValues, bool) { 1444 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroup_FieldPathArrayOfValues) 1445 return res, ok 1446 } 1447 1448 // FieldPath provides implementation to handle 1449 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 1450 type NotificationMsgAlertsGroup_FieldPath interface { 1451 gotenobject.FieldPath 1452 Selector() NotificationMsgAlertsGroup_FieldPathSelector 1453 Get(source *NotificationMsg_AlertsGroup) []interface{} 1454 GetSingle(source *NotificationMsg_AlertsGroup) (interface{}, bool) 1455 ClearValue(item *NotificationMsg_AlertsGroup) 1456 1457 // Those methods build corresponding NotificationMsgAlertsGroup_FieldPathValue 1458 // (or array of values) and holds passed value. Panics if injected type is incorrect. 1459 WithIValue(value interface{}) NotificationMsgAlertsGroup_FieldPathValue 1460 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroup_FieldPathArrayOfValues 1461 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroup_FieldPathArrayItemValue 1462 } 1463 1464 type NotificationMsgAlertsGroup_FieldPathSelector int32 1465 1466 const ( 1467 NotificationMsgAlertsGroup_FieldPathSelectorByCondition NotificationMsgAlertsGroup_FieldPathSelector = 0 1468 ) 1469 1470 func (s NotificationMsgAlertsGroup_FieldPathSelector) String() string { 1471 switch s { 1472 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1473 return "by_condition" 1474 default: 1475 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", s)) 1476 } 1477 } 1478 1479 func BuildNotificationMsgAlertsGroup_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroup_FieldPath, error) { 1480 if len(fp) == 0 { 1481 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup") 1482 } 1483 if len(fp) == 1 { 1484 switch fp[0] { 1485 case "by_condition", "byCondition", "by-condition": 1486 return &NotificationMsgAlertsGroup_FieldTerminalPath{selector: NotificationMsgAlertsGroup_FieldPathSelectorByCondition}, nil 1487 } 1488 } else { 1489 switch fp[0] { 1490 case "by_condition", "byCondition", "by-condition": 1491 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlerts_FieldPath(fp[1:]); err != nil { 1492 return nil, err 1493 } else { 1494 return &NotificationMsgAlertsGroup_FieldSubPath{selector: NotificationMsgAlertsGroup_FieldPathSelectorByCondition, subPath: subpath}, nil 1495 } 1496 } 1497 } 1498 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup", fp) 1499 } 1500 1501 func ParseNotificationMsgAlertsGroup_FieldPath(rawField string) (NotificationMsgAlertsGroup_FieldPath, error) { 1502 fp, err := gotenobject.ParseRawFieldPath(rawField) 1503 if err != nil { 1504 return nil, err 1505 } 1506 return BuildNotificationMsgAlertsGroup_FieldPath(fp) 1507 } 1508 1509 func MustParseNotificationMsgAlertsGroup_FieldPath(rawField string) NotificationMsgAlertsGroup_FieldPath { 1510 fp, err := ParseNotificationMsgAlertsGroup_FieldPath(rawField) 1511 if err != nil { 1512 panic(err) 1513 } 1514 return fp 1515 } 1516 1517 type NotificationMsgAlertsGroup_FieldTerminalPath struct { 1518 selector NotificationMsgAlertsGroup_FieldPathSelector 1519 } 1520 1521 var _ NotificationMsgAlertsGroup_FieldPath = (*NotificationMsgAlertsGroup_FieldTerminalPath)(nil) 1522 1523 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) Selector() NotificationMsgAlertsGroup_FieldPathSelector { 1524 return fp.selector 1525 } 1526 1527 // String returns path representation in proto convention 1528 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) String() string { 1529 return fp.selector.String() 1530 } 1531 1532 // JSONString returns path representation is JSON convention 1533 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) JSONString() string { 1534 return strcase.ToLowerCamel(fp.String()) 1535 } 1536 1537 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup 1538 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup) (values []interface{}) { 1539 if source != nil { 1540 switch fp.selector { 1541 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1542 for _, value := range source.GetByCondition() { 1543 values = append(values, value) 1544 } 1545 default: 1546 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1547 } 1548 } 1549 return 1550 } 1551 1552 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 1553 return fp.Get(source.(*NotificationMsg_AlertsGroup)) 1554 } 1555 1556 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup 1557 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup) (interface{}, bool) { 1558 switch fp.selector { 1559 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1560 res := source.GetByCondition() 1561 return res, res != nil 1562 default: 1563 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1564 } 1565 } 1566 1567 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 1568 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup)) 1569 } 1570 1571 // GetDefault returns a default value of the field type 1572 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) GetDefault() interface{} { 1573 switch fp.selector { 1574 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1575 return ([]*NotificationMsg_AlertsGroup_ConditionAlerts)(nil) 1576 default: 1577 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1578 } 1579 } 1580 1581 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup) { 1582 if item != nil { 1583 switch fp.selector { 1584 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1585 item.ByCondition = nil 1586 default: 1587 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1588 } 1589 } 1590 } 1591 1592 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) ClearValueRaw(item proto.Message) { 1593 fp.ClearValue(item.(*NotificationMsg_AlertsGroup)) 1594 } 1595 1596 // IsLeaf - whether field path is holds simple value 1597 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) IsLeaf() bool { 1598 return false 1599 } 1600 1601 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 1602 return []gotenobject.FieldPath{fp} 1603 } 1604 1605 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroup_FieldPathValue { 1606 switch fp.selector { 1607 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1608 return &NotificationMsgAlertsGroup_FieldTerminalPathValue{NotificationMsgAlertsGroup_FieldTerminalPath: *fp, value: value.([]*NotificationMsg_AlertsGroup_ConditionAlerts)} 1609 default: 1610 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1611 } 1612 } 1613 1614 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 1615 return fp.WithIValue(value) 1616 } 1617 1618 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroup_FieldPathArrayOfValues { 1619 fpaov := &NotificationMsgAlertsGroup_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroup_FieldTerminalPath: *fp} 1620 switch fp.selector { 1621 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1622 return &NotificationMsgAlertsGroup_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroup_FieldTerminalPath: *fp, values: values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts)} 1623 default: 1624 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1625 } 1626 return fpaov 1627 } 1628 1629 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 1630 return fp.WithIArrayOfValues(values) 1631 } 1632 1633 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroup_FieldPathArrayItemValue { 1634 switch fp.selector { 1635 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1636 return &NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue{NotificationMsgAlertsGroup_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts)} 1637 default: 1638 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fp.selector)) 1639 } 1640 } 1641 1642 func (fp *NotificationMsgAlertsGroup_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 1643 return fp.WithIArrayItemValue(value) 1644 } 1645 1646 type NotificationMsgAlertsGroup_FieldSubPath struct { 1647 selector NotificationMsgAlertsGroup_FieldPathSelector 1648 subPath gotenobject.FieldPath 1649 } 1650 1651 var _ NotificationMsgAlertsGroup_FieldPath = (*NotificationMsgAlertsGroup_FieldSubPath)(nil) 1652 1653 func (fps *NotificationMsgAlertsGroup_FieldSubPath) Selector() NotificationMsgAlertsGroup_FieldPathSelector { 1654 return fps.selector 1655 } 1656 func (fps *NotificationMsgAlertsGroup_FieldSubPath) AsByConditionSubPath() (NotificationMsgAlertsGroupConditionAlerts_FieldPath, bool) { 1657 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlerts_FieldPath) 1658 return res, ok 1659 } 1660 1661 // String returns path representation in proto convention 1662 func (fps *NotificationMsgAlertsGroup_FieldSubPath) String() string { 1663 return fps.selector.String() + "." + fps.subPath.String() 1664 } 1665 1666 // JSONString returns path representation is JSON convention 1667 func (fps *NotificationMsgAlertsGroup_FieldSubPath) JSONString() string { 1668 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 1669 } 1670 1671 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup 1672 func (fps *NotificationMsgAlertsGroup_FieldSubPath) Get(source *NotificationMsg_AlertsGroup) (values []interface{}) { 1673 switch fps.selector { 1674 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1675 for _, item := range source.GetByCondition() { 1676 values = append(values, fps.subPath.GetRaw(item)...) 1677 } 1678 default: 1679 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fps.selector)) 1680 } 1681 return 1682 } 1683 1684 func (fps *NotificationMsgAlertsGroup_FieldSubPath) GetRaw(source proto.Message) []interface{} { 1685 return fps.Get(source.(*NotificationMsg_AlertsGroup)) 1686 } 1687 1688 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup 1689 func (fps *NotificationMsgAlertsGroup_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup) (interface{}, bool) { 1690 switch fps.selector { 1691 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1692 if len(source.GetByCondition()) == 0 { 1693 return nil, false 1694 } 1695 return fps.subPath.GetSingleRaw(source.GetByCondition()[0]) 1696 default: 1697 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fps.selector)) 1698 } 1699 } 1700 1701 func (fps *NotificationMsgAlertsGroup_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 1702 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup)) 1703 } 1704 1705 // GetDefault returns a default value of the field type 1706 func (fps *NotificationMsgAlertsGroup_FieldSubPath) GetDefault() interface{} { 1707 return fps.subPath.GetDefault() 1708 } 1709 1710 func (fps *NotificationMsgAlertsGroup_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup) { 1711 if item != nil { 1712 switch fps.selector { 1713 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1714 for _, subItem := range item.ByCondition { 1715 fps.subPath.ClearValueRaw(subItem) 1716 } 1717 default: 1718 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fps.selector)) 1719 } 1720 } 1721 } 1722 1723 func (fps *NotificationMsgAlertsGroup_FieldSubPath) ClearValueRaw(item proto.Message) { 1724 fps.ClearValue(item.(*NotificationMsg_AlertsGroup)) 1725 } 1726 1727 // IsLeaf - whether field path is holds simple value 1728 func (fps *NotificationMsgAlertsGroup_FieldSubPath) IsLeaf() bool { 1729 return fps.subPath.IsLeaf() 1730 } 1731 1732 func (fps *NotificationMsgAlertsGroup_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 1733 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroup_FieldTerminalPath{selector: fps.selector}} 1734 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 1735 return iPaths 1736 } 1737 1738 func (fps *NotificationMsgAlertsGroup_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroup_FieldPathValue { 1739 return &NotificationMsgAlertsGroup_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 1740 } 1741 1742 func (fps *NotificationMsgAlertsGroup_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 1743 return fps.WithIValue(value) 1744 } 1745 1746 func (fps *NotificationMsgAlertsGroup_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroup_FieldPathArrayOfValues { 1747 return &NotificationMsgAlertsGroup_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 1748 } 1749 1750 func (fps *NotificationMsgAlertsGroup_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 1751 return fps.WithIArrayOfValues(values) 1752 } 1753 1754 func (fps *NotificationMsgAlertsGroup_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroup_FieldPathArrayItemValue { 1755 return &NotificationMsgAlertsGroup_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 1756 } 1757 1758 func (fps *NotificationMsgAlertsGroup_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 1759 return fps.WithIArrayItemValue(value) 1760 } 1761 1762 // NotificationMsgAlertsGroup_FieldPathValue allows storing values for AlertsGroup fields according to their type 1763 type NotificationMsgAlertsGroup_FieldPathValue interface { 1764 NotificationMsgAlertsGroup_FieldPath 1765 gotenobject.FieldPathValue 1766 SetTo(target **NotificationMsg_AlertsGroup) 1767 CompareWith(*NotificationMsg_AlertsGroup) (cmp int, comparable bool) 1768 } 1769 1770 func ParseNotificationMsgAlertsGroup_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroup_FieldPathValue, error) { 1771 fp, err := ParseNotificationMsgAlertsGroup_FieldPath(pathStr) 1772 if err != nil { 1773 return nil, err 1774 } 1775 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 1776 if err != nil { 1777 return nil, status.Errorf(codes.InvalidArgument, "error parsing AlertsGroup field path value from %s: %v", valueStr, err) 1778 } 1779 return fpv.(NotificationMsgAlertsGroup_FieldPathValue), nil 1780 } 1781 1782 func MustParseNotificationMsgAlertsGroup_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroup_FieldPathValue { 1783 fpv, err := ParseNotificationMsgAlertsGroup_FieldPathValue(pathStr, valueStr) 1784 if err != nil { 1785 panic(err) 1786 } 1787 return fpv 1788 } 1789 1790 type NotificationMsgAlertsGroup_FieldTerminalPathValue struct { 1791 NotificationMsgAlertsGroup_FieldTerminalPath 1792 value interface{} 1793 } 1794 1795 var _ NotificationMsgAlertsGroup_FieldPathValue = (*NotificationMsgAlertsGroup_FieldTerminalPathValue)(nil) 1796 1797 // GetRawValue returns raw value stored under selected path for 'AlertsGroup' as interface{} 1798 func (fpv *NotificationMsgAlertsGroup_FieldTerminalPathValue) GetRawValue() interface{} { 1799 return fpv.value 1800 } 1801 func (fpv *NotificationMsgAlertsGroup_FieldTerminalPathValue) AsByConditionValue() ([]*NotificationMsg_AlertsGroup_ConditionAlerts, bool) { 1802 res, ok := fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts) 1803 return res, ok 1804 } 1805 1806 // SetTo stores value for selected field for object AlertsGroup 1807 func (fpv *NotificationMsgAlertsGroup_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup) { 1808 if *target == nil { 1809 *target = new(NotificationMsg_AlertsGroup) 1810 } 1811 switch fpv.selector { 1812 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1813 (*target).ByCondition = fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts) 1814 default: 1815 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fpv.selector)) 1816 } 1817 } 1818 1819 func (fpv *NotificationMsgAlertsGroup_FieldTerminalPathValue) SetToRaw(target proto.Message) { 1820 typedObject := target.(*NotificationMsg_AlertsGroup) 1821 fpv.SetTo(&typedObject) 1822 } 1823 1824 // CompareWith compares value in the 'NotificationMsgAlertsGroup_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup'. 1825 func (fpv *NotificationMsgAlertsGroup_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup) (int, bool) { 1826 switch fpv.selector { 1827 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1828 return 0, false 1829 default: 1830 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fpv.selector)) 1831 } 1832 } 1833 1834 func (fpv *NotificationMsgAlertsGroup_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1835 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup)) 1836 } 1837 1838 type NotificationMsgAlertsGroup_FieldSubPathValue struct { 1839 NotificationMsgAlertsGroup_FieldPath 1840 subPathValue gotenobject.FieldPathValue 1841 } 1842 1843 var _ NotificationMsgAlertsGroup_FieldPathValue = (*NotificationMsgAlertsGroup_FieldSubPathValue)(nil) 1844 1845 func (fpvs *NotificationMsgAlertsGroup_FieldSubPathValue) AsByConditionPathValue() (NotificationMsgAlertsGroupConditionAlerts_FieldPathValue, bool) { 1846 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlerts_FieldPathValue) 1847 return res, ok 1848 } 1849 1850 func (fpvs *NotificationMsgAlertsGroup_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup) { 1851 if *target == nil { 1852 *target = new(NotificationMsg_AlertsGroup) 1853 } 1854 switch fpvs.Selector() { 1855 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1856 panic("FieldPath setter is unsupported for array subpaths") 1857 default: 1858 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fpvs.Selector())) 1859 } 1860 } 1861 1862 func (fpvs *NotificationMsgAlertsGroup_FieldSubPathValue) SetToRaw(target proto.Message) { 1863 typedObject := target.(*NotificationMsg_AlertsGroup) 1864 fpvs.SetTo(&typedObject) 1865 } 1866 1867 func (fpvs *NotificationMsgAlertsGroup_FieldSubPathValue) GetRawValue() interface{} { 1868 return fpvs.subPathValue.GetRawValue() 1869 } 1870 1871 func (fpvs *NotificationMsgAlertsGroup_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup) (int, bool) { 1872 switch fpvs.Selector() { 1873 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1874 return 0, false // repeated field 1875 default: 1876 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fpvs.Selector())) 1877 } 1878 } 1879 1880 func (fpvs *NotificationMsgAlertsGroup_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 1881 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup)) 1882 } 1883 1884 // NotificationMsgAlertsGroup_FieldPathArrayItemValue allows storing single item in Path-specific values for AlertsGroup according to their type 1885 // Present only for array (repeated) types. 1886 type NotificationMsgAlertsGroup_FieldPathArrayItemValue interface { 1887 gotenobject.FieldPathArrayItemValue 1888 NotificationMsgAlertsGroup_FieldPath 1889 ContainsValue(*NotificationMsg_AlertsGroup) bool 1890 } 1891 1892 // ParseNotificationMsgAlertsGroup_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 1893 func ParseNotificationMsgAlertsGroup_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroup_FieldPathArrayItemValue, error) { 1894 fp, err := ParseNotificationMsgAlertsGroup_FieldPath(pathStr) 1895 if err != nil { 1896 return nil, err 1897 } 1898 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 1899 if err != nil { 1900 return nil, status.Errorf(codes.InvalidArgument, "error parsing AlertsGroup field path array item value from %s: %v", valueStr, err) 1901 } 1902 return fpaiv.(NotificationMsgAlertsGroup_FieldPathArrayItemValue), nil 1903 } 1904 1905 func MustParseNotificationMsgAlertsGroup_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroup_FieldPathArrayItemValue { 1906 fpaiv, err := ParseNotificationMsgAlertsGroup_FieldPathArrayItemValue(pathStr, valueStr) 1907 if err != nil { 1908 panic(err) 1909 } 1910 return fpaiv 1911 } 1912 1913 type NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue struct { 1914 NotificationMsgAlertsGroup_FieldTerminalPath 1915 value interface{} 1916 } 1917 1918 var _ NotificationMsgAlertsGroup_FieldPathArrayItemValue = (*NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue)(nil) 1919 1920 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup as interface{} 1921 func (fpaiv *NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 1922 return fpaiv.value 1923 } 1924 func (fpaiv *NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue) AsByConditionItemValue() (*NotificationMsg_AlertsGroup_ConditionAlerts, bool) { 1925 res, ok := fpaiv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts) 1926 return res, ok 1927 } 1928 1929 func (fpaiv *NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup) (interface{}, bool) { 1930 return nil, false 1931 } 1932 1933 func (fpaiv *NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 1934 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup)) 1935 } 1936 1937 // Contains returns a boolean indicating if value that is being held is present in given 'AlertsGroup' 1938 func (fpaiv *NotificationMsgAlertsGroup_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup) bool { 1939 slice := fpaiv.NotificationMsgAlertsGroup_FieldTerminalPath.Get(source) 1940 for _, v := range slice { 1941 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 1942 if proto.Equal(asProtoMsg, v.(proto.Message)) { 1943 return true 1944 } 1945 } else if reflect.DeepEqual(v, fpaiv.value) { 1946 return true 1947 } 1948 } 1949 return false 1950 } 1951 1952 type NotificationMsgAlertsGroup_FieldSubPathArrayItemValue struct { 1953 NotificationMsgAlertsGroup_FieldPath 1954 subPathItemValue gotenobject.FieldPathArrayItemValue 1955 } 1956 1957 // GetRawValue returns stored array item value 1958 func (fpaivs *NotificationMsgAlertsGroup_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 1959 return fpaivs.subPathItemValue.GetRawItemValue() 1960 } 1961 func (fpaivs *NotificationMsgAlertsGroup_FieldSubPathArrayItemValue) AsByConditionPathItemValue() (NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue, bool) { 1962 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue) 1963 return res, ok 1964 } 1965 1966 // Contains returns a boolean indicating if value that is being held is present in given 'AlertsGroup' 1967 func (fpaivs *NotificationMsgAlertsGroup_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup) bool { 1968 switch fpaivs.Selector() { 1969 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 1970 return false // repeated/map field 1971 default: 1972 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup: %d", fpaivs.Selector())) 1973 } 1974 } 1975 1976 // NotificationMsgAlertsGroup_FieldPathArrayOfValues allows storing slice of values for AlertsGroup fields according to their type 1977 type NotificationMsgAlertsGroup_FieldPathArrayOfValues interface { 1978 gotenobject.FieldPathArrayOfValues 1979 NotificationMsgAlertsGroup_FieldPath 1980 } 1981 1982 func ParseNotificationMsgAlertsGroup_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroup_FieldPathArrayOfValues, error) { 1983 fp, err := ParseNotificationMsgAlertsGroup_FieldPath(pathStr) 1984 if err != nil { 1985 return nil, err 1986 } 1987 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 1988 if err != nil { 1989 return nil, status.Errorf(codes.InvalidArgument, "error parsing AlertsGroup field path array of values from %s: %v", valuesStr, err) 1990 } 1991 return fpaov.(NotificationMsgAlertsGroup_FieldPathArrayOfValues), nil 1992 } 1993 1994 func MustParseNotificationMsgAlertsGroup_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroup_FieldPathArrayOfValues { 1995 fpaov, err := ParseNotificationMsgAlertsGroup_FieldPathArrayOfValues(pathStr, valuesStr) 1996 if err != nil { 1997 panic(err) 1998 } 1999 return fpaov 2000 } 2001 2002 type NotificationMsgAlertsGroup_FieldTerminalPathArrayOfValues struct { 2003 NotificationMsgAlertsGroup_FieldTerminalPath 2004 values interface{} 2005 } 2006 2007 var _ NotificationMsgAlertsGroup_FieldPathArrayOfValues = (*NotificationMsgAlertsGroup_FieldTerminalPathArrayOfValues)(nil) 2008 2009 func (fpaov *NotificationMsgAlertsGroup_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 2010 switch fpaov.selector { 2011 case NotificationMsgAlertsGroup_FieldPathSelectorByCondition: 2012 for _, v := range fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts) { 2013 values = append(values, v) 2014 } 2015 } 2016 return 2017 } 2018 func (fpaov *NotificationMsgAlertsGroup_FieldTerminalPathArrayOfValues) AsByConditionArrayOfValues() ([][]*NotificationMsg_AlertsGroup_ConditionAlerts, bool) { 2019 res, ok := fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts) 2020 return res, ok 2021 } 2022 2023 type NotificationMsgAlertsGroup_FieldSubPathArrayOfValues struct { 2024 NotificationMsgAlertsGroup_FieldPath 2025 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 2026 } 2027 2028 var _ NotificationMsgAlertsGroup_FieldPathArrayOfValues = (*NotificationMsgAlertsGroup_FieldSubPathArrayOfValues)(nil) 2029 2030 func (fpsaov *NotificationMsgAlertsGroup_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 2031 return fpsaov.subPathArrayOfValues.GetRawValues() 2032 } 2033 func (fpsaov *NotificationMsgAlertsGroup_FieldSubPathArrayOfValues) AsByConditionPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues, bool) { 2034 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues) 2035 return res, ok 2036 } 2037 2038 // FieldPath provides implementation to handle 2039 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 2040 type NotificationMsgAlertsGroupConditionAlerts_FieldPath interface { 2041 gotenobject.FieldPath 2042 Selector() NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector 2043 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts) []interface{} 2044 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts) (interface{}, bool) 2045 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts) 2046 2047 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlerts_FieldPathValue 2048 // (or array of values) and holds passed value. Panics if injected type is incorrect. 2049 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathValue 2050 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues 2051 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue 2052 } 2053 2054 type NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector int32 2055 2056 const ( 2057 NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector = 0 2058 NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector = 1 2059 NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector = 2 2060 NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector = 3 2061 ) 2062 2063 func (s NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector) String() string { 2064 switch s { 2065 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2066 return "time_series_condition" 2067 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2068 return "log_condition" 2069 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2070 return "alerts" 2071 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2072 return "more_alerts_count" 2073 default: 2074 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", s)) 2075 } 2076 } 2077 2078 func BuildNotificationMsgAlertsGroupConditionAlerts_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlerts_FieldPath, error) { 2079 if len(fp) == 0 { 2080 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts") 2081 } 2082 if len(fp) == 1 { 2083 switch fp[0] { 2084 case "time_series_condition", "timeSeriesCondition", "time-series-condition": 2085 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition}, nil 2086 case "log_condition", "logCondition", "log-condition": 2087 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition}, nil 2088 case "alerts": 2089 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts}, nil 2090 case "more_alerts_count", "moreAlertsCount", "more-alerts-count": 2091 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount}, nil 2092 } 2093 } else { 2094 switch fp[0] { 2095 case "time_series_condition", "timeSeriesCondition", "time-series-condition": 2096 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(fp[1:]); err != nil { 2097 return nil, err 2098 } else { 2099 return &NotificationMsgAlertsGroupConditionAlerts_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition, subPath: subpath}, nil 2100 } 2101 case "log_condition", "logCondition", "log-condition": 2102 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(fp[1:]); err != nil { 2103 return nil, err 2104 } else { 2105 return &NotificationMsgAlertsGroupConditionAlerts_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition, subPath: subpath}, nil 2106 } 2107 case "alerts": 2108 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(fp[1:]); err != nil { 2109 return nil, err 2110 } else { 2111 return &NotificationMsgAlertsGroupConditionAlerts_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts, subPath: subpath}, nil 2112 } 2113 } 2114 } 2115 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts", fp) 2116 } 2117 2118 func ParseNotificationMsgAlertsGroupConditionAlerts_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlerts_FieldPath, error) { 2119 fp, err := gotenobject.ParseRawFieldPath(rawField) 2120 if err != nil { 2121 return nil, err 2122 } 2123 return BuildNotificationMsgAlertsGroupConditionAlerts_FieldPath(fp) 2124 } 2125 2126 func MustParseNotificationMsgAlertsGroupConditionAlerts_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlerts_FieldPath { 2127 fp, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPath(rawField) 2128 if err != nil { 2129 panic(err) 2130 } 2131 return fp 2132 } 2133 2134 type NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath struct { 2135 selector NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector 2136 } 2137 2138 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPath = (*NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath)(nil) 2139 2140 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector { 2141 return fp.selector 2142 } 2143 2144 // String returns path representation in proto convention 2145 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) String() string { 2146 return fp.selector.String() 2147 } 2148 2149 // JSONString returns path representation is JSON convention 2150 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) JSONString() string { 2151 return strcase.ToLowerCamel(fp.String()) 2152 } 2153 2154 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts 2155 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts) (values []interface{}) { 2156 if source != nil { 2157 switch fp.selector { 2158 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2159 if source, ok := source.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition); ok && source != nil { 2160 if source.TimeSeriesCondition != nil { 2161 values = append(values, source.TimeSeriesCondition) 2162 } 2163 } 2164 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2165 if source, ok := source.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition); ok && source != nil { 2166 if source.LogCondition != nil { 2167 values = append(values, source.LogCondition) 2168 } 2169 } 2170 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2171 for _, value := range source.GetAlerts() { 2172 values = append(values, value) 2173 } 2174 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2175 values = append(values, source.MoreAlertsCount) 2176 default: 2177 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2178 } 2179 } 2180 return 2181 } 2182 2183 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 2184 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2185 } 2186 2187 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts 2188 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts) (interface{}, bool) { 2189 switch fp.selector { 2190 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2191 // if object nil or oneof not active, return "default" type with false flag. 2192 if source == nil { 2193 return source.GetTimeSeriesCondition(), false 2194 } 2195 _, oneOfSelected := source.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition) 2196 if !oneOfSelected { 2197 return source.GetTimeSeriesCondition(), false // to return "type" information 2198 } 2199 res := source.GetTimeSeriesCondition() 2200 return res, res != nil 2201 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2202 // if object nil or oneof not active, return "default" type with false flag. 2203 if source == nil { 2204 return source.GetLogCondition(), false 2205 } 2206 _, oneOfSelected := source.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition) 2207 if !oneOfSelected { 2208 return source.GetLogCondition(), false // to return "type" information 2209 } 2210 res := source.GetLogCondition() 2211 return res, res != nil 2212 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2213 res := source.GetAlerts() 2214 return res, res != nil 2215 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2216 return source.GetMoreAlertsCount(), source != nil 2217 default: 2218 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2219 } 2220 } 2221 2222 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 2223 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2224 } 2225 2226 // GetDefault returns a default value of the field type 2227 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) GetDefault() interface{} { 2228 switch fp.selector { 2229 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2230 return (*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)(nil) 2231 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2232 return (*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)(nil) 2233 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2234 return ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)(nil) 2235 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2236 return int32(0) 2237 default: 2238 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2239 } 2240 } 2241 2242 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts) { 2243 if item != nil { 2244 switch fp.selector { 2245 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2246 if item, ok := item.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition); ok { 2247 item.TimeSeriesCondition = nil 2248 } 2249 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2250 if item, ok := item.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition); ok { 2251 item.LogCondition = nil 2252 } 2253 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2254 item.Alerts = nil 2255 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2256 item.MoreAlertsCount = int32(0) 2257 default: 2258 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2259 } 2260 } 2261 } 2262 2263 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) ClearValueRaw(item proto.Message) { 2264 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2265 } 2266 2267 // IsLeaf - whether field path is holds simple value 2268 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) IsLeaf() bool { 2269 return fp.selector == NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount 2270 } 2271 2272 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 2273 return []gotenobject.FieldPath{fp} 2274 } 2275 2276 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathValue { 2277 switch fp.selector { 2278 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2279 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)} 2280 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2281 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)} 2282 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2283 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, value: value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)} 2284 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2285 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, value: value.(int32)} 2286 default: 2287 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2288 } 2289 } 2290 2291 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 2292 return fp.WithIValue(value) 2293 } 2294 2295 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues { 2296 fpaov := &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp} 2297 switch fp.selector { 2298 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2299 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)} 2300 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2301 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)} 2302 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2303 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, values: values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)} 2304 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2305 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, values: values.([]int32)} 2306 default: 2307 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2308 } 2309 return fpaov 2310 } 2311 2312 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 2313 return fp.WithIArrayOfValues(values) 2314 } 2315 2316 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue { 2317 switch fp.selector { 2318 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2319 return &NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue{NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)} 2320 default: 2321 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fp.selector)) 2322 } 2323 } 2324 2325 func (fp *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 2326 return fp.WithIArrayItemValue(value) 2327 } 2328 2329 type NotificationMsgAlertsGroupConditionAlerts_FieldSubPath struct { 2330 selector NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector 2331 subPath gotenobject.FieldPath 2332 } 2333 2334 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPath = (*NotificationMsgAlertsGroupConditionAlerts_FieldSubPath)(nil) 2335 2336 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlerts_FieldPathSelector { 2337 return fps.selector 2338 } 2339 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) AsTimeSeriesConditionSubPath() (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath, bool) { 2340 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath) 2341 return res, ok 2342 } 2343 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) AsLogConditionSubPath() (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath, bool) { 2344 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath) 2345 return res, ok 2346 } 2347 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) AsAlertsSubPath() (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath, bool) { 2348 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath) 2349 return res, ok 2350 } 2351 2352 // String returns path representation in proto convention 2353 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) String() string { 2354 return fps.selector.String() + "." + fps.subPath.String() 2355 } 2356 2357 // JSONString returns path representation is JSON convention 2358 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) JSONString() string { 2359 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 2360 } 2361 2362 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts 2363 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts) (values []interface{}) { 2364 switch fps.selector { 2365 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2366 values = append(values, fps.subPath.GetRaw(source.GetTimeSeriesCondition())...) 2367 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2368 values = append(values, fps.subPath.GetRaw(source.GetLogCondition())...) 2369 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2370 for _, item := range source.GetAlerts() { 2371 values = append(values, fps.subPath.GetRaw(item)...) 2372 } 2373 default: 2374 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fps.selector)) 2375 } 2376 return 2377 } 2378 2379 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) GetRaw(source proto.Message) []interface{} { 2380 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2381 } 2382 2383 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts 2384 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts) (interface{}, bool) { 2385 switch fps.selector { 2386 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2387 if source.GetTimeSeriesCondition() == nil { 2388 return nil, false 2389 } 2390 return fps.subPath.GetSingleRaw(source.GetTimeSeriesCondition()) 2391 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2392 if source.GetLogCondition() == nil { 2393 return nil, false 2394 } 2395 return fps.subPath.GetSingleRaw(source.GetLogCondition()) 2396 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2397 if len(source.GetAlerts()) == 0 { 2398 return nil, false 2399 } 2400 return fps.subPath.GetSingleRaw(source.GetAlerts()[0]) 2401 default: 2402 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fps.selector)) 2403 } 2404 } 2405 2406 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 2407 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2408 } 2409 2410 // GetDefault returns a default value of the field type 2411 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) GetDefault() interface{} { 2412 return fps.subPath.GetDefault() 2413 } 2414 2415 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts) { 2416 if item != nil { 2417 switch fps.selector { 2418 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2419 if item.Type != nil { 2420 if item, ok := item.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition); ok { 2421 fps.subPath.ClearValueRaw(item.TimeSeriesCondition) 2422 } 2423 } 2424 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2425 if item.Type != nil { 2426 if item, ok := item.Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition); ok { 2427 fps.subPath.ClearValueRaw(item.LogCondition) 2428 } 2429 } 2430 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2431 for _, subItem := range item.Alerts { 2432 fps.subPath.ClearValueRaw(subItem) 2433 } 2434 default: 2435 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fps.selector)) 2436 } 2437 } 2438 } 2439 2440 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) ClearValueRaw(item proto.Message) { 2441 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2442 } 2443 2444 // IsLeaf - whether field path is holds simple value 2445 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) IsLeaf() bool { 2446 return fps.subPath.IsLeaf() 2447 } 2448 2449 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 2450 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath{selector: fps.selector}} 2451 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 2452 return iPaths 2453 } 2454 2455 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathValue { 2456 return &NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 2457 } 2458 2459 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 2460 return fps.WithIValue(value) 2461 } 2462 2463 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues { 2464 return &NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 2465 } 2466 2467 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 2468 return fps.WithIArrayOfValues(values) 2469 } 2470 2471 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue { 2472 return &NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 2473 } 2474 2475 func (fps *NotificationMsgAlertsGroupConditionAlerts_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 2476 return fps.WithIArrayItemValue(value) 2477 } 2478 2479 // NotificationMsgAlertsGroupConditionAlerts_FieldPathValue allows storing values for ConditionAlerts fields according to their type 2480 type NotificationMsgAlertsGroupConditionAlerts_FieldPathValue interface { 2481 NotificationMsgAlertsGroupConditionAlerts_FieldPath 2482 gotenobject.FieldPathValue 2483 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts) 2484 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts) (cmp int, comparable bool) 2485 } 2486 2487 func ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlerts_FieldPathValue, error) { 2488 fp, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPath(pathStr) 2489 if err != nil { 2490 return nil, err 2491 } 2492 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 2493 if err != nil { 2494 return nil, status.Errorf(codes.InvalidArgument, "error parsing ConditionAlerts field path value from %s: %v", valueStr, err) 2495 } 2496 return fpv.(NotificationMsgAlertsGroupConditionAlerts_FieldPathValue), nil 2497 } 2498 2499 func MustParseNotificationMsgAlertsGroupConditionAlerts_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlerts_FieldPathValue { 2500 fpv, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathValue(pathStr, valueStr) 2501 if err != nil { 2502 panic(err) 2503 } 2504 return fpv 2505 } 2506 2507 type NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue struct { 2508 NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath 2509 value interface{} 2510 } 2511 2512 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue)(nil) 2513 2514 // GetRawValue returns raw value stored under selected path for 'ConditionAlerts' as interface{} 2515 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) GetRawValue() interface{} { 2516 return fpv.value 2517 } 2518 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) AsTimeSeriesConditionValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType, bool) { 2519 res, ok := fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 2520 return res, ok 2521 } 2522 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) AsLogConditionValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType, bool) { 2523 res, ok := fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 2524 return res, ok 2525 } 2526 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) AsAlertsValue() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert, bool) { 2527 res, ok := fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 2528 return res, ok 2529 } 2530 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) AsMoreAlertsCountValue() (int32, bool) { 2531 res, ok := fpv.value.(int32) 2532 return res, ok 2533 } 2534 2535 // SetTo stores value for selected field for object ConditionAlerts 2536 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts) { 2537 if *target == nil { 2538 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts) 2539 } 2540 switch fpv.selector { 2541 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2542 if _, ok := (*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition); !ok { 2543 (*target).Type = &NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition{} 2544 } 2545 (*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition).TimeSeriesCondition = fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 2546 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2547 if _, ok := (*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition); !ok { 2548 (*target).Type = &NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition{} 2549 } 2550 (*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition).LogCondition = fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 2551 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2552 (*target).Alerts = fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 2553 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2554 (*target).MoreAlertsCount = fpv.value.(int32) 2555 default: 2556 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fpv.selector)) 2557 } 2558 } 2559 2560 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) SetToRaw(target proto.Message) { 2561 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts) 2562 fpv.SetTo(&typedObject) 2563 } 2564 2565 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts'. 2566 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts) (int, bool) { 2567 switch fpv.selector { 2568 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2569 return 0, false 2570 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2571 return 0, false 2572 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2573 return 0, false 2574 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2575 leftValue := fpv.value.(int32) 2576 rightValue := source.GetMoreAlertsCount() 2577 if (leftValue) == (rightValue) { 2578 return 0, true 2579 } else if (leftValue) < (rightValue) { 2580 return -1, true 2581 } else { 2582 return 1, true 2583 } 2584 default: 2585 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fpv.selector)) 2586 } 2587 } 2588 2589 func (fpv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 2590 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2591 } 2592 2593 type NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue struct { 2594 NotificationMsgAlertsGroupConditionAlerts_FieldPath 2595 subPathValue gotenobject.FieldPathValue 2596 } 2597 2598 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue)(nil) 2599 2600 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) AsTimeSeriesConditionPathValue() (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue, bool) { 2601 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue) 2602 return res, ok 2603 } 2604 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) AsLogConditionPathValue() (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue, bool) { 2605 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue) 2606 return res, ok 2607 } 2608 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) AsAlertsPathValue() (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue, bool) { 2609 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue) 2610 return res, ok 2611 } 2612 2613 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts) { 2614 if *target == nil { 2615 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts) 2616 } 2617 switch fpvs.Selector() { 2618 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2619 if _, ok := (*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition); !ok { 2620 (*target).Type = &NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition{} 2621 } 2622 fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue).SetTo(&(*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_TimeSeriesCondition).TimeSeriesCondition) 2623 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2624 if _, ok := (*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition); !ok { 2625 (*target).Type = &NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition{} 2626 } 2627 fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue).SetTo(&(*target).Type.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCondition).LogCondition) 2628 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2629 panic("FieldPath setter is unsupported for array subpaths") 2630 default: 2631 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fpvs.Selector())) 2632 } 2633 } 2634 2635 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) SetToRaw(target proto.Message) { 2636 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts) 2637 fpvs.SetTo(&typedObject) 2638 } 2639 2640 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) GetRawValue() interface{} { 2641 return fpvs.subPathValue.GetRawValue() 2642 } 2643 2644 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts) (int, bool) { 2645 switch fpvs.Selector() { 2646 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2647 return fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue).CompareWith(source.GetTimeSeriesCondition()) 2648 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2649 return fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue).CompareWith(source.GetLogCondition()) 2650 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2651 return 0, false // repeated field 2652 default: 2653 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fpvs.Selector())) 2654 } 2655 } 2656 2657 func (fpvs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 2658 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2659 } 2660 2661 // NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue allows storing single item in Path-specific values for ConditionAlerts according to their type 2662 // Present only for array (repeated) types. 2663 type NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue interface { 2664 gotenobject.FieldPathArrayItemValue 2665 NotificationMsgAlertsGroupConditionAlerts_FieldPath 2666 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts) bool 2667 } 2668 2669 // ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 2670 func ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue, error) { 2671 fp, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPath(pathStr) 2672 if err != nil { 2673 return nil, err 2674 } 2675 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 2676 if err != nil { 2677 return nil, status.Errorf(codes.InvalidArgument, "error parsing ConditionAlerts field path array item value from %s: %v", valueStr, err) 2678 } 2679 return fpaiv.(NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue), nil 2680 } 2681 2682 func MustParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue { 2683 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue(pathStr, valueStr) 2684 if err != nil { 2685 panic(err) 2686 } 2687 return fpaiv 2688 } 2689 2690 type NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue struct { 2691 NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath 2692 value interface{} 2693 } 2694 2695 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue)(nil) 2696 2697 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts as interface{} 2698 func (fpaiv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 2699 return fpaiv.value 2700 } 2701 func (fpaiv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue) AsAlertsItemValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert, bool) { 2702 res, ok := fpaiv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 2703 return res, ok 2704 } 2705 2706 func (fpaiv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts) (interface{}, bool) { 2707 return nil, false 2708 } 2709 2710 func (fpaiv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 2711 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts)) 2712 } 2713 2714 // Contains returns a boolean indicating if value that is being held is present in given 'ConditionAlerts' 2715 func (fpaiv *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts) bool { 2716 slice := fpaiv.NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath.Get(source) 2717 for _, v := range slice { 2718 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 2719 if proto.Equal(asProtoMsg, v.(proto.Message)) { 2720 return true 2721 } 2722 } else if reflect.DeepEqual(v, fpaiv.value) { 2723 return true 2724 } 2725 } 2726 return false 2727 } 2728 2729 type NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue struct { 2730 NotificationMsgAlertsGroupConditionAlerts_FieldPath 2731 subPathItemValue gotenobject.FieldPathArrayItemValue 2732 } 2733 2734 // GetRawValue returns stored array item value 2735 func (fpaivs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 2736 return fpaivs.subPathItemValue.GetRawItemValue() 2737 } 2738 func (fpaivs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue) AsTimeSeriesConditionPathItemValue() (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue, bool) { 2739 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue) 2740 return res, ok 2741 } 2742 func (fpaivs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue) AsLogConditionPathItemValue() (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue, bool) { 2743 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue) 2744 return res, ok 2745 } 2746 func (fpaivs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue) AsAlertsPathItemValue() (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue, bool) { 2747 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue) 2748 return res, ok 2749 } 2750 2751 // Contains returns a boolean indicating if value that is being held is present in given 'ConditionAlerts' 2752 func (fpaivs *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts) bool { 2753 switch fpaivs.Selector() { 2754 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2755 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue).ContainsValue(source.GetTimeSeriesCondition()) 2756 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2757 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue).ContainsValue(source.GetLogCondition()) 2758 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2759 return false // repeated/map field 2760 default: 2761 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts: %d", fpaivs.Selector())) 2762 } 2763 } 2764 2765 // NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues allows storing slice of values for ConditionAlerts fields according to their type 2766 type NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues interface { 2767 gotenobject.FieldPathArrayOfValues 2768 NotificationMsgAlertsGroupConditionAlerts_FieldPath 2769 } 2770 2771 func ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues, error) { 2772 fp, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPath(pathStr) 2773 if err != nil { 2774 return nil, err 2775 } 2776 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 2777 if err != nil { 2778 return nil, status.Errorf(codes.InvalidArgument, "error parsing ConditionAlerts field path array of values from %s: %v", valuesStr, err) 2779 } 2780 return fpaov.(NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues), nil 2781 } 2782 2783 func MustParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues { 2784 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues(pathStr, valuesStr) 2785 if err != nil { 2786 panic(err) 2787 } 2788 return fpaov 2789 } 2790 2791 type NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues struct { 2792 NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPath 2793 values interface{} 2794 } 2795 2796 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues)(nil) 2797 2798 func (fpaov *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 2799 switch fpaov.selector { 2800 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorTimeSeriesCondition: 2801 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) { 2802 values = append(values, v) 2803 } 2804 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorLogCondition: 2805 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) { 2806 values = append(values, v) 2807 } 2808 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorAlerts: 2809 for _, v := range fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) { 2810 values = append(values, v) 2811 } 2812 case NotificationMsgAlertsGroupConditionAlerts_FieldPathSelectorMoreAlertsCount: 2813 for _, v := range fpaov.values.([]int32) { 2814 values = append(values, v) 2815 } 2816 } 2817 return 2818 } 2819 func (fpaov *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues) AsTimeSeriesConditionArrayOfValues() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType, bool) { 2820 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 2821 return res, ok 2822 } 2823 func (fpaov *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues) AsLogConditionArrayOfValues() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType, bool) { 2824 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 2825 return res, ok 2826 } 2827 func (fpaov *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues) AsAlertsArrayOfValues() ([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert, bool) { 2828 res, ok := fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 2829 return res, ok 2830 } 2831 func (fpaov *NotificationMsgAlertsGroupConditionAlerts_FieldTerminalPathArrayOfValues) AsMoreAlertsCountArrayOfValues() ([]int32, bool) { 2832 res, ok := fpaov.values.([]int32) 2833 return res, ok 2834 } 2835 2836 type NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues struct { 2837 NotificationMsgAlertsGroupConditionAlerts_FieldPath 2838 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 2839 } 2840 2841 var _ NotificationMsgAlertsGroupConditionAlerts_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues)(nil) 2842 2843 func (fpsaov *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 2844 return fpsaov.subPathArrayOfValues.GetRawValues() 2845 } 2846 func (fpsaov *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues) AsTimeSeriesConditionPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues, bool) { 2847 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues) 2848 return res, ok 2849 } 2850 func (fpsaov *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues) AsLogConditionPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues, bool) { 2851 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues) 2852 return res, ok 2853 } 2854 func (fpsaov *NotificationMsgAlertsGroupConditionAlerts_FieldSubPathArrayOfValues) AsAlertsPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues, bool) { 2855 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues) 2856 return res, ok 2857 } 2858 2859 // FieldPath provides implementation to handle 2860 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 2861 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath interface { 2862 gotenobject.FieldPath 2863 Selector() NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector 2864 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) []interface{} 2865 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (interface{}, bool) 2866 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 2867 2868 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue 2869 // (or array of values) and holds passed value. Panics if injected type is incorrect. 2870 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue 2871 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues 2872 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue 2873 } 2874 2875 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector int32 2876 2877 const ( 2878 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector = 0 2879 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector = 1 2880 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector = 2 2881 ) 2882 2883 func (s NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector) String() string { 2884 switch s { 2885 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 2886 return "fqn" 2887 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 2888 return "display_name" 2889 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 2890 return "queries" 2891 default: 2892 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", s)) 2893 } 2894 } 2895 2896 func BuildNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath, error) { 2897 if len(fp) == 0 { 2898 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType") 2899 } 2900 if len(fp) == 1 { 2901 switch fp[0] { 2902 case "fqn": 2903 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn}, nil 2904 case "display_name", "displayName", "display-name": 2905 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName}, nil 2906 case "queries": 2907 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries}, nil 2908 } 2909 } else { 2910 switch fp[0] { 2911 case "queries": 2912 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(fp[1:]); err != nil { 2913 return nil, err 2914 } else { 2915 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries, subPath: subpath}, nil 2916 } 2917 } 2918 } 2919 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType", fp) 2920 } 2921 2922 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath, error) { 2923 fp, err := gotenobject.ParseRawFieldPath(rawField) 2924 if err != nil { 2925 return nil, err 2926 } 2927 return BuildNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(fp) 2928 } 2929 2930 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath { 2931 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(rawField) 2932 if err != nil { 2933 panic(err) 2934 } 2935 return fp 2936 } 2937 2938 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath struct { 2939 selector NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector 2940 } 2941 2942 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath)(nil) 2943 2944 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector { 2945 return fp.selector 2946 } 2947 2948 // String returns path representation in proto convention 2949 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) String() string { 2950 return fp.selector.String() 2951 } 2952 2953 // JSONString returns path representation is JSON convention 2954 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) JSONString() string { 2955 return strcase.ToLowerCamel(fp.String()) 2956 } 2957 2958 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType 2959 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (values []interface{}) { 2960 if source != nil { 2961 switch fp.selector { 2962 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 2963 if source.Fqn != nil { 2964 values = append(values, source.Fqn) 2965 } 2966 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 2967 values = append(values, source.DisplayName) 2968 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 2969 for _, value := range source.GetQueries() { 2970 values = append(values, value) 2971 } 2972 default: 2973 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 2974 } 2975 } 2976 return 2977 } 2978 2979 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 2980 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 2981 } 2982 2983 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType 2984 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (interface{}, bool) { 2985 switch fp.selector { 2986 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 2987 res := source.GetFqn() 2988 return res, res != nil 2989 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 2990 return source.GetDisplayName(), source != nil 2991 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 2992 res := source.GetQueries() 2993 return res, res != nil 2994 default: 2995 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 2996 } 2997 } 2998 2999 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3000 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3001 } 3002 3003 // GetDefault returns a default value of the field type 3004 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) GetDefault() interface{} { 3005 switch fp.selector { 3006 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3007 return (*ts_condition.Name)(nil) 3008 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3009 return "" 3010 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3011 return ([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)(nil) 3012 default: 3013 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 3014 } 3015 } 3016 3017 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) { 3018 if item != nil { 3019 switch fp.selector { 3020 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3021 item.Fqn = nil 3022 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3023 item.DisplayName = "" 3024 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3025 item.Queries = nil 3026 default: 3027 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 3028 } 3029 } 3030 } 3031 3032 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) ClearValueRaw(item proto.Message) { 3033 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3034 } 3035 3036 // IsLeaf - whether field path is holds simple value 3037 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) IsLeaf() bool { 3038 return fp.selector == NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn || 3039 fp.selector == NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName 3040 } 3041 3042 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3043 return []gotenobject.FieldPath{fp} 3044 } 3045 3046 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue { 3047 switch fp.selector { 3048 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3049 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, value: value.(*ts_condition.Name)} 3050 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3051 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, value: value.(string)} 3052 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3053 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, value: value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)} 3054 default: 3055 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 3056 } 3057 } 3058 3059 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3060 return fp.WithIValue(value) 3061 } 3062 3063 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues { 3064 fpaov := &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp} 3065 switch fp.selector { 3066 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3067 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, values: values.([]*ts_condition.Name)} 3068 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3069 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, values: values.([]string)} 3070 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3071 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, values: values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)} 3072 default: 3073 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 3074 } 3075 return fpaov 3076 } 3077 3078 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3079 return fp.WithIArrayOfValues(values) 3080 } 3081 3082 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue { 3083 switch fp.selector { 3084 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3085 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue{NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)} 3086 default: 3087 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fp.selector)) 3088 } 3089 } 3090 3091 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3092 return fp.WithIArrayItemValue(value) 3093 } 3094 3095 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath struct { 3096 selector NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector 3097 subPath gotenobject.FieldPath 3098 } 3099 3100 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath)(nil) 3101 3102 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelector { 3103 return fps.selector 3104 } 3105 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) AsQueriesSubPath() (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath, bool) { 3106 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath) 3107 return res, ok 3108 } 3109 3110 // String returns path representation in proto convention 3111 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) String() string { 3112 return fps.selector.String() + "." + fps.subPath.String() 3113 } 3114 3115 // JSONString returns path representation is JSON convention 3116 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) JSONString() string { 3117 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 3118 } 3119 3120 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType 3121 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (values []interface{}) { 3122 switch fps.selector { 3123 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3124 for _, item := range source.GetQueries() { 3125 values = append(values, fps.subPath.GetRaw(item)...) 3126 } 3127 default: 3128 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fps.selector)) 3129 } 3130 return 3131 } 3132 3133 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) GetRaw(source proto.Message) []interface{} { 3134 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3135 } 3136 3137 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType 3138 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (interface{}, bool) { 3139 switch fps.selector { 3140 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3141 if len(source.GetQueries()) == 0 { 3142 return nil, false 3143 } 3144 return fps.subPath.GetSingleRaw(source.GetQueries()[0]) 3145 default: 3146 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fps.selector)) 3147 } 3148 } 3149 3150 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3151 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3152 } 3153 3154 // GetDefault returns a default value of the field type 3155 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) GetDefault() interface{} { 3156 return fps.subPath.GetDefault() 3157 } 3158 3159 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) { 3160 if item != nil { 3161 switch fps.selector { 3162 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3163 for _, subItem := range item.Queries { 3164 fps.subPath.ClearValueRaw(subItem) 3165 } 3166 default: 3167 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fps.selector)) 3168 } 3169 } 3170 } 3171 3172 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) ClearValueRaw(item proto.Message) { 3173 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3174 } 3175 3176 // IsLeaf - whether field path is holds simple value 3177 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) IsLeaf() bool { 3178 return fps.subPath.IsLeaf() 3179 } 3180 3181 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3182 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath{selector: fps.selector}} 3183 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 3184 return iPaths 3185 } 3186 3187 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue { 3188 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 3189 } 3190 3191 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3192 return fps.WithIValue(value) 3193 } 3194 3195 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues { 3196 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 3197 } 3198 3199 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3200 return fps.WithIArrayOfValues(values) 3201 } 3202 3203 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue { 3204 return &NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 3205 } 3206 3207 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3208 return fps.WithIArrayItemValue(value) 3209 } 3210 3211 // NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue allows storing values for TsCndType fields according to their type 3212 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue interface { 3213 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath 3214 gotenobject.FieldPathValue 3215 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 3216 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (cmp int, comparable bool) 3217 } 3218 3219 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue, error) { 3220 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(pathStr) 3221 if err != nil { 3222 return nil, err 3223 } 3224 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 3225 if err != nil { 3226 return nil, status.Errorf(codes.InvalidArgument, "error parsing TsCndType field path value from %s: %v", valueStr, err) 3227 } 3228 return fpv.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue), nil 3229 } 3230 3231 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue { 3232 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue(pathStr, valueStr) 3233 if err != nil { 3234 panic(err) 3235 } 3236 return fpv 3237 } 3238 3239 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue struct { 3240 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath 3241 value interface{} 3242 } 3243 3244 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue)(nil) 3245 3246 // GetRawValue returns raw value stored under selected path for 'TsCndType' as interface{} 3247 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) GetRawValue() interface{} { 3248 return fpv.value 3249 } 3250 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) AsFqnValue() (*ts_condition.Name, bool) { 3251 res, ok := fpv.value.(*ts_condition.Name) 3252 return res, ok 3253 } 3254 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) AsDisplayNameValue() (string, bool) { 3255 res, ok := fpv.value.(string) 3256 return res, ok 3257 } 3258 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) AsQueriesValue() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query, bool) { 3259 res, ok := fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 3260 return res, ok 3261 } 3262 3263 // SetTo stores value for selected field for object TsCndType 3264 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) { 3265 if *target == nil { 3266 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 3267 } 3268 switch fpv.selector { 3269 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3270 (*target).Fqn = fpv.value.(*ts_condition.Name) 3271 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3272 (*target).DisplayName = fpv.value.(string) 3273 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3274 (*target).Queries = fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 3275 default: 3276 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fpv.selector)) 3277 } 3278 } 3279 3280 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) SetToRaw(target proto.Message) { 3281 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 3282 fpv.SetTo(&typedObject) 3283 } 3284 3285 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType'. 3286 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (int, bool) { 3287 switch fpv.selector { 3288 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3289 leftValue := fpv.value.(*ts_condition.Name) 3290 rightValue := source.GetFqn() 3291 if leftValue == nil { 3292 if rightValue != nil { 3293 return -1, true 3294 } 3295 return 0, true 3296 } 3297 if rightValue == nil { 3298 return 1, true 3299 } 3300 if leftValue.String() == rightValue.String() { 3301 return 0, true 3302 } else if leftValue.String() < rightValue.String() { 3303 return -1, true 3304 } else { 3305 return 1, true 3306 } 3307 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3308 leftValue := fpv.value.(string) 3309 rightValue := source.GetDisplayName() 3310 if (leftValue) == (rightValue) { 3311 return 0, true 3312 } else if (leftValue) < (rightValue) { 3313 return -1, true 3314 } else { 3315 return 1, true 3316 } 3317 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3318 return 0, false 3319 default: 3320 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fpv.selector)) 3321 } 3322 } 3323 3324 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3325 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3326 } 3327 3328 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue struct { 3329 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath 3330 subPathValue gotenobject.FieldPathValue 3331 } 3332 3333 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue)(nil) 3334 3335 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue) AsQueriesPathValue() (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue, bool) { 3336 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue) 3337 return res, ok 3338 } 3339 3340 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) { 3341 if *target == nil { 3342 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 3343 } 3344 switch fpvs.Selector() { 3345 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3346 panic("FieldPath setter is unsupported for array subpaths") 3347 default: 3348 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fpvs.Selector())) 3349 } 3350 } 3351 3352 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue) SetToRaw(target proto.Message) { 3353 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) 3354 fpvs.SetTo(&typedObject) 3355 } 3356 3357 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue) GetRawValue() interface{} { 3358 return fpvs.subPathValue.GetRawValue() 3359 } 3360 3361 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (int, bool) { 3362 switch fpvs.Selector() { 3363 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3364 return 0, false // repeated field 3365 default: 3366 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fpvs.Selector())) 3367 } 3368 } 3369 3370 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 3371 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3372 } 3373 3374 // NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue allows storing single item in Path-specific values for TsCndType according to their type 3375 // Present only for array (repeated) types. 3376 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue interface { 3377 gotenobject.FieldPathArrayItemValue 3378 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath 3379 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) bool 3380 } 3381 3382 // ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 3383 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue, error) { 3384 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(pathStr) 3385 if err != nil { 3386 return nil, err 3387 } 3388 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 3389 if err != nil { 3390 return nil, status.Errorf(codes.InvalidArgument, "error parsing TsCndType field path array item value from %s: %v", valueStr, err) 3391 } 3392 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue), nil 3393 } 3394 3395 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue { 3396 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue(pathStr, valueStr) 3397 if err != nil { 3398 panic(err) 3399 } 3400 return fpaiv 3401 } 3402 3403 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue struct { 3404 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath 3405 value interface{} 3406 } 3407 3408 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue)(nil) 3409 3410 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType as interface{} 3411 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 3412 return fpaiv.value 3413 } 3414 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue) AsQueriesItemValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query, bool) { 3415 res, ok := fpaiv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 3416 return res, ok 3417 } 3418 3419 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) (interface{}, bool) { 3420 return nil, false 3421 } 3422 3423 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 3424 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType)) 3425 } 3426 3427 // Contains returns a boolean indicating if value that is being held is present in given 'TsCndType' 3428 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) bool { 3429 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath.Get(source) 3430 for _, v := range slice { 3431 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 3432 if proto.Equal(asProtoMsg, v.(proto.Message)) { 3433 return true 3434 } 3435 } else if reflect.DeepEqual(v, fpaiv.value) { 3436 return true 3437 } 3438 } 3439 return false 3440 } 3441 3442 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayItemValue struct { 3443 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath 3444 subPathItemValue gotenobject.FieldPathArrayItemValue 3445 } 3446 3447 // GetRawValue returns stored array item value 3448 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 3449 return fpaivs.subPathItemValue.GetRawItemValue() 3450 } 3451 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayItemValue) AsQueriesPathItemValue() (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue, bool) { 3452 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue) 3453 return res, ok 3454 } 3455 3456 // Contains returns a boolean indicating if value that is being held is present in given 'TsCndType' 3457 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType) bool { 3458 switch fpaivs.Selector() { 3459 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3460 return false // repeated/map field 3461 default: 3462 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType: %d", fpaivs.Selector())) 3463 } 3464 } 3465 3466 // NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues allows storing slice of values for TsCndType fields according to their type 3467 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues interface { 3468 gotenobject.FieldPathArrayOfValues 3469 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath 3470 } 3471 3472 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues, error) { 3473 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath(pathStr) 3474 if err != nil { 3475 return nil, err 3476 } 3477 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 3478 if err != nil { 3479 return nil, status.Errorf(codes.InvalidArgument, "error parsing TsCndType field path array of values from %s: %v", valuesStr, err) 3480 } 3481 return fpaov.(NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues), nil 3482 } 3483 3484 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues { 3485 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues(pathStr, valuesStr) 3486 if err != nil { 3487 panic(err) 3488 } 3489 return fpaov 3490 } 3491 3492 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues struct { 3493 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPath 3494 values interface{} 3495 } 3496 3497 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues)(nil) 3498 3499 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 3500 switch fpaov.selector { 3501 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorFqn: 3502 for _, v := range fpaov.values.([]*ts_condition.Name) { 3503 values = append(values, v) 3504 } 3505 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorDisplayName: 3506 for _, v := range fpaov.values.([]string) { 3507 values = append(values, v) 3508 } 3509 case NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathSelectorQueries: 3510 for _, v := range fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) { 3511 values = append(values, v) 3512 } 3513 } 3514 return 3515 } 3516 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues) AsFqnArrayOfValues() ([]*ts_condition.Name, bool) { 3517 res, ok := fpaov.values.([]*ts_condition.Name) 3518 return res, ok 3519 } 3520 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues) AsDisplayNameArrayOfValues() ([]string, bool) { 3521 res, ok := fpaov.values.([]string) 3522 return res, ok 3523 } 3524 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldTerminalPathArrayOfValues) AsQueriesArrayOfValues() ([][]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query, bool) { 3525 res, ok := fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 3526 return res, ok 3527 } 3528 3529 type NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayOfValues struct { 3530 NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPath 3531 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 3532 } 3533 3534 var _ NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayOfValues)(nil) 3535 3536 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 3537 return fpsaov.subPathArrayOfValues.GetRawValues() 3538 } 3539 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsTsCndType_FieldSubPathArrayOfValues) AsQueriesPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues, bool) { 3540 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues) 3541 return res, ok 3542 } 3543 3544 // FieldPath provides implementation to handle 3545 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 3546 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath interface { 3547 gotenobject.FieldPath 3548 Selector() NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector 3549 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) []interface{} 3550 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (interface{}, bool) 3551 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 3552 3553 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue 3554 // (or array of values) and holds passed value. Panics if injected type is incorrect. 3555 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue 3556 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues 3557 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue 3558 } 3559 3560 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector int32 3561 3562 const ( 3563 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector = 0 3564 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector = 1 3565 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector = 2 3566 ) 3567 3568 func (s NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector) String() string { 3569 switch s { 3570 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3571 return "fqn" 3572 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3573 return "display_name" 3574 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3575 return "queries" 3576 default: 3577 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", s)) 3578 } 3579 } 3580 3581 func BuildNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath, error) { 3582 if len(fp) == 0 { 3583 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType") 3584 } 3585 if len(fp) == 1 { 3586 switch fp[0] { 3587 case "fqn": 3588 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn}, nil 3589 case "display_name", "displayName", "display-name": 3590 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName}, nil 3591 case "queries": 3592 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries}, nil 3593 } 3594 } else { 3595 switch fp[0] { 3596 case "queries": 3597 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(fp[1:]); err != nil { 3598 return nil, err 3599 } else { 3600 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries, subPath: subpath}, nil 3601 } 3602 } 3603 } 3604 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType", fp) 3605 } 3606 3607 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath, error) { 3608 fp, err := gotenobject.ParseRawFieldPath(rawField) 3609 if err != nil { 3610 return nil, err 3611 } 3612 return BuildNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(fp) 3613 } 3614 3615 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath { 3616 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(rawField) 3617 if err != nil { 3618 panic(err) 3619 } 3620 return fp 3621 } 3622 3623 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath struct { 3624 selector NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector 3625 } 3626 3627 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath)(nil) 3628 3629 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector { 3630 return fp.selector 3631 } 3632 3633 // String returns path representation in proto convention 3634 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) String() string { 3635 return fp.selector.String() 3636 } 3637 3638 // JSONString returns path representation is JSON convention 3639 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) JSONString() string { 3640 return strcase.ToLowerCamel(fp.String()) 3641 } 3642 3643 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType 3644 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (values []interface{}) { 3645 if source != nil { 3646 switch fp.selector { 3647 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3648 if source.Fqn != nil { 3649 values = append(values, source.Fqn) 3650 } 3651 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3652 values = append(values, source.DisplayName) 3653 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3654 for _, value := range source.GetQueries() { 3655 values = append(values, value) 3656 } 3657 default: 3658 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3659 } 3660 } 3661 return 3662 } 3663 3664 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 3665 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 3666 } 3667 3668 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType 3669 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (interface{}, bool) { 3670 switch fp.selector { 3671 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3672 res := source.GetFqn() 3673 return res, res != nil 3674 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3675 return source.GetDisplayName(), source != nil 3676 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3677 res := source.GetQueries() 3678 return res, res != nil 3679 default: 3680 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3681 } 3682 } 3683 3684 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3685 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 3686 } 3687 3688 // GetDefault returns a default value of the field type 3689 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) GetDefault() interface{} { 3690 switch fp.selector { 3691 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3692 return (*log_condition.Name)(nil) 3693 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3694 return "" 3695 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3696 return ([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)(nil) 3697 default: 3698 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3699 } 3700 } 3701 3702 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) { 3703 if item != nil { 3704 switch fp.selector { 3705 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3706 item.Fqn = nil 3707 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3708 item.DisplayName = "" 3709 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3710 item.Queries = nil 3711 default: 3712 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3713 } 3714 } 3715 } 3716 3717 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) ClearValueRaw(item proto.Message) { 3718 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 3719 } 3720 3721 // IsLeaf - whether field path is holds simple value 3722 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) IsLeaf() bool { 3723 return fp.selector == NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn || 3724 fp.selector == NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName 3725 } 3726 3727 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3728 return []gotenobject.FieldPath{fp} 3729 } 3730 3731 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue { 3732 switch fp.selector { 3733 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3734 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, value: value.(*log_condition.Name)} 3735 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3736 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, value: value.(string)} 3737 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3738 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, value: value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)} 3739 default: 3740 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3741 } 3742 } 3743 3744 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3745 return fp.WithIValue(value) 3746 } 3747 3748 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues { 3749 fpaov := &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp} 3750 switch fp.selector { 3751 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3752 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, values: values.([]*log_condition.Name)} 3753 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3754 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, values: values.([]string)} 3755 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3756 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, values: values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)} 3757 default: 3758 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3759 } 3760 return fpaov 3761 } 3762 3763 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3764 return fp.WithIArrayOfValues(values) 3765 } 3766 3767 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue { 3768 switch fp.selector { 3769 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3770 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue{NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)} 3771 default: 3772 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fp.selector)) 3773 } 3774 } 3775 3776 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3777 return fp.WithIArrayItemValue(value) 3778 } 3779 3780 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath struct { 3781 selector NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector 3782 subPath gotenobject.FieldPath 3783 } 3784 3785 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath)(nil) 3786 3787 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelector { 3788 return fps.selector 3789 } 3790 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) AsQueriesSubPath() (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath, bool) { 3791 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath) 3792 return res, ok 3793 } 3794 3795 // String returns path representation in proto convention 3796 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) String() string { 3797 return fps.selector.String() + "." + fps.subPath.String() 3798 } 3799 3800 // JSONString returns path representation is JSON convention 3801 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) JSONString() string { 3802 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 3803 } 3804 3805 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType 3806 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (values []interface{}) { 3807 switch fps.selector { 3808 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3809 for _, item := range source.GetQueries() { 3810 values = append(values, fps.subPath.GetRaw(item)...) 3811 } 3812 default: 3813 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fps.selector)) 3814 } 3815 return 3816 } 3817 3818 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) GetRaw(source proto.Message) []interface{} { 3819 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 3820 } 3821 3822 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType 3823 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (interface{}, bool) { 3824 switch fps.selector { 3825 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3826 if len(source.GetQueries()) == 0 { 3827 return nil, false 3828 } 3829 return fps.subPath.GetSingleRaw(source.GetQueries()[0]) 3830 default: 3831 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fps.selector)) 3832 } 3833 } 3834 3835 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 3836 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 3837 } 3838 3839 // GetDefault returns a default value of the field type 3840 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) GetDefault() interface{} { 3841 return fps.subPath.GetDefault() 3842 } 3843 3844 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) { 3845 if item != nil { 3846 switch fps.selector { 3847 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3848 for _, subItem := range item.Queries { 3849 fps.subPath.ClearValueRaw(subItem) 3850 } 3851 default: 3852 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fps.selector)) 3853 } 3854 } 3855 } 3856 3857 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) ClearValueRaw(item proto.Message) { 3858 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 3859 } 3860 3861 // IsLeaf - whether field path is holds simple value 3862 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) IsLeaf() bool { 3863 return fps.subPath.IsLeaf() 3864 } 3865 3866 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 3867 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath{selector: fps.selector}} 3868 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 3869 return iPaths 3870 } 3871 3872 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue { 3873 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 3874 } 3875 3876 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 3877 return fps.WithIValue(value) 3878 } 3879 3880 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues { 3881 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 3882 } 3883 3884 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 3885 return fps.WithIArrayOfValues(values) 3886 } 3887 3888 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue { 3889 return &NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 3890 } 3891 3892 func (fps *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 3893 return fps.WithIArrayItemValue(value) 3894 } 3895 3896 // NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue allows storing values for LogCndType fields according to their type 3897 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue interface { 3898 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath 3899 gotenobject.FieldPathValue 3900 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 3901 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (cmp int, comparable bool) 3902 } 3903 3904 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue, error) { 3905 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(pathStr) 3906 if err != nil { 3907 return nil, err 3908 } 3909 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 3910 if err != nil { 3911 return nil, status.Errorf(codes.InvalidArgument, "error parsing LogCndType field path value from %s: %v", valueStr, err) 3912 } 3913 return fpv.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue), nil 3914 } 3915 3916 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue { 3917 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue(pathStr, valueStr) 3918 if err != nil { 3919 panic(err) 3920 } 3921 return fpv 3922 } 3923 3924 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue struct { 3925 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath 3926 value interface{} 3927 } 3928 3929 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue)(nil) 3930 3931 // GetRawValue returns raw value stored under selected path for 'LogCndType' as interface{} 3932 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) GetRawValue() interface{} { 3933 return fpv.value 3934 } 3935 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) AsFqnValue() (*log_condition.Name, bool) { 3936 res, ok := fpv.value.(*log_condition.Name) 3937 return res, ok 3938 } 3939 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) AsDisplayNameValue() (string, bool) { 3940 res, ok := fpv.value.(string) 3941 return res, ok 3942 } 3943 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) AsQueriesValue() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query, bool) { 3944 res, ok := fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 3945 return res, ok 3946 } 3947 3948 // SetTo stores value for selected field for object LogCndType 3949 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) { 3950 if *target == nil { 3951 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 3952 } 3953 switch fpv.selector { 3954 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3955 (*target).Fqn = fpv.value.(*log_condition.Name) 3956 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3957 (*target).DisplayName = fpv.value.(string) 3958 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 3959 (*target).Queries = fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 3960 default: 3961 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fpv.selector)) 3962 } 3963 } 3964 3965 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) SetToRaw(target proto.Message) { 3966 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 3967 fpv.SetTo(&typedObject) 3968 } 3969 3970 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType'. 3971 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (int, bool) { 3972 switch fpv.selector { 3973 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 3974 leftValue := fpv.value.(*log_condition.Name) 3975 rightValue := source.GetFqn() 3976 if leftValue == nil { 3977 if rightValue != nil { 3978 return -1, true 3979 } 3980 return 0, true 3981 } 3982 if rightValue == nil { 3983 return 1, true 3984 } 3985 if leftValue.String() == rightValue.String() { 3986 return 0, true 3987 } else if leftValue.String() < rightValue.String() { 3988 return -1, true 3989 } else { 3990 return 1, true 3991 } 3992 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 3993 leftValue := fpv.value.(string) 3994 rightValue := source.GetDisplayName() 3995 if (leftValue) == (rightValue) { 3996 return 0, true 3997 } else if (leftValue) < (rightValue) { 3998 return -1, true 3999 } else { 4000 return 1, true 4001 } 4002 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 4003 return 0, false 4004 default: 4005 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fpv.selector)) 4006 } 4007 } 4008 4009 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4010 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 4011 } 4012 4013 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue struct { 4014 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath 4015 subPathValue gotenobject.FieldPathValue 4016 } 4017 4018 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue)(nil) 4019 4020 func (fpvs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue) AsQueriesPathValue() (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue, bool) { 4021 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue) 4022 return res, ok 4023 } 4024 4025 func (fpvs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) { 4026 if *target == nil { 4027 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 4028 } 4029 switch fpvs.Selector() { 4030 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 4031 panic("FieldPath setter is unsupported for array subpaths") 4032 default: 4033 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fpvs.Selector())) 4034 } 4035 } 4036 4037 func (fpvs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue) SetToRaw(target proto.Message) { 4038 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) 4039 fpvs.SetTo(&typedObject) 4040 } 4041 4042 func (fpvs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue) GetRawValue() interface{} { 4043 return fpvs.subPathValue.GetRawValue() 4044 } 4045 4046 func (fpvs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (int, bool) { 4047 switch fpvs.Selector() { 4048 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 4049 return 0, false // repeated field 4050 default: 4051 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fpvs.Selector())) 4052 } 4053 } 4054 4055 func (fpvs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 4056 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 4057 } 4058 4059 // NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue allows storing single item in Path-specific values for LogCndType according to their type 4060 // Present only for array (repeated) types. 4061 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue interface { 4062 gotenobject.FieldPathArrayItemValue 4063 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath 4064 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) bool 4065 } 4066 4067 // ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 4068 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue, error) { 4069 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(pathStr) 4070 if err != nil { 4071 return nil, err 4072 } 4073 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 4074 if err != nil { 4075 return nil, status.Errorf(codes.InvalidArgument, "error parsing LogCndType field path array item value from %s: %v", valueStr, err) 4076 } 4077 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue), nil 4078 } 4079 4080 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue { 4081 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue(pathStr, valueStr) 4082 if err != nil { 4083 panic(err) 4084 } 4085 return fpaiv 4086 } 4087 4088 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue struct { 4089 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath 4090 value interface{} 4091 } 4092 4093 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue)(nil) 4094 4095 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType as interface{} 4096 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 4097 return fpaiv.value 4098 } 4099 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue) AsQueriesItemValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query, bool) { 4100 res, ok := fpaiv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 4101 return res, ok 4102 } 4103 4104 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) (interface{}, bool) { 4105 return nil, false 4106 } 4107 4108 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 4109 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType)) 4110 } 4111 4112 // Contains returns a boolean indicating if value that is being held is present in given 'LogCndType' 4113 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) bool { 4114 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath.Get(source) 4115 for _, v := range slice { 4116 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 4117 if proto.Equal(asProtoMsg, v.(proto.Message)) { 4118 return true 4119 } 4120 } else if reflect.DeepEqual(v, fpaiv.value) { 4121 return true 4122 } 4123 } 4124 return false 4125 } 4126 4127 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayItemValue struct { 4128 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath 4129 subPathItemValue gotenobject.FieldPathArrayItemValue 4130 } 4131 4132 // GetRawValue returns stored array item value 4133 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 4134 return fpaivs.subPathItemValue.GetRawItemValue() 4135 } 4136 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayItemValue) AsQueriesPathItemValue() (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue, bool) { 4137 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue) 4138 return res, ok 4139 } 4140 4141 // Contains returns a boolean indicating if value that is being held is present in given 'LogCndType' 4142 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType) bool { 4143 switch fpaivs.Selector() { 4144 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 4145 return false // repeated/map field 4146 default: 4147 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType: %d", fpaivs.Selector())) 4148 } 4149 } 4150 4151 // NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues allows storing slice of values for LogCndType fields according to their type 4152 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues interface { 4153 gotenobject.FieldPathArrayOfValues 4154 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath 4155 } 4156 4157 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues, error) { 4158 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath(pathStr) 4159 if err != nil { 4160 return nil, err 4161 } 4162 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 4163 if err != nil { 4164 return nil, status.Errorf(codes.InvalidArgument, "error parsing LogCndType field path array of values from %s: %v", valuesStr, err) 4165 } 4166 return fpaov.(NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues), nil 4167 } 4168 4169 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues { 4170 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues(pathStr, valuesStr) 4171 if err != nil { 4172 panic(err) 4173 } 4174 return fpaov 4175 } 4176 4177 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues struct { 4178 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPath 4179 values interface{} 4180 } 4181 4182 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues)(nil) 4183 4184 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 4185 switch fpaov.selector { 4186 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorFqn: 4187 for _, v := range fpaov.values.([]*log_condition.Name) { 4188 values = append(values, v) 4189 } 4190 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorDisplayName: 4191 for _, v := range fpaov.values.([]string) { 4192 values = append(values, v) 4193 } 4194 case NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathSelectorQueries: 4195 for _, v := range fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) { 4196 values = append(values, v) 4197 } 4198 } 4199 return 4200 } 4201 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues) AsFqnArrayOfValues() ([]*log_condition.Name, bool) { 4202 res, ok := fpaov.values.([]*log_condition.Name) 4203 return res, ok 4204 } 4205 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues) AsDisplayNameArrayOfValues() ([]string, bool) { 4206 res, ok := fpaov.values.([]string) 4207 return res, ok 4208 } 4209 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldTerminalPathArrayOfValues) AsQueriesArrayOfValues() ([][]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query, bool) { 4210 res, ok := fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 4211 return res, ok 4212 } 4213 4214 type NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayOfValues struct { 4215 NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPath 4216 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 4217 } 4218 4219 var _ NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayOfValues)(nil) 4220 4221 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 4222 return fpsaov.subPathArrayOfValues.GetRawValues() 4223 } 4224 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsLogCndType_FieldSubPathArrayOfValues) AsQueriesPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues, bool) { 4225 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues) 4226 return res, ok 4227 } 4228 4229 // FieldPath provides implementation to handle 4230 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 4231 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath interface { 4232 gotenobject.FieldPath 4233 Selector() NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector 4234 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) []interface{} 4235 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (interface{}, bool) 4236 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 4237 4238 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue 4239 // (or array of values) and holds passed value. Panics if injected type is incorrect. 4240 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue 4241 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues 4242 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue 4243 } 4244 4245 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector int32 4246 4247 const ( 4248 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 0 4249 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 1 4250 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 2 4251 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 3 4252 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 4 4253 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 5 4254 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 6 4255 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 7 4256 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 8 4257 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 9 4258 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector = 10 4259 ) 4260 4261 func (s NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector) String() string { 4262 switch s { 4263 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4264 return "type" 4265 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4266 return "fqn" 4267 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4268 return "display_name" 4269 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4270 return "is_firing" 4271 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4272 return "start_time" 4273 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4274 return "stop_time" 4275 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4276 return "identification" 4277 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4278 return "violation_info" 4279 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4280 return "escalation_level" 4281 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4282 return "ai_handling" 4283 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4284 return "operator_handling" 4285 default: 4286 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", s)) 4287 } 4288 } 4289 4290 func BuildNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath, error) { 4291 if len(fp) == 0 { 4292 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert") 4293 } 4294 if len(fp) == 1 { 4295 switch fp[0] { 4296 case "type": 4297 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType}, nil 4298 case "fqn": 4299 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn}, nil 4300 case "display_name", "displayName", "display-name": 4301 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName}, nil 4302 case "is_firing", "isFiring", "is-firing": 4303 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring}, nil 4304 case "start_time", "startTime", "start-time": 4305 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime}, nil 4306 case "stop_time", "stopTime", "stop-time": 4307 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime}, nil 4308 case "identification": 4309 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification}, nil 4310 case "violation_info", "violationInfo", "violation-info": 4311 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo}, nil 4312 case "escalation_level", "escalationLevel", "escalation-level": 4313 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel}, nil 4314 case "ai_handling", "aiHandling", "ai-handling": 4315 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling}, nil 4316 case "operator_handling", "operatorHandling", "operator-handling": 4317 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling}, nil 4318 } 4319 } else { 4320 switch fp[0] { 4321 case "identification": 4322 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(fp[1:]); err != nil { 4323 return nil, err 4324 } else { 4325 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification, subPath: subpath}, nil 4326 } 4327 case "violation_info", "violationInfo", "violation-info": 4328 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(fp[1:]); err != nil { 4329 return nil, err 4330 } else { 4331 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo, subPath: subpath}, nil 4332 } 4333 case "ai_handling", "aiHandling", "ai-handling": 4334 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(fp[1:]); err != nil { 4335 return nil, err 4336 } else { 4337 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling, subPath: subpath}, nil 4338 } 4339 case "operator_handling", "operatorHandling", "operator-handling": 4340 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(fp[1:]); err != nil { 4341 return nil, err 4342 } else { 4343 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling, subPath: subpath}, nil 4344 } 4345 } 4346 } 4347 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert", fp) 4348 } 4349 4350 func ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath, error) { 4351 fp, err := gotenobject.ParseRawFieldPath(rawField) 4352 if err != nil { 4353 return nil, err 4354 } 4355 return BuildNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(fp) 4356 } 4357 4358 func MustParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath { 4359 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(rawField) 4360 if err != nil { 4361 panic(err) 4362 } 4363 return fp 4364 } 4365 4366 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath struct { 4367 selector NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector 4368 } 4369 4370 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath)(nil) 4371 4372 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector { 4373 return fp.selector 4374 } 4375 4376 // String returns path representation in proto convention 4377 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) String() string { 4378 return fp.selector.String() 4379 } 4380 4381 // JSONString returns path representation is JSON convention 4382 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) JSONString() string { 4383 return strcase.ToLowerCamel(fp.String()) 4384 } 4385 4386 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert 4387 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (values []interface{}) { 4388 if source != nil { 4389 switch fp.selector { 4390 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4391 values = append(values, source.Type) 4392 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4393 if source.Fqn != nil { 4394 values = append(values, source.Fqn) 4395 } 4396 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4397 values = append(values, source.DisplayName) 4398 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4399 values = append(values, source.IsFiring) 4400 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4401 if source.StartTime != nil { 4402 values = append(values, source.StartTime) 4403 } 4404 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4405 if source.StopTime != nil { 4406 values = append(values, source.StopTime) 4407 } 4408 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4409 if source.Identification != nil { 4410 values = append(values, source.Identification) 4411 } 4412 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4413 if source.ViolationInfo != nil { 4414 values = append(values, source.ViolationInfo) 4415 } 4416 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4417 values = append(values, source.EscalationLevel) 4418 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4419 if source.AiHandling != nil { 4420 values = append(values, source.AiHandling) 4421 } 4422 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4423 if source.OperatorHandling != nil { 4424 values = append(values, source.OperatorHandling) 4425 } 4426 default: 4427 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4428 } 4429 } 4430 return 4431 } 4432 4433 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 4434 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 4435 } 4436 4437 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert 4438 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (interface{}, bool) { 4439 switch fp.selector { 4440 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4441 return source.GetType(), source != nil 4442 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4443 res := source.GetFqn() 4444 return res, res != nil 4445 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4446 return source.GetDisplayName(), source != nil 4447 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4448 return source.GetIsFiring(), source != nil 4449 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4450 res := source.GetStartTime() 4451 return res, res != nil 4452 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4453 res := source.GetStopTime() 4454 return res, res != nil 4455 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4456 res := source.GetIdentification() 4457 return res, res != nil 4458 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4459 res := source.GetViolationInfo() 4460 return res, res != nil 4461 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4462 return source.GetEscalationLevel(), source != nil 4463 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4464 res := source.GetAiHandling() 4465 return res, res != nil 4466 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4467 res := source.GetOperatorHandling() 4468 return res, res != nil 4469 default: 4470 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4471 } 4472 } 4473 4474 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4475 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 4476 } 4477 4478 // GetDefault returns a default value of the field type 4479 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) GetDefault() interface{} { 4480 switch fp.selector { 4481 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4482 return NotificationMsg_AlertsGroup_ConditionAlerts_Alert_UNDEFINED 4483 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4484 return (*alert.Name)(nil) 4485 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4486 return "" 4487 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4488 return false 4489 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4490 return (*timestamppb.Timestamp)(nil) 4491 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4492 return (*timestamppb.Timestamp)(nil) 4493 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4494 return (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)(nil) 4495 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4496 return (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)(nil) 4497 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4498 return alert.Alert_State_NONE 4499 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4500 return (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)(nil) 4501 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4502 return (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)(nil) 4503 default: 4504 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4505 } 4506 } 4507 4508 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) { 4509 if item != nil { 4510 switch fp.selector { 4511 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4512 item.Type = NotificationMsg_AlertsGroup_ConditionAlerts_Alert_UNDEFINED 4513 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4514 item.Fqn = nil 4515 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4516 item.DisplayName = "" 4517 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4518 item.IsFiring = false 4519 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4520 item.StartTime = nil 4521 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4522 item.StopTime = nil 4523 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4524 item.Identification = nil 4525 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4526 item.ViolationInfo = nil 4527 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4528 item.EscalationLevel = alert.Alert_State_NONE 4529 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4530 item.AiHandling = nil 4531 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4532 item.OperatorHandling = nil 4533 default: 4534 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4535 } 4536 } 4537 } 4538 4539 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) ClearValueRaw(item proto.Message) { 4540 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 4541 } 4542 4543 // IsLeaf - whether field path is holds simple value 4544 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) IsLeaf() bool { 4545 return fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType || 4546 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn || 4547 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName || 4548 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring || 4549 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime || 4550 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime || 4551 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel 4552 } 4553 4554 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4555 return []gotenobject.FieldPath{fp} 4556 } 4557 4558 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue { 4559 switch fp.selector { 4560 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4561 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type)} 4562 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4563 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*alert.Name)} 4564 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4565 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(string)} 4566 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4567 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(bool)} 4568 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4569 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 4570 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4571 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*timestamppb.Timestamp)} 4572 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4573 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)} 4574 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4575 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)} 4576 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4577 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(alert.Alert_State_EscalationLevel)} 4578 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4579 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)} 4580 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4581 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)} 4582 default: 4583 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4584 } 4585 } 4586 4587 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4588 return fp.WithIValue(value) 4589 } 4590 4591 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues { 4592 fpaov := &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp} 4593 switch fp.selector { 4594 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4595 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type)} 4596 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4597 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*alert.Name)} 4598 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4599 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]string)} 4600 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4601 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]bool)} 4602 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4603 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 4604 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4605 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*timestamppb.Timestamp)} 4606 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4607 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)} 4608 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4609 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)} 4610 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4611 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]alert.Alert_State_EscalationLevel)} 4612 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4613 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)} 4614 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4615 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath: *fp, values: values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)} 4616 default: 4617 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4618 } 4619 return fpaov 4620 } 4621 4622 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4623 return fp.WithIArrayOfValues(values) 4624 } 4625 4626 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue { 4627 switch fp.selector { 4628 default: 4629 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fp.selector)) 4630 } 4631 } 4632 4633 func (fp *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4634 return fp.WithIArrayItemValue(value) 4635 } 4636 4637 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath struct { 4638 selector NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector 4639 subPath gotenobject.FieldPath 4640 } 4641 4642 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath)(nil) 4643 4644 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelector { 4645 return fps.selector 4646 } 4647 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) AsIdentificationSubPath() (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath, bool) { 4648 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath) 4649 return res, ok 4650 } 4651 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) AsViolationInfoSubPath() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath, bool) { 4652 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath) 4653 return res, ok 4654 } 4655 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) AsAiHandlingSubPath() (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath, bool) { 4656 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath) 4657 return res, ok 4658 } 4659 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) AsOperatorHandlingSubPath() (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath, bool) { 4660 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath) 4661 return res, ok 4662 } 4663 4664 // String returns path representation in proto convention 4665 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) String() string { 4666 return fps.selector.String() + "." + fps.subPath.String() 4667 } 4668 4669 // JSONString returns path representation is JSON convention 4670 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) JSONString() string { 4671 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 4672 } 4673 4674 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert 4675 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (values []interface{}) { 4676 switch fps.selector { 4677 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4678 values = append(values, fps.subPath.GetRaw(source.GetIdentification())...) 4679 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4680 values = append(values, fps.subPath.GetRaw(source.GetViolationInfo())...) 4681 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4682 values = append(values, fps.subPath.GetRaw(source.GetAiHandling())...) 4683 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4684 values = append(values, fps.subPath.GetRaw(source.GetOperatorHandling())...) 4685 default: 4686 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fps.selector)) 4687 } 4688 return 4689 } 4690 4691 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) GetRaw(source proto.Message) []interface{} { 4692 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 4693 } 4694 4695 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert 4696 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (interface{}, bool) { 4697 switch fps.selector { 4698 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4699 if source.GetIdentification() == nil { 4700 return nil, false 4701 } 4702 return fps.subPath.GetSingleRaw(source.GetIdentification()) 4703 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4704 if source.GetViolationInfo() == nil { 4705 return nil, false 4706 } 4707 return fps.subPath.GetSingleRaw(source.GetViolationInfo()) 4708 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4709 if source.GetAiHandling() == nil { 4710 return nil, false 4711 } 4712 return fps.subPath.GetSingleRaw(source.GetAiHandling()) 4713 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4714 if source.GetOperatorHandling() == nil { 4715 return nil, false 4716 } 4717 return fps.subPath.GetSingleRaw(source.GetOperatorHandling()) 4718 default: 4719 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fps.selector)) 4720 } 4721 } 4722 4723 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 4724 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 4725 } 4726 4727 // GetDefault returns a default value of the field type 4728 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) GetDefault() interface{} { 4729 return fps.subPath.GetDefault() 4730 } 4731 4732 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) { 4733 if item != nil { 4734 switch fps.selector { 4735 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4736 fps.subPath.ClearValueRaw(item.Identification) 4737 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4738 fps.subPath.ClearValueRaw(item.ViolationInfo) 4739 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4740 fps.subPath.ClearValueRaw(item.AiHandling) 4741 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4742 fps.subPath.ClearValueRaw(item.OperatorHandling) 4743 default: 4744 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fps.selector)) 4745 } 4746 } 4747 } 4748 4749 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) ClearValueRaw(item proto.Message) { 4750 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 4751 } 4752 4753 // IsLeaf - whether field path is holds simple value 4754 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) IsLeaf() bool { 4755 return fps.subPath.IsLeaf() 4756 } 4757 4758 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 4759 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath{selector: fps.selector}} 4760 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 4761 return iPaths 4762 } 4763 4764 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue { 4765 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 4766 } 4767 4768 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 4769 return fps.WithIValue(value) 4770 } 4771 4772 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues { 4773 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 4774 } 4775 4776 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 4777 return fps.WithIArrayOfValues(values) 4778 } 4779 4780 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue { 4781 return &NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 4782 } 4783 4784 func (fps *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 4785 return fps.WithIArrayItemValue(value) 4786 } 4787 4788 // NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue allows storing values for Alert fields according to their type 4789 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue interface { 4790 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath 4791 gotenobject.FieldPathValue 4792 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 4793 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (cmp int, comparable bool) 4794 } 4795 4796 func ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue, error) { 4797 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(pathStr) 4798 if err != nil { 4799 return nil, err 4800 } 4801 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 4802 if err != nil { 4803 return nil, status.Errorf(codes.InvalidArgument, "error parsing Alert field path value from %s: %v", valueStr, err) 4804 } 4805 return fpv.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue), nil 4806 } 4807 4808 func MustParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue { 4809 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue(pathStr, valueStr) 4810 if err != nil { 4811 panic(err) 4812 } 4813 return fpv 4814 } 4815 4816 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue struct { 4817 NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath 4818 value interface{} 4819 } 4820 4821 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue)(nil) 4822 4823 // GetRawValue returns raw value stored under selected path for 'Alert' as interface{} 4824 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) GetRawValue() interface{} { 4825 return fpv.value 4826 } 4827 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsTypeValue() (NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type, bool) { 4828 res, ok := fpv.value.(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type) 4829 return res, ok 4830 } 4831 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsFqnValue() (*alert.Name, bool) { 4832 res, ok := fpv.value.(*alert.Name) 4833 return res, ok 4834 } 4835 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsDisplayNameValue() (string, bool) { 4836 res, ok := fpv.value.(string) 4837 return res, ok 4838 } 4839 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsIsFiringValue() (bool, bool) { 4840 res, ok := fpv.value.(bool) 4841 return res, ok 4842 } 4843 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsStartTimeValue() (*timestamppb.Timestamp, bool) { 4844 res, ok := fpv.value.(*timestamppb.Timestamp) 4845 return res, ok 4846 } 4847 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsStopTimeValue() (*timestamppb.Timestamp, bool) { 4848 res, ok := fpv.value.(*timestamppb.Timestamp) 4849 return res, ok 4850 } 4851 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsIdentificationValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification, bool) { 4852 res, ok := fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 4853 return res, ok 4854 } 4855 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsViolationInfoValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo, bool) { 4856 res, ok := fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 4857 return res, ok 4858 } 4859 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsEscalationLevelValue() (alert.Alert_State_EscalationLevel, bool) { 4860 res, ok := fpv.value.(alert.Alert_State_EscalationLevel) 4861 return res, ok 4862 } 4863 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsAiHandlingValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling, bool) { 4864 res, ok := fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 4865 return res, ok 4866 } 4867 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) AsOperatorHandlingValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling, bool) { 4868 res, ok := fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 4869 return res, ok 4870 } 4871 4872 // SetTo stores value for selected field for object Alert 4873 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert) { 4874 if *target == nil { 4875 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 4876 } 4877 switch fpv.selector { 4878 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4879 (*target).Type = fpv.value.(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type) 4880 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4881 (*target).Fqn = fpv.value.(*alert.Name) 4882 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4883 (*target).DisplayName = fpv.value.(string) 4884 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4885 (*target).IsFiring = fpv.value.(bool) 4886 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4887 (*target).StartTime = fpv.value.(*timestamppb.Timestamp) 4888 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4889 (*target).StopTime = fpv.value.(*timestamppb.Timestamp) 4890 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 4891 (*target).Identification = fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 4892 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 4893 (*target).ViolationInfo = fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 4894 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 4895 (*target).EscalationLevel = fpv.value.(alert.Alert_State_EscalationLevel) 4896 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 4897 (*target).AiHandling = fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 4898 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 4899 (*target).OperatorHandling = fpv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 4900 default: 4901 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fpv.selector)) 4902 } 4903 } 4904 4905 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) SetToRaw(target proto.Message) { 4906 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 4907 fpv.SetTo(&typedObject) 4908 } 4909 4910 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert'. 4911 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (int, bool) { 4912 switch fpv.selector { 4913 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 4914 leftValue := fpv.value.(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type) 4915 rightValue := source.GetType() 4916 if (leftValue) == (rightValue) { 4917 return 0, true 4918 } else if (leftValue) < (rightValue) { 4919 return -1, true 4920 } else { 4921 return 1, true 4922 } 4923 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 4924 leftValue := fpv.value.(*alert.Name) 4925 rightValue := source.GetFqn() 4926 if leftValue == nil { 4927 if rightValue != nil { 4928 return -1, true 4929 } 4930 return 0, true 4931 } 4932 if rightValue == nil { 4933 return 1, true 4934 } 4935 if leftValue.String() == rightValue.String() { 4936 return 0, true 4937 } else if leftValue.String() < rightValue.String() { 4938 return -1, true 4939 } else { 4940 return 1, true 4941 } 4942 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 4943 leftValue := fpv.value.(string) 4944 rightValue := source.GetDisplayName() 4945 if (leftValue) == (rightValue) { 4946 return 0, true 4947 } else if (leftValue) < (rightValue) { 4948 return -1, true 4949 } else { 4950 return 1, true 4951 } 4952 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 4953 leftValue := fpv.value.(bool) 4954 rightValue := source.GetIsFiring() 4955 if (leftValue) == (rightValue) { 4956 return 0, true 4957 } else if !(leftValue) && (rightValue) { 4958 return -1, true 4959 } else { 4960 return 1, true 4961 } 4962 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 4963 leftValue := fpv.value.(*timestamppb.Timestamp) 4964 rightValue := source.GetStartTime() 4965 if leftValue == nil { 4966 if rightValue != nil { 4967 return -1, true 4968 } 4969 return 0, true 4970 } 4971 if rightValue == nil { 4972 return 1, true 4973 } 4974 if leftValue.AsTime().Equal(rightValue.AsTime()) { 4975 return 0, true 4976 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 4977 return -1, true 4978 } else { 4979 return 1, true 4980 } 4981 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 4982 leftValue := fpv.value.(*timestamppb.Timestamp) 4983 rightValue := source.GetStopTime() 4984 if leftValue == nil { 4985 if rightValue != nil { 4986 return -1, true 4987 } 4988 return 0, true 4989 } 4990 if rightValue == nil { 4991 return 1, true 4992 } 4993 if leftValue.AsTime().Equal(rightValue.AsTime()) { 4994 return 0, true 4995 } else if leftValue.AsTime().Before(rightValue.AsTime()) { 4996 return -1, true 4997 } else { 4998 return 1, true 4999 } 5000 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 5001 return 0, false 5002 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 5003 return 0, false 5004 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 5005 leftValue := fpv.value.(alert.Alert_State_EscalationLevel) 5006 rightValue := source.GetEscalationLevel() 5007 if (leftValue) == (rightValue) { 5008 return 0, true 5009 } else if (leftValue) < (rightValue) { 5010 return -1, true 5011 } else { 5012 return 1, true 5013 } 5014 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 5015 return 0, false 5016 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 5017 return 0, false 5018 default: 5019 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fpv.selector)) 5020 } 5021 } 5022 5023 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5024 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 5025 } 5026 5027 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue struct { 5028 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath 5029 subPathValue gotenobject.FieldPathValue 5030 } 5031 5032 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue)(nil) 5033 5034 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) AsIdentificationPathValue() (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue, bool) { 5035 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue) 5036 return res, ok 5037 } 5038 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) AsViolationInfoPathValue() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue, bool) { 5039 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue) 5040 return res, ok 5041 } 5042 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) AsAiHandlingPathValue() (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue, bool) { 5043 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue) 5044 return res, ok 5045 } 5046 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) AsOperatorHandlingPathValue() (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue, bool) { 5047 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue) 5048 return res, ok 5049 } 5050 5051 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert) { 5052 if *target == nil { 5053 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 5054 } 5055 switch fpvs.Selector() { 5056 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 5057 fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue).SetTo(&(*target).Identification) 5058 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 5059 fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue).SetTo(&(*target).ViolationInfo) 5060 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 5061 fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue).SetTo(&(*target).AiHandling) 5062 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 5063 fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue).SetTo(&(*target).OperatorHandling) 5064 default: 5065 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fpvs.Selector())) 5066 } 5067 } 5068 5069 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) SetToRaw(target proto.Message) { 5070 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) 5071 fpvs.SetTo(&typedObject) 5072 } 5073 5074 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) GetRawValue() interface{} { 5075 return fpvs.subPathValue.GetRawValue() 5076 } 5077 5078 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (int, bool) { 5079 switch fpvs.Selector() { 5080 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 5081 return fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue).CompareWith(source.GetIdentification()) 5082 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 5083 return fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue).CompareWith(source.GetViolationInfo()) 5084 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 5085 return fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue).CompareWith(source.GetAiHandling()) 5086 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 5087 return fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue).CompareWith(source.GetOperatorHandling()) 5088 default: 5089 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fpvs.Selector())) 5090 } 5091 } 5092 5093 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5094 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 5095 } 5096 5097 // NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue allows storing single item in Path-specific values for Alert according to their type 5098 // Present only for array (repeated) types. 5099 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue interface { 5100 gotenobject.FieldPathArrayItemValue 5101 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath 5102 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert) bool 5103 } 5104 5105 // ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 5106 func ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue, error) { 5107 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(pathStr) 5108 if err != nil { 5109 return nil, err 5110 } 5111 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 5112 if err != nil { 5113 return nil, status.Errorf(codes.InvalidArgument, "error parsing Alert field path array item value from %s: %v", valueStr, err) 5114 } 5115 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue), nil 5116 } 5117 5118 func MustParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue { 5119 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue(pathStr, valueStr) 5120 if err != nil { 5121 panic(err) 5122 } 5123 return fpaiv 5124 } 5125 5126 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayItemValue struct { 5127 NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath 5128 value interface{} 5129 } 5130 5131 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayItemValue)(nil) 5132 5133 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_Alert as interface{} 5134 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 5135 return fpaiv.value 5136 } 5137 5138 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) (interface{}, bool) { 5139 return nil, false 5140 } 5141 5142 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 5143 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert)) 5144 } 5145 5146 // Contains returns a boolean indicating if value that is being held is present in given 'Alert' 5147 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) bool { 5148 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath.Get(source) 5149 for _, v := range slice { 5150 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 5151 if proto.Equal(asProtoMsg, v.(proto.Message)) { 5152 return true 5153 } 5154 } else if reflect.DeepEqual(v, fpaiv.value) { 5155 return true 5156 } 5157 } 5158 return false 5159 } 5160 5161 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue struct { 5162 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath 5163 subPathItemValue gotenobject.FieldPathArrayItemValue 5164 } 5165 5166 // GetRawValue returns stored array item value 5167 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 5168 return fpaivs.subPathItemValue.GetRawItemValue() 5169 } 5170 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue) AsIdentificationPathItemValue() (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue, bool) { 5171 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue) 5172 return res, ok 5173 } 5174 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue) AsViolationInfoPathItemValue() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue, bool) { 5175 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue) 5176 return res, ok 5177 } 5178 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue) AsAiHandlingPathItemValue() (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue, bool) { 5179 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue) 5180 return res, ok 5181 } 5182 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue) AsOperatorHandlingPathItemValue() (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue, bool) { 5183 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue) 5184 return res, ok 5185 } 5186 5187 // Contains returns a boolean indicating if value that is being held is present in given 'Alert' 5188 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert) bool { 5189 switch fpaivs.Selector() { 5190 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 5191 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue).ContainsValue(source.GetIdentification()) 5192 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 5193 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue).ContainsValue(source.GetViolationInfo()) 5194 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 5195 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue).ContainsValue(source.GetAiHandling()) 5196 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 5197 return fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue).ContainsValue(source.GetOperatorHandling()) 5198 default: 5199 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert: %d", fpaivs.Selector())) 5200 } 5201 } 5202 5203 // NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues allows storing slice of values for Alert fields according to their type 5204 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues interface { 5205 gotenobject.FieldPathArrayOfValues 5206 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath 5207 } 5208 5209 func ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues, error) { 5210 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPath(pathStr) 5211 if err != nil { 5212 return nil, err 5213 } 5214 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 5215 if err != nil { 5216 return nil, status.Errorf(codes.InvalidArgument, "error parsing Alert field path array of values from %s: %v", valuesStr, err) 5217 } 5218 return fpaov.(NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues), nil 5219 } 5220 5221 func MustParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues { 5222 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues(pathStr, valuesStr) 5223 if err != nil { 5224 panic(err) 5225 } 5226 return fpaov 5227 } 5228 5229 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues struct { 5230 NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPath 5231 values interface{} 5232 } 5233 5234 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues)(nil) 5235 5236 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 5237 switch fpaov.selector { 5238 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorType: 5239 for _, v := range fpaov.values.([]NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type) { 5240 values = append(values, v) 5241 } 5242 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorFqn: 5243 for _, v := range fpaov.values.([]*alert.Name) { 5244 values = append(values, v) 5245 } 5246 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorDisplayName: 5247 for _, v := range fpaov.values.([]string) { 5248 values = append(values, v) 5249 } 5250 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIsFiring: 5251 for _, v := range fpaov.values.([]bool) { 5252 values = append(values, v) 5253 } 5254 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStartTime: 5255 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 5256 values = append(values, v) 5257 } 5258 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorStopTime: 5259 for _, v := range fpaov.values.([]*timestamppb.Timestamp) { 5260 values = append(values, v) 5261 } 5262 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorIdentification: 5263 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) { 5264 values = append(values, v) 5265 } 5266 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorViolationInfo: 5267 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) { 5268 values = append(values, v) 5269 } 5270 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorEscalationLevel: 5271 for _, v := range fpaov.values.([]alert.Alert_State_EscalationLevel) { 5272 values = append(values, v) 5273 } 5274 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorAiHandling: 5275 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) { 5276 values = append(values, v) 5277 } 5278 case NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathSelectorOperatorHandling: 5279 for _, v := range fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) { 5280 values = append(values, v) 5281 } 5282 } 5283 return 5284 } 5285 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsTypeArrayOfValues() ([]NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type, bool) { 5286 res, ok := fpaov.values.([]NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Type) 5287 return res, ok 5288 } 5289 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsFqnArrayOfValues() ([]*alert.Name, bool) { 5290 res, ok := fpaov.values.([]*alert.Name) 5291 return res, ok 5292 } 5293 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsDisplayNameArrayOfValues() ([]string, bool) { 5294 res, ok := fpaov.values.([]string) 5295 return res, ok 5296 } 5297 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsIsFiringArrayOfValues() ([]bool, bool) { 5298 res, ok := fpaov.values.([]bool) 5299 return res, ok 5300 } 5301 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsStartTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 5302 res, ok := fpaov.values.([]*timestamppb.Timestamp) 5303 return res, ok 5304 } 5305 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsStopTimeArrayOfValues() ([]*timestamppb.Timestamp, bool) { 5306 res, ok := fpaov.values.([]*timestamppb.Timestamp) 5307 return res, ok 5308 } 5309 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsIdentificationArrayOfValues() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification, bool) { 5310 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 5311 return res, ok 5312 } 5313 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsViolationInfoArrayOfValues() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo, bool) { 5314 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 5315 return res, ok 5316 } 5317 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsEscalationLevelArrayOfValues() ([]alert.Alert_State_EscalationLevel, bool) { 5318 res, ok := fpaov.values.([]alert.Alert_State_EscalationLevel) 5319 return res, ok 5320 } 5321 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsAiHandlingArrayOfValues() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling, bool) { 5322 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 5323 return res, ok 5324 } 5325 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldTerminalPathArrayOfValues) AsOperatorHandlingArrayOfValues() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling, bool) { 5326 res, ok := fpaov.values.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 5327 return res, ok 5328 } 5329 5330 type NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues struct { 5331 NotificationMsgAlertsGroupConditionAlertsAlert_FieldPath 5332 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 5333 } 5334 5335 var _ NotificationMsgAlertsGroupConditionAlertsAlert_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues)(nil) 5336 5337 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 5338 return fpsaov.subPathArrayOfValues.GetRawValues() 5339 } 5340 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues) AsIdentificationPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues, bool) { 5341 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues) 5342 return res, ok 5343 } 5344 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues) AsViolationInfoPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues, bool) { 5345 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues) 5346 return res, ok 5347 } 5348 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues) AsAiHandlingPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues, bool) { 5349 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues) 5350 return res, ok 5351 } 5352 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlert_FieldSubPathArrayOfValues) AsOperatorHandlingPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues, bool) { 5353 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues) 5354 return res, ok 5355 } 5356 5357 // FieldPath provides implementation to handle 5358 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 5359 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath interface { 5360 gotenobject.FieldPath 5361 Selector() NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector 5362 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) []interface{} 5363 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (interface{}, bool) 5364 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 5365 5366 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue 5367 // (or array of values) and holds passed value. Panics if injected type is incorrect. 5368 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue 5369 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues 5370 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue 5371 } 5372 5373 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector int32 5374 5375 const ( 5376 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector = 0 5377 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector = 1 5378 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector = 2 5379 ) 5380 5381 func (s NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector) String() string { 5382 switch s { 5383 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5384 return "description" 5385 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5386 return "filter" 5387 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5388 return "aggregation" 5389 default: 5390 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", s)) 5391 } 5392 } 5393 5394 func BuildNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath, error) { 5395 if len(fp) == 0 { 5396 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query") 5397 } 5398 if len(fp) == 1 { 5399 switch fp[0] { 5400 case "description": 5401 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription}, nil 5402 case "filter": 5403 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter}, nil 5404 case "aggregation": 5405 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation}, nil 5406 } 5407 } else { 5408 switch fp[0] { 5409 case "aggregation": 5410 if subpath, err := monitoring_common.BuildAggregation_FieldPath(fp[1:]); err != nil { 5411 return nil, err 5412 } else { 5413 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation, subPath: subpath}, nil 5414 } 5415 } 5416 } 5417 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query", fp) 5418 } 5419 5420 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath, error) { 5421 fp, err := gotenobject.ParseRawFieldPath(rawField) 5422 if err != nil { 5423 return nil, err 5424 } 5425 return BuildNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(fp) 5426 } 5427 5428 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath { 5429 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(rawField) 5430 if err != nil { 5431 panic(err) 5432 } 5433 return fp 5434 } 5435 5436 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath struct { 5437 selector NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector 5438 } 5439 5440 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath)(nil) 5441 5442 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector { 5443 return fp.selector 5444 } 5445 5446 // String returns path representation in proto convention 5447 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) String() string { 5448 return fp.selector.String() 5449 } 5450 5451 // JSONString returns path representation is JSON convention 5452 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) JSONString() string { 5453 return strcase.ToLowerCamel(fp.String()) 5454 } 5455 5456 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query 5457 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (values []interface{}) { 5458 if source != nil { 5459 switch fp.selector { 5460 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5461 values = append(values, source.Description) 5462 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5463 values = append(values, source.Filter) 5464 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5465 if source.Aggregation != nil { 5466 values = append(values, source.Aggregation) 5467 } 5468 default: 5469 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5470 } 5471 } 5472 return 5473 } 5474 5475 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 5476 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5477 } 5478 5479 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query 5480 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (interface{}, bool) { 5481 switch fp.selector { 5482 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5483 return source.GetDescription(), source != nil 5484 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5485 return source.GetFilter(), source != nil 5486 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5487 res := source.GetAggregation() 5488 return res, res != nil 5489 default: 5490 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5491 } 5492 } 5493 5494 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5495 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5496 } 5497 5498 // GetDefault returns a default value of the field type 5499 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) GetDefault() interface{} { 5500 switch fp.selector { 5501 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5502 return "" 5503 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5504 return "" 5505 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5506 return (*monitoring_common.Aggregation)(nil) 5507 default: 5508 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5509 } 5510 } 5511 5512 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) { 5513 if item != nil { 5514 switch fp.selector { 5515 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5516 item.Description = "" 5517 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5518 item.Filter = "" 5519 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5520 item.Aggregation = nil 5521 default: 5522 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5523 } 5524 } 5525 } 5526 5527 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) ClearValueRaw(item proto.Message) { 5528 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5529 } 5530 5531 // IsLeaf - whether field path is holds simple value 5532 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) IsLeaf() bool { 5533 return fp.selector == NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription || 5534 fp.selector == NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter 5535 } 5536 5537 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5538 return []gotenobject.FieldPath{fp} 5539 } 5540 5541 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue { 5542 switch fp.selector { 5543 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5544 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp, value: value.(string)} 5545 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5546 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp, value: value.(string)} 5547 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5548 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp, value: value.(*monitoring_common.Aggregation)} 5549 default: 5550 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5551 } 5552 } 5553 5554 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5555 return fp.WithIValue(value) 5556 } 5557 5558 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues { 5559 fpaov := &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp} 5560 switch fp.selector { 5561 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5562 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp, values: values.([]string)} 5563 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5564 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp, values: values.([]string)} 5565 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5566 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath: *fp, values: values.([]*monitoring_common.Aggregation)} 5567 default: 5568 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5569 } 5570 return fpaov 5571 } 5572 5573 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5574 return fp.WithIArrayOfValues(values) 5575 } 5576 5577 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue { 5578 switch fp.selector { 5579 default: 5580 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fp.selector)) 5581 } 5582 } 5583 5584 func (fp *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5585 return fp.WithIArrayItemValue(value) 5586 } 5587 5588 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath struct { 5589 selector NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector 5590 subPath gotenobject.FieldPath 5591 } 5592 5593 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath)(nil) 5594 5595 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelector { 5596 return fps.selector 5597 } 5598 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) AsAggregationSubPath() (monitoring_common.Aggregation_FieldPath, bool) { 5599 res, ok := fps.subPath.(monitoring_common.Aggregation_FieldPath) 5600 return res, ok 5601 } 5602 5603 // String returns path representation in proto convention 5604 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) String() string { 5605 return fps.selector.String() + "." + fps.subPath.String() 5606 } 5607 5608 // JSONString returns path representation is JSON convention 5609 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) JSONString() string { 5610 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 5611 } 5612 5613 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query 5614 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (values []interface{}) { 5615 switch fps.selector { 5616 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5617 values = append(values, fps.subPath.GetRaw(source.GetAggregation())...) 5618 default: 5619 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fps.selector)) 5620 } 5621 return 5622 } 5623 5624 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) GetRaw(source proto.Message) []interface{} { 5625 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5626 } 5627 5628 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query 5629 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (interface{}, bool) { 5630 switch fps.selector { 5631 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5632 if source.GetAggregation() == nil { 5633 return nil, false 5634 } 5635 return fps.subPath.GetSingleRaw(source.GetAggregation()) 5636 default: 5637 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fps.selector)) 5638 } 5639 } 5640 5641 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 5642 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5643 } 5644 5645 // GetDefault returns a default value of the field type 5646 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) GetDefault() interface{} { 5647 return fps.subPath.GetDefault() 5648 } 5649 5650 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) { 5651 if item != nil { 5652 switch fps.selector { 5653 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5654 fps.subPath.ClearValueRaw(item.Aggregation) 5655 default: 5656 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fps.selector)) 5657 } 5658 } 5659 } 5660 5661 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) ClearValueRaw(item proto.Message) { 5662 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5663 } 5664 5665 // IsLeaf - whether field path is holds simple value 5666 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) IsLeaf() bool { 5667 return fps.subPath.IsLeaf() 5668 } 5669 5670 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 5671 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath{selector: fps.selector}} 5672 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 5673 return iPaths 5674 } 5675 5676 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue { 5677 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 5678 } 5679 5680 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 5681 return fps.WithIValue(value) 5682 } 5683 5684 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues { 5685 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 5686 } 5687 5688 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 5689 return fps.WithIArrayOfValues(values) 5690 } 5691 5692 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue { 5693 return &NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 5694 } 5695 5696 func (fps *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 5697 return fps.WithIArrayItemValue(value) 5698 } 5699 5700 // NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue allows storing values for Query fields according to their type 5701 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue interface { 5702 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath 5703 gotenobject.FieldPathValue 5704 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 5705 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (cmp int, comparable bool) 5706 } 5707 5708 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue, error) { 5709 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(pathStr) 5710 if err != nil { 5711 return nil, err 5712 } 5713 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 5714 if err != nil { 5715 return nil, status.Errorf(codes.InvalidArgument, "error parsing Query field path value from %s: %v", valueStr, err) 5716 } 5717 return fpv.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue), nil 5718 } 5719 5720 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue { 5721 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue(pathStr, valueStr) 5722 if err != nil { 5723 panic(err) 5724 } 5725 return fpv 5726 } 5727 5728 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue struct { 5729 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath 5730 value interface{} 5731 } 5732 5733 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue)(nil) 5734 5735 // GetRawValue returns raw value stored under selected path for 'Query' as interface{} 5736 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) GetRawValue() interface{} { 5737 return fpv.value 5738 } 5739 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 5740 res, ok := fpv.value.(string) 5741 return res, ok 5742 } 5743 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) AsFilterValue() (string, bool) { 5744 res, ok := fpv.value.(string) 5745 return res, ok 5746 } 5747 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) AsAggregationValue() (*monitoring_common.Aggregation, bool) { 5748 res, ok := fpv.value.(*monitoring_common.Aggregation) 5749 return res, ok 5750 } 5751 5752 // SetTo stores value for selected field for object Query 5753 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) { 5754 if *target == nil { 5755 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 5756 } 5757 switch fpv.selector { 5758 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5759 (*target).Description = fpv.value.(string) 5760 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5761 (*target).Filter = fpv.value.(string) 5762 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5763 (*target).Aggregation = fpv.value.(*monitoring_common.Aggregation) 5764 default: 5765 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fpv.selector)) 5766 } 5767 } 5768 5769 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) SetToRaw(target proto.Message) { 5770 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 5771 fpv.SetTo(&typedObject) 5772 } 5773 5774 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query'. 5775 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (int, bool) { 5776 switch fpv.selector { 5777 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5778 leftValue := fpv.value.(string) 5779 rightValue := source.GetDescription() 5780 if (leftValue) == (rightValue) { 5781 return 0, true 5782 } else if (leftValue) < (rightValue) { 5783 return -1, true 5784 } else { 5785 return 1, true 5786 } 5787 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5788 leftValue := fpv.value.(string) 5789 rightValue := source.GetFilter() 5790 if (leftValue) == (rightValue) { 5791 return 0, true 5792 } else if (leftValue) < (rightValue) { 5793 return -1, true 5794 } else { 5795 return 1, true 5796 } 5797 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5798 return 0, false 5799 default: 5800 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fpv.selector)) 5801 } 5802 } 5803 5804 func (fpv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5805 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5806 } 5807 5808 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue struct { 5809 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath 5810 subPathValue gotenobject.FieldPathValue 5811 } 5812 5813 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue)(nil) 5814 5815 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue) AsAggregationPathValue() (monitoring_common.Aggregation_FieldPathValue, bool) { 5816 res, ok := fpvs.subPathValue.(monitoring_common.Aggregation_FieldPathValue) 5817 return res, ok 5818 } 5819 5820 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) { 5821 if *target == nil { 5822 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 5823 } 5824 switch fpvs.Selector() { 5825 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5826 fpvs.subPathValue.(monitoring_common.Aggregation_FieldPathValue).SetTo(&(*target).Aggregation) 5827 default: 5828 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fpvs.Selector())) 5829 } 5830 } 5831 5832 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue) SetToRaw(target proto.Message) { 5833 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) 5834 fpvs.SetTo(&typedObject) 5835 } 5836 5837 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue) GetRawValue() interface{} { 5838 return fpvs.subPathValue.GetRawValue() 5839 } 5840 5841 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (int, bool) { 5842 switch fpvs.Selector() { 5843 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5844 return fpvs.subPathValue.(monitoring_common.Aggregation_FieldPathValue).CompareWith(source.GetAggregation()) 5845 default: 5846 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fpvs.Selector())) 5847 } 5848 } 5849 5850 func (fpvs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 5851 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5852 } 5853 5854 // NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue allows storing single item in Path-specific values for Query according to their type 5855 // Present only for array (repeated) types. 5856 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue interface { 5857 gotenobject.FieldPathArrayItemValue 5858 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath 5859 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) bool 5860 } 5861 5862 // ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 5863 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue, error) { 5864 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(pathStr) 5865 if err != nil { 5866 return nil, err 5867 } 5868 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 5869 if err != nil { 5870 return nil, status.Errorf(codes.InvalidArgument, "error parsing Query field path array item value from %s: %v", valueStr, err) 5871 } 5872 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue), nil 5873 } 5874 5875 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue { 5876 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue(pathStr, valueStr) 5877 if err != nil { 5878 panic(err) 5879 } 5880 return fpaiv 5881 } 5882 5883 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayItemValue struct { 5884 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath 5885 value interface{} 5886 } 5887 5888 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayItemValue)(nil) 5889 5890 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query as interface{} 5891 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 5892 return fpaiv.value 5893 } 5894 5895 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) (interface{}, bool) { 5896 return nil, false 5897 } 5898 5899 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 5900 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query)) 5901 } 5902 5903 // Contains returns a boolean indicating if value that is being held is present in given 'Query' 5904 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) bool { 5905 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath.Get(source) 5906 for _, v := range slice { 5907 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 5908 if proto.Equal(asProtoMsg, v.(proto.Message)) { 5909 return true 5910 } 5911 } else if reflect.DeepEqual(v, fpaiv.value) { 5912 return true 5913 } 5914 } 5915 return false 5916 } 5917 5918 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayItemValue struct { 5919 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath 5920 subPathItemValue gotenobject.FieldPathArrayItemValue 5921 } 5922 5923 // GetRawValue returns stored array item value 5924 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 5925 return fpaivs.subPathItemValue.GetRawItemValue() 5926 } 5927 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayItemValue) AsAggregationPathItemValue() (monitoring_common.Aggregation_FieldPathArrayItemValue, bool) { 5928 res, ok := fpaivs.subPathItemValue.(monitoring_common.Aggregation_FieldPathArrayItemValue) 5929 return res, ok 5930 } 5931 5932 // Contains returns a boolean indicating if value that is being held is present in given 'Query' 5933 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query) bool { 5934 switch fpaivs.Selector() { 5935 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5936 return fpaivs.subPathItemValue.(monitoring_common.Aggregation_FieldPathArrayItemValue).ContainsValue(source.GetAggregation()) 5937 default: 5938 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_TsCndType_Query: %d", fpaivs.Selector())) 5939 } 5940 } 5941 5942 // NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues allows storing slice of values for Query fields according to their type 5943 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues interface { 5944 gotenobject.FieldPathArrayOfValues 5945 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath 5946 } 5947 5948 func ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues, error) { 5949 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath(pathStr) 5950 if err != nil { 5951 return nil, err 5952 } 5953 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 5954 if err != nil { 5955 return nil, status.Errorf(codes.InvalidArgument, "error parsing Query field path array of values from %s: %v", valuesStr, err) 5956 } 5957 return fpaov.(NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues), nil 5958 } 5959 5960 func MustParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues { 5961 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues(pathStr, valuesStr) 5962 if err != nil { 5963 panic(err) 5964 } 5965 return fpaov 5966 } 5967 5968 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues struct { 5969 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPath 5970 values interface{} 5971 } 5972 5973 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues)(nil) 5974 5975 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 5976 switch fpaov.selector { 5977 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorDescription: 5978 for _, v := range fpaov.values.([]string) { 5979 values = append(values, v) 5980 } 5981 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorFilter: 5982 for _, v := range fpaov.values.([]string) { 5983 values = append(values, v) 5984 } 5985 case NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathSelectorAggregation: 5986 for _, v := range fpaov.values.([]*monitoring_common.Aggregation) { 5987 values = append(values, v) 5988 } 5989 } 5990 return 5991 } 5992 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 5993 res, ok := fpaov.values.([]string) 5994 return res, ok 5995 } 5996 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues) AsFilterArrayOfValues() ([]string, bool) { 5997 res, ok := fpaov.values.([]string) 5998 return res, ok 5999 } 6000 func (fpaov *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldTerminalPathArrayOfValues) AsAggregationArrayOfValues() ([]*monitoring_common.Aggregation, bool) { 6001 res, ok := fpaov.values.([]*monitoring_common.Aggregation) 6002 return res, ok 6003 } 6004 6005 type NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayOfValues struct { 6006 NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPath 6007 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 6008 } 6009 6010 var _ NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayOfValues)(nil) 6011 6012 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 6013 return fpsaov.subPathArrayOfValues.GetRawValues() 6014 } 6015 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsTsCndTypeQuery_FieldSubPathArrayOfValues) AsAggregationPathArrayOfValues() (monitoring_common.Aggregation_FieldPathArrayOfValues, bool) { 6016 res, ok := fpsaov.subPathArrayOfValues.(monitoring_common.Aggregation_FieldPathArrayOfValues) 6017 return res, ok 6018 } 6019 6020 // FieldPath provides implementation to handle 6021 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 6022 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath interface { 6023 gotenobject.FieldPath 6024 Selector() NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector 6025 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) []interface{} 6026 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) (interface{}, bool) 6027 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 6028 6029 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue 6030 // (or array of values) and holds passed value. Panics if injected type is incorrect. 6031 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue 6032 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues 6033 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue 6034 } 6035 6036 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector int32 6037 6038 const ( 6039 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector = 0 6040 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector = 1 6041 ) 6042 6043 func (s NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector) String() string { 6044 switch s { 6045 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6046 return "description" 6047 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6048 return "filter" 6049 default: 6050 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", s)) 6051 } 6052 } 6053 6054 func BuildNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath, error) { 6055 if len(fp) == 0 { 6056 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query") 6057 } 6058 if len(fp) == 1 { 6059 switch fp[0] { 6060 case "description": 6061 return &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription}, nil 6062 case "filter": 6063 return &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter}, nil 6064 } 6065 } 6066 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query", fp) 6067 } 6068 6069 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath, error) { 6070 fp, err := gotenobject.ParseRawFieldPath(rawField) 6071 if err != nil { 6072 return nil, err 6073 } 6074 return BuildNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(fp) 6075 } 6076 6077 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath { 6078 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(rawField) 6079 if err != nil { 6080 panic(err) 6081 } 6082 return fp 6083 } 6084 6085 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath struct { 6086 selector NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector 6087 } 6088 6089 var _ NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath)(nil) 6090 6091 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelector { 6092 return fp.selector 6093 } 6094 6095 // String returns path representation in proto convention 6096 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) String() string { 6097 return fp.selector.String() 6098 } 6099 6100 // JSONString returns path representation is JSON convention 6101 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) JSONString() string { 6102 return strcase.ToLowerCamel(fp.String()) 6103 } 6104 6105 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query 6106 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) (values []interface{}) { 6107 if source != nil { 6108 switch fp.selector { 6109 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6110 values = append(values, source.Description) 6111 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6112 values = append(values, source.Filter) 6113 default: 6114 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6115 } 6116 } 6117 return 6118 } 6119 6120 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 6121 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)) 6122 } 6123 6124 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query 6125 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) (interface{}, bool) { 6126 switch fp.selector { 6127 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6128 return source.GetDescription(), source != nil 6129 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6130 return source.GetFilter(), source != nil 6131 default: 6132 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6133 } 6134 } 6135 6136 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6137 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)) 6138 } 6139 6140 // GetDefault returns a default value of the field type 6141 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) GetDefault() interface{} { 6142 switch fp.selector { 6143 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6144 return "" 6145 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6146 return "" 6147 default: 6148 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6149 } 6150 } 6151 6152 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) { 6153 if item != nil { 6154 switch fp.selector { 6155 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6156 item.Description = "" 6157 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6158 item.Filter = "" 6159 default: 6160 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6161 } 6162 } 6163 } 6164 6165 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) ClearValueRaw(item proto.Message) { 6166 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)) 6167 } 6168 6169 // IsLeaf - whether field path is holds simple value 6170 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) IsLeaf() bool { 6171 return fp.selector == NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription || 6172 fp.selector == NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter 6173 } 6174 6175 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6176 return []gotenobject.FieldPath{fp} 6177 } 6178 6179 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue { 6180 switch fp.selector { 6181 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6182 return &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath: *fp, value: value.(string)} 6183 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6184 return &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath: *fp, value: value.(string)} 6185 default: 6186 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6187 } 6188 } 6189 6190 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6191 return fp.WithIValue(value) 6192 } 6193 6194 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues { 6195 fpaov := &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath: *fp} 6196 switch fp.selector { 6197 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6198 return &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath: *fp, values: values.([]string)} 6199 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6200 return &NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath: *fp, values: values.([]string)} 6201 default: 6202 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6203 } 6204 return fpaov 6205 } 6206 6207 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6208 return fp.WithIArrayOfValues(values) 6209 } 6210 6211 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue { 6212 switch fp.selector { 6213 default: 6214 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fp.selector)) 6215 } 6216 } 6217 6218 func (fp *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6219 return fp.WithIArrayItemValue(value) 6220 } 6221 6222 // NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue allows storing values for Query fields according to their type 6223 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue interface { 6224 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath 6225 gotenobject.FieldPathValue 6226 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 6227 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) (cmp int, comparable bool) 6228 } 6229 6230 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue, error) { 6231 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(pathStr) 6232 if err != nil { 6233 return nil, err 6234 } 6235 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 6236 if err != nil { 6237 return nil, status.Errorf(codes.InvalidArgument, "error parsing Query field path value from %s: %v", valueStr, err) 6238 } 6239 return fpv.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue), nil 6240 } 6241 6242 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue { 6243 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue(pathStr, valueStr) 6244 if err != nil { 6245 panic(err) 6246 } 6247 return fpv 6248 } 6249 6250 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue struct { 6251 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath 6252 value interface{} 6253 } 6254 6255 var _ NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue)(nil) 6256 6257 // GetRawValue returns raw value stored under selected path for 'Query' as interface{} 6258 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) GetRawValue() interface{} { 6259 return fpv.value 6260 } 6261 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) AsDescriptionValue() (string, bool) { 6262 res, ok := fpv.value.(string) 6263 return res, ok 6264 } 6265 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) AsFilterValue() (string, bool) { 6266 res, ok := fpv.value.(string) 6267 return res, ok 6268 } 6269 6270 // SetTo stores value for selected field for object Query 6271 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) { 6272 if *target == nil { 6273 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 6274 } 6275 switch fpv.selector { 6276 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6277 (*target).Description = fpv.value.(string) 6278 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6279 (*target).Filter = fpv.value.(string) 6280 default: 6281 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fpv.selector)) 6282 } 6283 } 6284 6285 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) SetToRaw(target proto.Message) { 6286 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) 6287 fpv.SetTo(&typedObject) 6288 } 6289 6290 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query'. 6291 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) (int, bool) { 6292 switch fpv.selector { 6293 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6294 leftValue := fpv.value.(string) 6295 rightValue := source.GetDescription() 6296 if (leftValue) == (rightValue) { 6297 return 0, true 6298 } else if (leftValue) < (rightValue) { 6299 return -1, true 6300 } else { 6301 return 1, true 6302 } 6303 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6304 leftValue := fpv.value.(string) 6305 rightValue := source.GetFilter() 6306 if (leftValue) == (rightValue) { 6307 return 0, true 6308 } else if (leftValue) < (rightValue) { 6309 return -1, true 6310 } else { 6311 return 1, true 6312 } 6313 default: 6314 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query: %d", fpv.selector)) 6315 } 6316 } 6317 6318 func (fpv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6319 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)) 6320 } 6321 6322 // NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue allows storing single item in Path-specific values for Query according to their type 6323 // Present only for array (repeated) types. 6324 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue interface { 6325 gotenobject.FieldPathArrayItemValue 6326 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath 6327 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) bool 6328 } 6329 6330 // ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 6331 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue, error) { 6332 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath(pathStr) 6333 if err != nil { 6334 return nil, err 6335 } 6336 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 6337 if err != nil { 6338 return nil, status.Errorf(codes.InvalidArgument, "error parsing Query field path array item value from %s: %v", valueStr, err) 6339 } 6340 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue), nil 6341 } 6342 6343 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue { 6344 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue(pathStr, valueStr) 6345 if err != nil { 6346 panic(err) 6347 } 6348 return fpaiv 6349 } 6350 6351 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayItemValue struct { 6352 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath 6353 value interface{} 6354 } 6355 6356 var _ NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayItemValue)(nil) 6357 6358 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query as interface{} 6359 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 6360 return fpaiv.value 6361 } 6362 6363 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) (interface{}, bool) { 6364 return nil, false 6365 } 6366 6367 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 6368 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query)) 6369 } 6370 6371 // Contains returns a boolean indicating if value that is being held is present in given 'Query' 6372 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_LogCndType_Query) bool { 6373 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath.Get(source) 6374 for _, v := range slice { 6375 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 6376 if proto.Equal(asProtoMsg, v.(proto.Message)) { 6377 return true 6378 } 6379 } else if reflect.DeepEqual(v, fpaiv.value) { 6380 return true 6381 } 6382 } 6383 return false 6384 } 6385 6386 // NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues allows storing slice of values for Query fields according to their type 6387 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues interface { 6388 gotenobject.FieldPathArrayOfValues 6389 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPath 6390 } 6391 6392 func ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues, error) { 6393 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_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 Query field path array of values from %s: %v", valuesStr, err) 6400 } 6401 return fpaov.(NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues), nil 6402 } 6403 6404 func MustParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues { 6405 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues(pathStr, valuesStr) 6406 if err != nil { 6407 panic(err) 6408 } 6409 return fpaov 6410 } 6411 6412 type NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues struct { 6413 NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPath 6414 values interface{} 6415 } 6416 6417 var _ NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues)(nil) 6418 6419 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 6420 switch fpaov.selector { 6421 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorDescription: 6422 for _, v := range fpaov.values.([]string) { 6423 values = append(values, v) 6424 } 6425 case NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldPathSelectorFilter: 6426 for _, v := range fpaov.values.([]string) { 6427 values = append(values, v) 6428 } 6429 } 6430 return 6431 } 6432 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues) AsDescriptionArrayOfValues() ([]string, bool) { 6433 res, ok := fpaov.values.([]string) 6434 return res, ok 6435 } 6436 func (fpaov *NotificationMsgAlertsGroupConditionAlertsLogCndTypeQuery_FieldTerminalPathArrayOfValues) AsFilterArrayOfValues() ([]string, bool) { 6437 res, ok := fpaov.values.([]string) 6438 return res, ok 6439 } 6440 6441 // FieldPath provides implementation to handle 6442 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 6443 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath interface { 6444 gotenobject.FieldPath 6445 Selector() NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector 6446 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) []interface{} 6447 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (interface{}, bool) 6448 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 6449 6450 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue 6451 // (or array of values) and holds passed value. Panics if injected type is incorrect. 6452 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue 6453 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues 6454 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue 6455 } 6456 6457 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector int32 6458 6459 const ( 6460 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector = 0 6461 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector = 1 6462 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector = 2 6463 ) 6464 6465 func (s NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector) String() string { 6466 switch s { 6467 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6468 return "log_labels" 6469 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6470 return "metric_labels" 6471 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6472 return "resource_labels" 6473 default: 6474 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", s)) 6475 } 6476 } 6477 6478 func BuildNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath, error) { 6479 if len(fp) == 0 { 6480 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification") 6481 } 6482 if len(fp) == 1 { 6483 switch fp[0] { 6484 case "log_labels", "logLabels", "log-labels": 6485 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels}, nil 6486 case "metric_labels", "metricLabels", "metric-labels": 6487 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels}, nil 6488 case "resource_labels", "resourceLabels", "resource-labels": 6489 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels}, nil 6490 } 6491 } else { 6492 switch fp[0] { 6493 case "log_labels", "logLabels", "log-labels": 6494 if len(fp) > 2 { 6495 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)", fp) 6496 } 6497 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap{selector: NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels, key: fp[1]}, nil 6498 case "metric_labels", "metricLabels", "metric-labels": 6499 if len(fp) > 2 { 6500 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)", fp) 6501 } 6502 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap{selector: NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels, key: fp[1]}, nil 6503 case "resource_labels", "resourceLabels", "resource-labels": 6504 if len(fp) > 2 { 6505 return nil, status.Errorf(codes.InvalidArgument, "sub path for maps ('%s') are not supported (object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)", fp) 6506 } 6507 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap{selector: NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels, key: fp[1]}, nil 6508 } 6509 } 6510 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification", fp) 6511 } 6512 6513 func ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath, error) { 6514 fp, err := gotenobject.ParseRawFieldPath(rawField) 6515 if err != nil { 6516 return nil, err 6517 } 6518 return BuildNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(fp) 6519 } 6520 6521 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath { 6522 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(rawField) 6523 if err != nil { 6524 panic(err) 6525 } 6526 return fp 6527 } 6528 6529 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath struct { 6530 selector NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector 6531 } 6532 6533 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath)(nil) 6534 6535 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector { 6536 return fp.selector 6537 } 6538 6539 // String returns path representation in proto convention 6540 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) String() string { 6541 return fp.selector.String() 6542 } 6543 6544 // JSONString returns path representation is JSON convention 6545 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) JSONString() string { 6546 return strcase.ToLowerCamel(fp.String()) 6547 } 6548 6549 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification 6550 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (values []interface{}) { 6551 if source != nil { 6552 switch fp.selector { 6553 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6554 values = append(values, source.LogLabels) 6555 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6556 values = append(values, source.MetricLabels) 6557 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6558 values = append(values, source.ResourceLabels) 6559 default: 6560 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6561 } 6562 } 6563 return 6564 } 6565 6566 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 6567 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6568 } 6569 6570 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification 6571 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (interface{}, bool) { 6572 switch fp.selector { 6573 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6574 res := source.GetLogLabels() 6575 return res, res != nil 6576 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6577 res := source.GetMetricLabels() 6578 return res, res != nil 6579 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6580 res := source.GetResourceLabels() 6581 return res, res != nil 6582 default: 6583 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6584 } 6585 } 6586 6587 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 6588 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6589 } 6590 6591 // GetDefault returns a default value of the field type 6592 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) GetDefault() interface{} { 6593 switch fp.selector { 6594 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6595 return (map[string]string)(nil) 6596 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6597 return (map[string]string)(nil) 6598 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6599 return (map[string]string)(nil) 6600 default: 6601 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6602 } 6603 } 6604 6605 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) { 6606 if item != nil { 6607 switch fp.selector { 6608 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6609 item.LogLabels = nil 6610 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6611 item.MetricLabels = nil 6612 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6613 item.ResourceLabels = nil 6614 default: 6615 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6616 } 6617 } 6618 } 6619 6620 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) ClearValueRaw(item proto.Message) { 6621 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6622 } 6623 6624 // IsLeaf - whether field path is holds simple value 6625 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) IsLeaf() bool { 6626 return fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels || 6627 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels || 6628 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels 6629 } 6630 6631 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6632 return []gotenobject.FieldPath{fp} 6633 } 6634 6635 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue { 6636 switch fp.selector { 6637 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6638 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp, value: value.(map[string]string)} 6639 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6640 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp, value: value.(map[string]string)} 6641 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6642 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp, value: value.(map[string]string)} 6643 default: 6644 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6645 } 6646 } 6647 6648 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6649 return fp.WithIValue(value) 6650 } 6651 6652 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues { 6653 fpaov := &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp} 6654 switch fp.selector { 6655 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6656 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp, values: values.([]map[string]string)} 6657 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6658 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp, values: values.([]map[string]string)} 6659 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6660 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath: *fp, values: values.([]map[string]string)} 6661 default: 6662 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6663 } 6664 return fpaov 6665 } 6666 6667 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6668 return fp.WithIArrayOfValues(values) 6669 } 6670 6671 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue { 6672 switch fp.selector { 6673 default: 6674 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fp.selector)) 6675 } 6676 } 6677 6678 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6679 return fp.WithIArrayItemValue(value) 6680 } 6681 6682 // FieldPath for map type with additional Key information 6683 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap struct { 6684 key string 6685 selector NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector 6686 } 6687 6688 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap)(nil) 6689 6690 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) Selector() NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelector { 6691 return fpm.selector 6692 } 6693 6694 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) Key() string { 6695 return fpm.key 6696 } 6697 6698 // String returns path representation in proto convention 6699 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) String() string { 6700 return fpm.selector.String() + "." + fpm.key 6701 } 6702 6703 // JSONString returns path representation is JSON convention. Note that map keys are not transformed 6704 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) JSONString() string { 6705 return strcase.ToLowerCamel(fpm.selector.String()) + "." + fpm.key 6706 } 6707 6708 // Get returns all values pointed by selected field map key from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification 6709 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (values []interface{}) { 6710 switch fpm.selector { 6711 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6712 if value, ok := source.GetLogLabels()[fpm.key]; ok { 6713 values = append(values, value) 6714 } 6715 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6716 if value, ok := source.GetMetricLabels()[fpm.key]; ok { 6717 values = append(values, value) 6718 } 6719 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6720 if value, ok := source.GetResourceLabels()[fpm.key]; ok { 6721 values = append(values, value) 6722 } 6723 default: 6724 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6725 } 6726 return 6727 } 6728 6729 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) GetRaw(source proto.Message) []interface{} { 6730 return fpm.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6731 } 6732 6733 // GetSingle returns value by selected field map key from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification 6734 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (interface{}, bool) { 6735 switch fpm.selector { 6736 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6737 res, ok := source.GetLogLabels()[fpm.key] 6738 return res, ok 6739 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6740 res, ok := source.GetMetricLabels()[fpm.key] 6741 return res, ok 6742 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6743 res, ok := source.GetResourceLabels()[fpm.key] 6744 return res, ok 6745 default: 6746 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6747 } 6748 } 6749 6750 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) GetSingleRaw(source proto.Message) (interface{}, bool) { 6751 return fpm.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6752 } 6753 6754 // GetDefault returns a default value of the field type 6755 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) GetDefault() interface{} { 6756 switch fpm.selector { 6757 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6758 var v string 6759 return v 6760 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6761 var v string 6762 return v 6763 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6764 var v string 6765 return v 6766 default: 6767 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6768 } 6769 } 6770 6771 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) { 6772 if item != nil { 6773 switch fpm.selector { 6774 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6775 delete(item.LogLabels, fpm.key) 6776 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6777 delete(item.MetricLabels, fpm.key) 6778 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6779 delete(item.ResourceLabels, fpm.key) 6780 default: 6781 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6782 } 6783 } 6784 } 6785 6786 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) ClearValueRaw(item proto.Message) { 6787 fpm.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6788 } 6789 6790 // IsLeaf - whether field path is holds simple value 6791 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) IsLeaf() bool { 6792 switch fpm.selector { 6793 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6794 return true 6795 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6796 return true 6797 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6798 return true 6799 default: 6800 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6801 } 6802 } 6803 6804 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 6805 return []gotenobject.FieldPath{fpm} 6806 } 6807 6808 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue { 6809 switch fpm.selector { 6810 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6811 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap: *fpm, value: value.(string)} 6812 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6813 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap: *fpm, value: value.(string)} 6814 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6815 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap: *fpm, value: value.(string)} 6816 default: 6817 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6818 } 6819 } 6820 6821 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 6822 return fpm.WithIValue(value) 6823 } 6824 6825 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues { 6826 switch fpm.selector { 6827 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6828 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap: *fpm, values: values.([]string)} 6829 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6830 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap: *fpm, values: values.([]string)} 6831 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6832 return &NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap: *fpm, values: values.([]string)} 6833 default: 6834 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpm.selector)) 6835 } 6836 } 6837 6838 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 6839 return fpm.WithIArrayOfValues(values) 6840 } 6841 6842 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue { 6843 panic("Cannot create array item value from map fieldpath") 6844 } 6845 6846 func (fpm *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 6847 return fpm.WithIArrayItemValue(value) 6848 } 6849 6850 // NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue allows storing values for Identification fields according to their type 6851 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue interface { 6852 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath 6853 gotenobject.FieldPathValue 6854 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 6855 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (cmp int, comparable bool) 6856 } 6857 6858 func ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue, error) { 6859 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(pathStr) 6860 if err != nil { 6861 return nil, err 6862 } 6863 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 6864 if err != nil { 6865 return nil, status.Errorf(codes.InvalidArgument, "error parsing Identification field path value from %s: %v", valueStr, err) 6866 } 6867 return fpv.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue), nil 6868 } 6869 6870 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue { 6871 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue(pathStr, valueStr) 6872 if err != nil { 6873 panic(err) 6874 } 6875 return fpv 6876 } 6877 6878 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue struct { 6879 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath 6880 value interface{} 6881 } 6882 6883 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue)(nil) 6884 6885 // GetRawValue returns raw value stored under selected path for 'Identification' as interface{} 6886 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) GetRawValue() interface{} { 6887 return fpv.value 6888 } 6889 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) AsLogLabelsValue() (map[string]string, bool) { 6890 res, ok := fpv.value.(map[string]string) 6891 return res, ok 6892 } 6893 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) AsMetricLabelsValue() (map[string]string, bool) { 6894 res, ok := fpv.value.(map[string]string) 6895 return res, ok 6896 } 6897 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) AsResourceLabelsValue() (map[string]string, bool) { 6898 res, ok := fpv.value.(map[string]string) 6899 return res, ok 6900 } 6901 6902 // SetTo stores value for selected field for object Identification 6903 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) { 6904 if *target == nil { 6905 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 6906 } 6907 switch fpv.selector { 6908 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6909 (*target).LogLabels = fpv.value.(map[string]string) 6910 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6911 (*target).MetricLabels = fpv.value.(map[string]string) 6912 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6913 (*target).ResourceLabels = fpv.value.(map[string]string) 6914 default: 6915 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpv.selector)) 6916 } 6917 } 6918 6919 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) SetToRaw(target proto.Message) { 6920 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 6921 fpv.SetTo(&typedObject) 6922 } 6923 6924 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification'. 6925 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (int, bool) { 6926 switch fpv.selector { 6927 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6928 return 0, false 6929 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6930 return 0, false 6931 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6932 return 0, false 6933 default: 6934 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpv.selector)) 6935 } 6936 } 6937 6938 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 6939 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 6940 } 6941 6942 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue struct { 6943 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap 6944 value interface{} 6945 } 6946 6947 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue)(nil) 6948 6949 // GetValue returns value stored under selected field in Identification as interface{} 6950 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) GetRawValue() interface{} { 6951 return fpmv.value 6952 } 6953 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) AsLogLabelsElementValue() (string, bool) { 6954 res, ok := fpmv.value.(string) 6955 return res, ok 6956 } 6957 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) AsMetricLabelsElementValue() (string, bool) { 6958 res, ok := fpmv.value.(string) 6959 return res, ok 6960 } 6961 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) AsResourceLabelsElementValue() (string, bool) { 6962 res, ok := fpmv.value.(string) 6963 return res, ok 6964 } 6965 6966 // SetTo stores value for selected field in Identification 6967 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) { 6968 if *target == nil { 6969 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 6970 } 6971 switch fpmv.selector { 6972 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 6973 if (*target).LogLabels == nil { 6974 (*target).LogLabels = make(map[string]string) 6975 } 6976 (*target).LogLabels[fpmv.key] = fpmv.value.(string) 6977 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 6978 if (*target).MetricLabels == nil { 6979 (*target).MetricLabels = make(map[string]string) 6980 } 6981 (*target).MetricLabels[fpmv.key] = fpmv.value.(string) 6982 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 6983 if (*target).ResourceLabels == nil { 6984 (*target).ResourceLabels = make(map[string]string) 6985 } 6986 (*target).ResourceLabels[fpmv.key] = fpmv.value.(string) 6987 default: 6988 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpmv.selector)) 6989 } 6990 } 6991 6992 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) SetToRaw(target proto.Message) { 6993 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) 6994 fpmv.SetTo(&typedObject) 6995 } 6996 6997 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification'. 6998 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (int, bool) { 6999 switch fpmv.selector { 7000 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 7001 leftValue := fpmv.value.(string) 7002 rightValue := source.GetLogLabels()[fpmv.key] 7003 if (leftValue) == (rightValue) { 7004 return 0, true 7005 } else if (leftValue) < (rightValue) { 7006 return -1, true 7007 } else { 7008 return 1, true 7009 } 7010 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 7011 leftValue := fpmv.value.(string) 7012 rightValue := source.GetMetricLabels()[fpmv.key] 7013 if (leftValue) == (rightValue) { 7014 return 0, true 7015 } else if (leftValue) < (rightValue) { 7016 return -1, true 7017 } else { 7018 return 1, true 7019 } 7020 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 7021 leftValue := fpmv.value.(string) 7022 rightValue := source.GetResourceLabels()[fpmv.key] 7023 if (leftValue) == (rightValue) { 7024 return 0, true 7025 } else if (leftValue) < (rightValue) { 7026 return -1, true 7027 } else { 7028 return 1, true 7029 } 7030 default: 7031 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification: %d", fpmv.selector)) 7032 } 7033 } 7034 7035 func (fpmv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapValue) CompareWithRaw(source proto.Message) (int, bool) { 7036 return fpmv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 7037 } 7038 7039 // NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue allows storing single item in Path-specific values for Identification according to their type 7040 // Present only for array (repeated) types. 7041 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue interface { 7042 gotenobject.FieldPathArrayItemValue 7043 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath 7044 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) bool 7045 } 7046 7047 // ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 7048 func ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue, error) { 7049 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(pathStr) 7050 if err != nil { 7051 return nil, err 7052 } 7053 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 7054 if err != nil { 7055 return nil, status.Errorf(codes.InvalidArgument, "error parsing Identification field path array item value from %s: %v", valueStr, err) 7056 } 7057 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue), nil 7058 } 7059 7060 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue { 7061 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue(pathStr, valueStr) 7062 if err != nil { 7063 panic(err) 7064 } 7065 return fpaiv 7066 } 7067 7068 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayItemValue struct { 7069 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath 7070 value interface{} 7071 } 7072 7073 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayItemValue)(nil) 7074 7075 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification as interface{} 7076 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 7077 return fpaiv.value 7078 } 7079 7080 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) (interface{}, bool) { 7081 return nil, false 7082 } 7083 7084 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 7085 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification)) 7086 } 7087 7088 // Contains returns a boolean indicating if value that is being held is present in given 'Identification' 7089 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_Identification) bool { 7090 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath.Get(source) 7091 for _, v := range slice { 7092 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 7093 if proto.Equal(asProtoMsg, v.(proto.Message)) { 7094 return true 7095 } 7096 } else if reflect.DeepEqual(v, fpaiv.value) { 7097 return true 7098 } 7099 } 7100 return false 7101 } 7102 7103 // NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues allows storing slice of values for Identification fields according to their type 7104 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues interface { 7105 gotenobject.FieldPathArrayOfValues 7106 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath 7107 } 7108 7109 func ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues, error) { 7110 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPath(pathStr) 7111 if err != nil { 7112 return nil, err 7113 } 7114 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 7115 if err != nil { 7116 return nil, status.Errorf(codes.InvalidArgument, "error parsing Identification field path array of values from %s: %v", valuesStr, err) 7117 } 7118 return fpaov.(NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues), nil 7119 } 7120 7121 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues { 7122 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues(pathStr, valuesStr) 7123 if err != nil { 7124 panic(err) 7125 } 7126 return fpaov 7127 } 7128 7129 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues struct { 7130 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPath 7131 values interface{} 7132 } 7133 7134 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues)(nil) 7135 7136 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 7137 switch fpaov.selector { 7138 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 7139 for _, v := range fpaov.values.([]map[string]string) { 7140 values = append(values, v) 7141 } 7142 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 7143 for _, v := range fpaov.values.([]map[string]string) { 7144 values = append(values, v) 7145 } 7146 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 7147 for _, v := range fpaov.values.([]map[string]string) { 7148 values = append(values, v) 7149 } 7150 } 7151 return 7152 } 7153 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues) AsLogLabelsArrayOfValues() ([]map[string]string, bool) { 7154 res, ok := fpaov.values.([]map[string]string) 7155 return res, ok 7156 } 7157 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues) AsMetricLabelsArrayOfValues() ([]map[string]string, bool) { 7158 res, ok := fpaov.values.([]map[string]string) 7159 return res, ok 7160 } 7161 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldTerminalPathArrayOfValues) AsResourceLabelsArrayOfValues() ([]map[string]string, bool) { 7162 res, ok := fpaov.values.([]map[string]string) 7163 return res, ok 7164 } 7165 7166 type NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues struct { 7167 NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMap 7168 values interface{} 7169 } 7170 7171 var _ NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues)(nil) 7172 7173 func (fpmaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues) GetRawValues() (values []interface{}) { 7174 switch fpmaov.selector { 7175 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorLogLabels: 7176 for _, v := range fpmaov.values.([]string) { 7177 values = append(values, v) 7178 } 7179 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorMetricLabels: 7180 for _, v := range fpmaov.values.([]string) { 7181 values = append(values, v) 7182 } 7183 case NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathSelectorResourceLabels: 7184 for _, v := range fpmaov.values.([]string) { 7185 values = append(values, v) 7186 } 7187 } 7188 return 7189 } 7190 func (fpmaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues) AsLogLabelsArrayOfElementValues() ([]string, bool) { 7191 res, ok := fpmaov.values.([]string) 7192 return res, ok 7193 } 7194 func (fpmaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues) AsMetricLabelsArrayOfElementValues() ([]string, bool) { 7195 res, ok := fpmaov.values.([]string) 7196 return res, ok 7197 } 7198 func (fpmaov *NotificationMsgAlertsGroupConditionAlertsAlertIdentification_FieldPathMapArrayOfValues) AsResourceLabelsArrayOfElementValues() ([]string, bool) { 7199 res, ok := fpmaov.values.([]string) 7200 return res, ok 7201 } 7202 7203 // FieldPath provides implementation to handle 7204 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 7205 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath interface { 7206 gotenobject.FieldPath 7207 Selector() NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector 7208 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) []interface{} 7209 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (interface{}, bool) 7210 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 7211 7212 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue 7213 // (or array of values) and holds passed value. Panics if injected type is incorrect. 7214 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue 7215 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues 7216 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue 7217 } 7218 7219 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector int32 7220 7221 const ( 7222 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector = 0 7223 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector = 1 7224 ) 7225 7226 func (s NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector) String() string { 7227 switch s { 7228 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7229 return "log_value" 7230 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7231 return "time_series" 7232 default: 7233 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", s)) 7234 } 7235 } 7236 7237 func BuildNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath, error) { 7238 if len(fp) == 0 { 7239 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo") 7240 } 7241 if len(fp) == 1 { 7242 switch fp[0] { 7243 case "log_value", "logValue", "log-value": 7244 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue}, nil 7245 case "time_series", "timeSeries", "time-series": 7246 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries}, nil 7247 } 7248 } else { 7249 switch fp[0] { 7250 case "time_series", "timeSeries", "time-series": 7251 if subpath, err := BuildNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(fp[1:]); err != nil { 7252 return nil, err 7253 } else { 7254 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries, subPath: subpath}, nil 7255 } 7256 } 7257 } 7258 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo", fp) 7259 } 7260 7261 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath, error) { 7262 fp, err := gotenobject.ParseRawFieldPath(rawField) 7263 if err != nil { 7264 return nil, err 7265 } 7266 return BuildNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(fp) 7267 } 7268 7269 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath { 7270 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(rawField) 7271 if err != nil { 7272 panic(err) 7273 } 7274 return fp 7275 } 7276 7277 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath struct { 7278 selector NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector 7279 } 7280 7281 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath)(nil) 7282 7283 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector { 7284 return fp.selector 7285 } 7286 7287 // String returns path representation in proto convention 7288 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) String() string { 7289 return fp.selector.String() 7290 } 7291 7292 // JSONString returns path representation is JSON convention 7293 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) JSONString() string { 7294 return strcase.ToLowerCamel(fp.String()) 7295 } 7296 7297 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo 7298 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (values []interface{}) { 7299 if source != nil { 7300 switch fp.selector { 7301 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7302 values = append(values, source.LogValue) 7303 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7304 for _, value := range source.GetTimeSeries() { 7305 values = append(values, value) 7306 } 7307 default: 7308 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7309 } 7310 } 7311 return 7312 } 7313 7314 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 7315 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7316 } 7317 7318 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo 7319 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (interface{}, bool) { 7320 switch fp.selector { 7321 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7322 return source.GetLogValue(), source != nil 7323 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7324 res := source.GetTimeSeries() 7325 return res, res != nil 7326 default: 7327 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7328 } 7329 } 7330 7331 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7332 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7333 } 7334 7335 // GetDefault returns a default value of the field type 7336 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) GetDefault() interface{} { 7337 switch fp.selector { 7338 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7339 return "" 7340 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7341 return ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)(nil) 7342 default: 7343 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7344 } 7345 } 7346 7347 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) { 7348 if item != nil { 7349 switch fp.selector { 7350 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7351 item.LogValue = "" 7352 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7353 item.TimeSeries = nil 7354 default: 7355 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7356 } 7357 } 7358 } 7359 7360 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) ClearValueRaw(item proto.Message) { 7361 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7362 } 7363 7364 // IsLeaf - whether field path is holds simple value 7365 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) IsLeaf() bool { 7366 return fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue 7367 } 7368 7369 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 7370 return []gotenobject.FieldPath{fp} 7371 } 7372 7373 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue { 7374 switch fp.selector { 7375 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7376 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath: *fp, value: value.(string)} 7377 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7378 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath: *fp, value: value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)} 7379 default: 7380 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7381 } 7382 } 7383 7384 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 7385 return fp.WithIValue(value) 7386 } 7387 7388 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues { 7389 fpaov := &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath: *fp} 7390 switch fp.selector { 7391 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7392 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath: *fp, values: values.([]string)} 7393 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7394 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath: *fp, values: values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)} 7395 default: 7396 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7397 } 7398 return fpaov 7399 } 7400 7401 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 7402 return fp.WithIArrayOfValues(values) 7403 } 7404 7405 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue { 7406 switch fp.selector { 7407 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7408 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath: *fp, value: value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)} 7409 default: 7410 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fp.selector)) 7411 } 7412 } 7413 7414 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 7415 return fp.WithIArrayItemValue(value) 7416 } 7417 7418 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath struct { 7419 selector NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector 7420 subPath gotenobject.FieldPath 7421 } 7422 7423 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath)(nil) 7424 7425 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelector { 7426 return fps.selector 7427 } 7428 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) AsTimeSeriesSubPath() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath, bool) { 7429 res, ok := fps.subPath.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath) 7430 return res, ok 7431 } 7432 7433 // String returns path representation in proto convention 7434 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) String() string { 7435 return fps.selector.String() + "." + fps.subPath.String() 7436 } 7437 7438 // JSONString returns path representation is JSON convention 7439 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) JSONString() string { 7440 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 7441 } 7442 7443 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo 7444 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (values []interface{}) { 7445 switch fps.selector { 7446 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7447 for _, item := range source.GetTimeSeries() { 7448 values = append(values, fps.subPath.GetRaw(item)...) 7449 } 7450 default: 7451 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fps.selector)) 7452 } 7453 return 7454 } 7455 7456 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) GetRaw(source proto.Message) []interface{} { 7457 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7458 } 7459 7460 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo 7461 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (interface{}, bool) { 7462 switch fps.selector { 7463 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7464 if len(source.GetTimeSeries()) == 0 { 7465 return nil, false 7466 } 7467 return fps.subPath.GetSingleRaw(source.GetTimeSeries()[0]) 7468 default: 7469 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fps.selector)) 7470 } 7471 } 7472 7473 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7474 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7475 } 7476 7477 // GetDefault returns a default value of the field type 7478 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) GetDefault() interface{} { 7479 return fps.subPath.GetDefault() 7480 } 7481 7482 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) { 7483 if item != nil { 7484 switch fps.selector { 7485 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7486 for _, subItem := range item.TimeSeries { 7487 fps.subPath.ClearValueRaw(subItem) 7488 } 7489 default: 7490 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fps.selector)) 7491 } 7492 } 7493 } 7494 7495 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) ClearValueRaw(item proto.Message) { 7496 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7497 } 7498 7499 // IsLeaf - whether field path is holds simple value 7500 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) IsLeaf() bool { 7501 return fps.subPath.IsLeaf() 7502 } 7503 7504 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 7505 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath{selector: fps.selector}} 7506 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 7507 return iPaths 7508 } 7509 7510 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue { 7511 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 7512 } 7513 7514 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 7515 return fps.WithIValue(value) 7516 } 7517 7518 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues { 7519 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 7520 } 7521 7522 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 7523 return fps.WithIArrayOfValues(values) 7524 } 7525 7526 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue { 7527 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 7528 } 7529 7530 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 7531 return fps.WithIArrayItemValue(value) 7532 } 7533 7534 // NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue allows storing values for ViolationInfo fields according to their type 7535 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue interface { 7536 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath 7537 gotenobject.FieldPathValue 7538 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 7539 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (cmp int, comparable bool) 7540 } 7541 7542 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue, error) { 7543 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(pathStr) 7544 if err != nil { 7545 return nil, err 7546 } 7547 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 7548 if err != nil { 7549 return nil, status.Errorf(codes.InvalidArgument, "error parsing ViolationInfo field path value from %s: %v", valueStr, err) 7550 } 7551 return fpv.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue), nil 7552 } 7553 7554 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue { 7555 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue(pathStr, valueStr) 7556 if err != nil { 7557 panic(err) 7558 } 7559 return fpv 7560 } 7561 7562 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue struct { 7563 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath 7564 value interface{} 7565 } 7566 7567 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue)(nil) 7568 7569 // GetRawValue returns raw value stored under selected path for 'ViolationInfo' as interface{} 7570 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) GetRawValue() interface{} { 7571 return fpv.value 7572 } 7573 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) AsLogValueValue() (string, bool) { 7574 res, ok := fpv.value.(string) 7575 return res, ok 7576 } 7577 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) AsTimeSeriesValue() ([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries, bool) { 7578 res, ok := fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 7579 return res, ok 7580 } 7581 7582 // SetTo stores value for selected field for object ViolationInfo 7583 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) { 7584 if *target == nil { 7585 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 7586 } 7587 switch fpv.selector { 7588 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7589 (*target).LogValue = fpv.value.(string) 7590 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7591 (*target).TimeSeries = fpv.value.([]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 7592 default: 7593 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fpv.selector)) 7594 } 7595 } 7596 7597 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) SetToRaw(target proto.Message) { 7598 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 7599 fpv.SetTo(&typedObject) 7600 } 7601 7602 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo'. 7603 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (int, bool) { 7604 switch fpv.selector { 7605 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7606 leftValue := fpv.value.(string) 7607 rightValue := source.GetLogValue() 7608 if (leftValue) == (rightValue) { 7609 return 0, true 7610 } else if (leftValue) < (rightValue) { 7611 return -1, true 7612 } else { 7613 return 1, true 7614 } 7615 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7616 return 0, false 7617 default: 7618 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fpv.selector)) 7619 } 7620 } 7621 7622 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 7623 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7624 } 7625 7626 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue struct { 7627 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath 7628 subPathValue gotenobject.FieldPathValue 7629 } 7630 7631 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue)(nil) 7632 7633 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue) AsTimeSeriesPathValue() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue, bool) { 7634 res, ok := fpvs.subPathValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue) 7635 return res, ok 7636 } 7637 7638 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) { 7639 if *target == nil { 7640 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 7641 } 7642 switch fpvs.Selector() { 7643 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7644 panic("FieldPath setter is unsupported for array subpaths") 7645 default: 7646 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fpvs.Selector())) 7647 } 7648 } 7649 7650 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue) SetToRaw(target proto.Message) { 7651 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) 7652 fpvs.SetTo(&typedObject) 7653 } 7654 7655 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue) GetRawValue() interface{} { 7656 return fpvs.subPathValue.GetRawValue() 7657 } 7658 7659 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (int, bool) { 7660 switch fpvs.Selector() { 7661 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7662 return 0, false // repeated field 7663 default: 7664 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fpvs.Selector())) 7665 } 7666 } 7667 7668 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 7669 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7670 } 7671 7672 // NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue allows storing single item in Path-specific values for ViolationInfo according to their type 7673 // Present only for array (repeated) types. 7674 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue interface { 7675 gotenobject.FieldPathArrayItemValue 7676 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath 7677 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) bool 7678 } 7679 7680 // ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 7681 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue, error) { 7682 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(pathStr) 7683 if err != nil { 7684 return nil, err 7685 } 7686 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 7687 if err != nil { 7688 return nil, status.Errorf(codes.InvalidArgument, "error parsing ViolationInfo field path array item value from %s: %v", valueStr, err) 7689 } 7690 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue), nil 7691 } 7692 7693 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue { 7694 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue(pathStr, valueStr) 7695 if err != nil { 7696 panic(err) 7697 } 7698 return fpaiv 7699 } 7700 7701 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue struct { 7702 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath 7703 value interface{} 7704 } 7705 7706 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue)(nil) 7707 7708 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo as interface{} 7709 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 7710 return fpaiv.value 7711 } 7712 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue) AsTimeSeriesItemValue() (*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries, bool) { 7713 res, ok := fpaiv.value.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 7714 return res, ok 7715 } 7716 7717 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) (interface{}, bool) { 7718 return nil, false 7719 } 7720 7721 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 7722 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo)) 7723 } 7724 7725 // Contains returns a boolean indicating if value that is being held is present in given 'ViolationInfo' 7726 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) bool { 7727 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath.Get(source) 7728 for _, v := range slice { 7729 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 7730 if proto.Equal(asProtoMsg, v.(proto.Message)) { 7731 return true 7732 } 7733 } else if reflect.DeepEqual(v, fpaiv.value) { 7734 return true 7735 } 7736 } 7737 return false 7738 } 7739 7740 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayItemValue struct { 7741 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath 7742 subPathItemValue gotenobject.FieldPathArrayItemValue 7743 } 7744 7745 // GetRawValue returns stored array item value 7746 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 7747 return fpaivs.subPathItemValue.GetRawItemValue() 7748 } 7749 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayItemValue) AsTimeSeriesPathItemValue() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue, bool) { 7750 res, ok := fpaivs.subPathItemValue.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue) 7751 return res, ok 7752 } 7753 7754 // Contains returns a boolean indicating if value that is being held is present in given 'ViolationInfo' 7755 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo) bool { 7756 switch fpaivs.Selector() { 7757 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7758 return false // repeated/map field 7759 default: 7760 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo: %d", fpaivs.Selector())) 7761 } 7762 } 7763 7764 // NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues allows storing slice of values for ViolationInfo fields according to their type 7765 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues interface { 7766 gotenobject.FieldPathArrayOfValues 7767 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath 7768 } 7769 7770 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues, error) { 7771 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath(pathStr) 7772 if err != nil { 7773 return nil, err 7774 } 7775 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 7776 if err != nil { 7777 return nil, status.Errorf(codes.InvalidArgument, "error parsing ViolationInfo field path array of values from %s: %v", valuesStr, err) 7778 } 7779 return fpaov.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues), nil 7780 } 7781 7782 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues { 7783 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues(pathStr, valuesStr) 7784 if err != nil { 7785 panic(err) 7786 } 7787 return fpaov 7788 } 7789 7790 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues struct { 7791 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPath 7792 values interface{} 7793 } 7794 7795 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues)(nil) 7796 7797 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 7798 switch fpaov.selector { 7799 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorLogValue: 7800 for _, v := range fpaov.values.([]string) { 7801 values = append(values, v) 7802 } 7803 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathSelectorTimeSeries: 7804 for _, v := range fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) { 7805 values = append(values, v) 7806 } 7807 } 7808 return 7809 } 7810 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues) AsLogValueArrayOfValues() ([]string, bool) { 7811 res, ok := fpaov.values.([]string) 7812 return res, ok 7813 } 7814 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldTerminalPathArrayOfValues) AsTimeSeriesArrayOfValues() ([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries, bool) { 7815 res, ok := fpaov.values.([][]*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 7816 return res, ok 7817 } 7818 7819 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayOfValues struct { 7820 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPath 7821 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 7822 } 7823 7824 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayOfValues)(nil) 7825 7826 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 7827 return fpsaov.subPathArrayOfValues.GetRawValues() 7828 } 7829 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfo_FieldSubPathArrayOfValues) AsTimeSeriesPathArrayOfValues() (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues, bool) { 7830 res, ok := fpsaov.subPathArrayOfValues.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues) 7831 return res, ok 7832 } 7833 7834 // FieldPath provides implementation to handle 7835 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 7836 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath interface { 7837 gotenobject.FieldPath 7838 Selector() NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector 7839 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) []interface{} 7840 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (interface{}, bool) 7841 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 7842 7843 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue 7844 // (or array of values) and holds passed value. Panics if injected type is incorrect. 7845 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue 7846 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues 7847 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue 7848 } 7849 7850 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector int32 7851 7852 const ( 7853 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector = 0 7854 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector = 1 7855 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector = 2 7856 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector = 3 7857 ) 7858 7859 func (s NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector) String() string { 7860 switch s { 7861 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 7862 return "current_state" 7863 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 7864 return "troubleshooting_notes" 7865 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 7866 return "ai_remediation" 7867 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 7868 return "remediation_arg" 7869 default: 7870 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", s)) 7871 } 7872 } 7873 7874 func BuildNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath, error) { 7875 if len(fp) == 0 { 7876 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling") 7877 } 7878 if len(fp) == 1 { 7879 switch fp[0] { 7880 case "current_state", "currentState", "current-state": 7881 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState}, nil 7882 case "troubleshooting_notes", "troubleshootingNotes", "troubleshooting-notes": 7883 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes}, nil 7884 case "ai_remediation", "aiRemediation", "ai-remediation": 7885 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation}, nil 7886 case "remediation_arg", "remediationArg", "remediation-arg": 7887 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg}, nil 7888 } 7889 } else { 7890 switch fp[0] { 7891 case "ai_remediation", "aiRemediation", "ai-remediation": 7892 if subpath, err := rcommon.BuildPolicySpecAIAgentHandlingRemediation_FieldPath(fp[1:]); err != nil { 7893 return nil, err 7894 } else { 7895 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation, subPath: subpath}, nil 7896 } 7897 } 7898 } 7899 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling", fp) 7900 } 7901 7902 func ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath, error) { 7903 fp, err := gotenobject.ParseRawFieldPath(rawField) 7904 if err != nil { 7905 return nil, err 7906 } 7907 return BuildNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(fp) 7908 } 7909 7910 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath { 7911 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(rawField) 7912 if err != nil { 7913 panic(err) 7914 } 7915 return fp 7916 } 7917 7918 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath struct { 7919 selector NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector 7920 } 7921 7922 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath)(nil) 7923 7924 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector { 7925 return fp.selector 7926 } 7927 7928 // String returns path representation in proto convention 7929 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) String() string { 7930 return fp.selector.String() 7931 } 7932 7933 // JSONString returns path representation is JSON convention 7934 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) JSONString() string { 7935 return strcase.ToLowerCamel(fp.String()) 7936 } 7937 7938 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling 7939 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (values []interface{}) { 7940 if source != nil { 7941 switch fp.selector { 7942 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 7943 values = append(values, source.CurrentState) 7944 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 7945 values = append(values, source.TroubleshootingNotes) 7946 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 7947 if source.AiRemediation != nil { 7948 values = append(values, source.AiRemediation) 7949 } 7950 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 7951 values = append(values, source.RemediationArg) 7952 default: 7953 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 7954 } 7955 } 7956 return 7957 } 7958 7959 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 7960 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 7961 } 7962 7963 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling 7964 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (interface{}, bool) { 7965 switch fp.selector { 7966 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 7967 return source.GetCurrentState(), source != nil 7968 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 7969 return source.GetTroubleshootingNotes(), source != nil 7970 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 7971 res := source.GetAiRemediation() 7972 return res, res != nil 7973 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 7974 return source.GetRemediationArg(), source != nil 7975 default: 7976 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 7977 } 7978 } 7979 7980 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 7981 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 7982 } 7983 7984 // GetDefault returns a default value of the field type 7985 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) GetDefault() interface{} { 7986 switch fp.selector { 7987 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 7988 return alert.Alert_State_AI_AGENT_NOT_INVOLVED 7989 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 7990 return "" 7991 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 7992 return (*rcommon.PolicySpec_AIAgentHandling_Remediation)(nil) 7993 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 7994 return "" 7995 default: 7996 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 7997 } 7998 } 7999 8000 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) { 8001 if item != nil { 8002 switch fp.selector { 8003 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 8004 item.CurrentState = alert.Alert_State_AI_AGENT_NOT_INVOLVED 8005 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 8006 item.TroubleshootingNotes = "" 8007 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8008 item.AiRemediation = nil 8009 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 8010 item.RemediationArg = "" 8011 default: 8012 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 8013 } 8014 } 8015 } 8016 8017 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) ClearValueRaw(item proto.Message) { 8018 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8019 } 8020 8021 // IsLeaf - whether field path is holds simple value 8022 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) IsLeaf() bool { 8023 return fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState || 8024 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes || 8025 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg 8026 } 8027 8028 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 8029 return []gotenobject.FieldPath{fp} 8030 } 8031 8032 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue { 8033 switch fp.selector { 8034 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 8035 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, value: value.(alert.Alert_State_AiHandlingState)} 8036 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 8037 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, value: value.(string)} 8038 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8039 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, value: value.(*rcommon.PolicySpec_AIAgentHandling_Remediation)} 8040 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 8041 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, value: value.(string)} 8042 default: 8043 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 8044 } 8045 } 8046 8047 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 8048 return fp.WithIValue(value) 8049 } 8050 8051 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues { 8052 fpaov := &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp} 8053 switch fp.selector { 8054 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 8055 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, values: values.([]alert.Alert_State_AiHandlingState)} 8056 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 8057 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, values: values.([]string)} 8058 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8059 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, values: values.([]*rcommon.PolicySpec_AIAgentHandling_Remediation)} 8060 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 8061 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath: *fp, values: values.([]string)} 8062 default: 8063 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 8064 } 8065 return fpaov 8066 } 8067 8068 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 8069 return fp.WithIArrayOfValues(values) 8070 } 8071 8072 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue { 8073 switch fp.selector { 8074 default: 8075 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fp.selector)) 8076 } 8077 } 8078 8079 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 8080 return fp.WithIArrayItemValue(value) 8081 } 8082 8083 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath struct { 8084 selector NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector 8085 subPath gotenobject.FieldPath 8086 } 8087 8088 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath)(nil) 8089 8090 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelector { 8091 return fps.selector 8092 } 8093 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) AsAiRemediationSubPath() (rcommon.PolicySpecAIAgentHandlingRemediation_FieldPath, bool) { 8094 res, ok := fps.subPath.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPath) 8095 return res, ok 8096 } 8097 8098 // String returns path representation in proto convention 8099 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) String() string { 8100 return fps.selector.String() + "." + fps.subPath.String() 8101 } 8102 8103 // JSONString returns path representation is JSON convention 8104 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) JSONString() string { 8105 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 8106 } 8107 8108 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling 8109 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (values []interface{}) { 8110 switch fps.selector { 8111 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8112 values = append(values, fps.subPath.GetRaw(source.GetAiRemediation())...) 8113 default: 8114 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fps.selector)) 8115 } 8116 return 8117 } 8118 8119 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) GetRaw(source proto.Message) []interface{} { 8120 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8121 } 8122 8123 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling 8124 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (interface{}, bool) { 8125 switch fps.selector { 8126 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8127 if source.GetAiRemediation() == nil { 8128 return nil, false 8129 } 8130 return fps.subPath.GetSingleRaw(source.GetAiRemediation()) 8131 default: 8132 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fps.selector)) 8133 } 8134 } 8135 8136 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 8137 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8138 } 8139 8140 // GetDefault returns a default value of the field type 8141 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) GetDefault() interface{} { 8142 return fps.subPath.GetDefault() 8143 } 8144 8145 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) { 8146 if item != nil { 8147 switch fps.selector { 8148 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8149 fps.subPath.ClearValueRaw(item.AiRemediation) 8150 default: 8151 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fps.selector)) 8152 } 8153 } 8154 } 8155 8156 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) ClearValueRaw(item proto.Message) { 8157 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8158 } 8159 8160 // IsLeaf - whether field path is holds simple value 8161 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) IsLeaf() bool { 8162 return fps.subPath.IsLeaf() 8163 } 8164 8165 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 8166 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath{selector: fps.selector}} 8167 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 8168 return iPaths 8169 } 8170 8171 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue { 8172 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 8173 } 8174 8175 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 8176 return fps.WithIValue(value) 8177 } 8178 8179 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues { 8180 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 8181 } 8182 8183 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 8184 return fps.WithIArrayOfValues(values) 8185 } 8186 8187 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue { 8188 return &NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 8189 } 8190 8191 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 8192 return fps.WithIArrayItemValue(value) 8193 } 8194 8195 // NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue allows storing values for AiHandling fields according to their type 8196 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue interface { 8197 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath 8198 gotenobject.FieldPathValue 8199 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 8200 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (cmp int, comparable bool) 8201 } 8202 8203 func ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue, error) { 8204 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(pathStr) 8205 if err != nil { 8206 return nil, err 8207 } 8208 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 8209 if err != nil { 8210 return nil, status.Errorf(codes.InvalidArgument, "error parsing AiHandling field path value from %s: %v", valueStr, err) 8211 } 8212 return fpv.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue), nil 8213 } 8214 8215 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue { 8216 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue(pathStr, valueStr) 8217 if err != nil { 8218 panic(err) 8219 } 8220 return fpv 8221 } 8222 8223 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue struct { 8224 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath 8225 value interface{} 8226 } 8227 8228 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue)(nil) 8229 8230 // GetRawValue returns raw value stored under selected path for 'AiHandling' as interface{} 8231 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) GetRawValue() interface{} { 8232 return fpv.value 8233 } 8234 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) AsCurrentStateValue() (alert.Alert_State_AiHandlingState, bool) { 8235 res, ok := fpv.value.(alert.Alert_State_AiHandlingState) 8236 return res, ok 8237 } 8238 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) AsTroubleshootingNotesValue() (string, bool) { 8239 res, ok := fpv.value.(string) 8240 return res, ok 8241 } 8242 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) AsAiRemediationValue() (*rcommon.PolicySpec_AIAgentHandling_Remediation, bool) { 8243 res, ok := fpv.value.(*rcommon.PolicySpec_AIAgentHandling_Remediation) 8244 return res, ok 8245 } 8246 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) AsRemediationArgValue() (string, bool) { 8247 res, ok := fpv.value.(string) 8248 return res, ok 8249 } 8250 8251 // SetTo stores value for selected field for object AiHandling 8252 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) { 8253 if *target == nil { 8254 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 8255 } 8256 switch fpv.selector { 8257 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 8258 (*target).CurrentState = fpv.value.(alert.Alert_State_AiHandlingState) 8259 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 8260 (*target).TroubleshootingNotes = fpv.value.(string) 8261 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8262 (*target).AiRemediation = fpv.value.(*rcommon.PolicySpec_AIAgentHandling_Remediation) 8263 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 8264 (*target).RemediationArg = fpv.value.(string) 8265 default: 8266 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fpv.selector)) 8267 } 8268 } 8269 8270 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) SetToRaw(target proto.Message) { 8271 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 8272 fpv.SetTo(&typedObject) 8273 } 8274 8275 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling'. 8276 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (int, bool) { 8277 switch fpv.selector { 8278 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 8279 leftValue := fpv.value.(alert.Alert_State_AiHandlingState) 8280 rightValue := source.GetCurrentState() 8281 if (leftValue) == (rightValue) { 8282 return 0, true 8283 } else if (leftValue) < (rightValue) { 8284 return -1, true 8285 } else { 8286 return 1, true 8287 } 8288 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 8289 leftValue := fpv.value.(string) 8290 rightValue := source.GetTroubleshootingNotes() 8291 if (leftValue) == (rightValue) { 8292 return 0, true 8293 } else if (leftValue) < (rightValue) { 8294 return -1, true 8295 } else { 8296 return 1, true 8297 } 8298 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8299 return 0, false 8300 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 8301 leftValue := fpv.value.(string) 8302 rightValue := source.GetRemediationArg() 8303 if (leftValue) == (rightValue) { 8304 return 0, true 8305 } else if (leftValue) < (rightValue) { 8306 return -1, true 8307 } else { 8308 return 1, true 8309 } 8310 default: 8311 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fpv.selector)) 8312 } 8313 } 8314 8315 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 8316 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8317 } 8318 8319 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue struct { 8320 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath 8321 subPathValue gotenobject.FieldPathValue 8322 } 8323 8324 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue)(nil) 8325 8326 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue) AsAiRemediationPathValue() (rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathValue, bool) { 8327 res, ok := fpvs.subPathValue.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathValue) 8328 return res, ok 8329 } 8330 8331 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) { 8332 if *target == nil { 8333 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 8334 } 8335 switch fpvs.Selector() { 8336 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8337 fpvs.subPathValue.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathValue).SetTo(&(*target).AiRemediation) 8338 default: 8339 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fpvs.Selector())) 8340 } 8341 } 8342 8343 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue) SetToRaw(target proto.Message) { 8344 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) 8345 fpvs.SetTo(&typedObject) 8346 } 8347 8348 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue) GetRawValue() interface{} { 8349 return fpvs.subPathValue.GetRawValue() 8350 } 8351 8352 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (int, bool) { 8353 switch fpvs.Selector() { 8354 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8355 return fpvs.subPathValue.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathValue).CompareWith(source.GetAiRemediation()) 8356 default: 8357 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fpvs.Selector())) 8358 } 8359 } 8360 8361 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 8362 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8363 } 8364 8365 // NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue allows storing single item in Path-specific values for AiHandling according to their type 8366 // Present only for array (repeated) types. 8367 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue interface { 8368 gotenobject.FieldPathArrayItemValue 8369 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath 8370 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) bool 8371 } 8372 8373 // ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 8374 func ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue, error) { 8375 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(pathStr) 8376 if err != nil { 8377 return nil, err 8378 } 8379 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 8380 if err != nil { 8381 return nil, status.Errorf(codes.InvalidArgument, "error parsing AiHandling field path array item value from %s: %v", valueStr, err) 8382 } 8383 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue), nil 8384 } 8385 8386 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue { 8387 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue(pathStr, valueStr) 8388 if err != nil { 8389 panic(err) 8390 } 8391 return fpaiv 8392 } 8393 8394 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayItemValue struct { 8395 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath 8396 value interface{} 8397 } 8398 8399 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayItemValue)(nil) 8400 8401 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling as interface{} 8402 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 8403 return fpaiv.value 8404 } 8405 8406 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) (interface{}, bool) { 8407 return nil, false 8408 } 8409 8410 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 8411 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling)) 8412 } 8413 8414 // Contains returns a boolean indicating if value that is being held is present in given 'AiHandling' 8415 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) bool { 8416 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath.Get(source) 8417 for _, v := range slice { 8418 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 8419 if proto.Equal(asProtoMsg, v.(proto.Message)) { 8420 return true 8421 } 8422 } else if reflect.DeepEqual(v, fpaiv.value) { 8423 return true 8424 } 8425 } 8426 return false 8427 } 8428 8429 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayItemValue struct { 8430 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath 8431 subPathItemValue gotenobject.FieldPathArrayItemValue 8432 } 8433 8434 // GetRawValue returns stored array item value 8435 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 8436 return fpaivs.subPathItemValue.GetRawItemValue() 8437 } 8438 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayItemValue) AsAiRemediationPathItemValue() (rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathArrayItemValue, bool) { 8439 res, ok := fpaivs.subPathItemValue.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathArrayItemValue) 8440 return res, ok 8441 } 8442 8443 // Contains returns a boolean indicating if value that is being held is present in given 'AiHandling' 8444 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling) bool { 8445 switch fpaivs.Selector() { 8446 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8447 return fpaivs.subPathItemValue.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathArrayItemValue).ContainsValue(source.GetAiRemediation()) 8448 default: 8449 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_AiHandling: %d", fpaivs.Selector())) 8450 } 8451 } 8452 8453 // NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues allows storing slice of values for AiHandling fields according to their type 8454 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues interface { 8455 gotenobject.FieldPathArrayOfValues 8456 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath 8457 } 8458 8459 func ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues, error) { 8460 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath(pathStr) 8461 if err != nil { 8462 return nil, err 8463 } 8464 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 8465 if err != nil { 8466 return nil, status.Errorf(codes.InvalidArgument, "error parsing AiHandling field path array of values from %s: %v", valuesStr, err) 8467 } 8468 return fpaov.(NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues), nil 8469 } 8470 8471 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues { 8472 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues(pathStr, valuesStr) 8473 if err != nil { 8474 panic(err) 8475 } 8476 return fpaov 8477 } 8478 8479 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues struct { 8480 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPath 8481 values interface{} 8482 } 8483 8484 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues)(nil) 8485 8486 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 8487 switch fpaov.selector { 8488 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorCurrentState: 8489 for _, v := range fpaov.values.([]alert.Alert_State_AiHandlingState) { 8490 values = append(values, v) 8491 } 8492 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorTroubleshootingNotes: 8493 for _, v := range fpaov.values.([]string) { 8494 values = append(values, v) 8495 } 8496 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorAiRemediation: 8497 for _, v := range fpaov.values.([]*rcommon.PolicySpec_AIAgentHandling_Remediation) { 8498 values = append(values, v) 8499 } 8500 case NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathSelectorRemediationArg: 8501 for _, v := range fpaov.values.([]string) { 8502 values = append(values, v) 8503 } 8504 } 8505 return 8506 } 8507 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues) AsCurrentStateArrayOfValues() ([]alert.Alert_State_AiHandlingState, bool) { 8508 res, ok := fpaov.values.([]alert.Alert_State_AiHandlingState) 8509 return res, ok 8510 } 8511 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues) AsTroubleshootingNotesArrayOfValues() ([]string, bool) { 8512 res, ok := fpaov.values.([]string) 8513 return res, ok 8514 } 8515 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues) AsAiRemediationArrayOfValues() ([]*rcommon.PolicySpec_AIAgentHandling_Remediation, bool) { 8516 res, ok := fpaov.values.([]*rcommon.PolicySpec_AIAgentHandling_Remediation) 8517 return res, ok 8518 } 8519 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldTerminalPathArrayOfValues) AsRemediationArgArrayOfValues() ([]string, bool) { 8520 res, ok := fpaov.values.([]string) 8521 return res, ok 8522 } 8523 8524 type NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayOfValues struct { 8525 NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPath 8526 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 8527 } 8528 8529 var _ NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayOfValues)(nil) 8530 8531 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 8532 return fpsaov.subPathArrayOfValues.GetRawValues() 8533 } 8534 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertAiHandling_FieldSubPathArrayOfValues) AsAiRemediationPathArrayOfValues() (rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathArrayOfValues, bool) { 8535 res, ok := fpsaov.subPathArrayOfValues.(rcommon.PolicySpecAIAgentHandlingRemediation_FieldPathArrayOfValues) 8536 return res, ok 8537 } 8538 8539 // FieldPath provides implementation to handle 8540 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 8541 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath interface { 8542 gotenobject.FieldPath 8543 Selector() NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector 8544 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) []interface{} 8545 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) (interface{}, bool) 8546 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 8547 8548 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue 8549 // (or array of values) and holds passed value. Panics if injected type is incorrect. 8550 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue 8551 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues 8552 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue 8553 } 8554 8555 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector int32 8556 8557 const ( 8558 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector = 0 8559 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector = 1 8560 ) 8561 8562 func (s NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector) String() string { 8563 switch s { 8564 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8565 return "current_state" 8566 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8567 return "notes" 8568 default: 8569 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", s)) 8570 } 8571 } 8572 8573 func BuildNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath, error) { 8574 if len(fp) == 0 { 8575 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling") 8576 } 8577 if len(fp) == 1 { 8578 switch fp[0] { 8579 case "current_state", "currentState", "current-state": 8580 return &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState}, nil 8581 case "notes": 8582 return &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes}, nil 8583 } 8584 } 8585 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling", fp) 8586 } 8587 8588 func ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath, error) { 8589 fp, err := gotenobject.ParseRawFieldPath(rawField) 8590 if err != nil { 8591 return nil, err 8592 } 8593 return BuildNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(fp) 8594 } 8595 8596 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath { 8597 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(rawField) 8598 if err != nil { 8599 panic(err) 8600 } 8601 return fp 8602 } 8603 8604 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath struct { 8605 selector NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector 8606 } 8607 8608 var _ NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath)(nil) 8609 8610 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelector { 8611 return fp.selector 8612 } 8613 8614 // String returns path representation in proto convention 8615 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) String() string { 8616 return fp.selector.String() 8617 } 8618 8619 // JSONString returns path representation is JSON convention 8620 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) JSONString() string { 8621 return strcase.ToLowerCamel(fp.String()) 8622 } 8623 8624 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling 8625 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) (values []interface{}) { 8626 if source != nil { 8627 switch fp.selector { 8628 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8629 values = append(values, source.CurrentState) 8630 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8631 values = append(values, source.Notes) 8632 default: 8633 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8634 } 8635 } 8636 return 8637 } 8638 8639 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 8640 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)) 8641 } 8642 8643 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling 8644 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) (interface{}, bool) { 8645 switch fp.selector { 8646 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8647 return source.GetCurrentState(), source != nil 8648 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8649 return source.GetNotes(), source != nil 8650 default: 8651 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8652 } 8653 } 8654 8655 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 8656 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)) 8657 } 8658 8659 // GetDefault returns a default value of the field type 8660 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) GetDefault() interface{} { 8661 switch fp.selector { 8662 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8663 return alert.Alert_State_OP_NOT_INVOLVED 8664 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8665 return "" 8666 default: 8667 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8668 } 8669 } 8670 8671 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) { 8672 if item != nil { 8673 switch fp.selector { 8674 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8675 item.CurrentState = alert.Alert_State_OP_NOT_INVOLVED 8676 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8677 item.Notes = "" 8678 default: 8679 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8680 } 8681 } 8682 } 8683 8684 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) ClearValueRaw(item proto.Message) { 8685 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)) 8686 } 8687 8688 // IsLeaf - whether field path is holds simple value 8689 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) IsLeaf() bool { 8690 return fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState || 8691 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes 8692 } 8693 8694 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 8695 return []gotenobject.FieldPath{fp} 8696 } 8697 8698 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue { 8699 switch fp.selector { 8700 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8701 return &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath: *fp, value: value.(alert.Alert_State_OperatorHandlingState)} 8702 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8703 return &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath: *fp, value: value.(string)} 8704 default: 8705 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8706 } 8707 } 8708 8709 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 8710 return fp.WithIValue(value) 8711 } 8712 8713 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues { 8714 fpaov := &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath: *fp} 8715 switch fp.selector { 8716 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8717 return &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath: *fp, values: values.([]alert.Alert_State_OperatorHandlingState)} 8718 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8719 return &NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath: *fp, values: values.([]string)} 8720 default: 8721 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8722 } 8723 return fpaov 8724 } 8725 8726 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 8727 return fp.WithIArrayOfValues(values) 8728 } 8729 8730 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue { 8731 switch fp.selector { 8732 default: 8733 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fp.selector)) 8734 } 8735 } 8736 8737 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 8738 return fp.WithIArrayItemValue(value) 8739 } 8740 8741 // NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue allows storing values for OperatorHandling fields according to their type 8742 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue interface { 8743 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath 8744 gotenobject.FieldPathValue 8745 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 8746 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) (cmp int, comparable bool) 8747 } 8748 8749 func ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue, error) { 8750 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(pathStr) 8751 if err != nil { 8752 return nil, err 8753 } 8754 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 8755 if err != nil { 8756 return nil, status.Errorf(codes.InvalidArgument, "error parsing OperatorHandling field path value from %s: %v", valueStr, err) 8757 } 8758 return fpv.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue), nil 8759 } 8760 8761 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue { 8762 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue(pathStr, valueStr) 8763 if err != nil { 8764 panic(err) 8765 } 8766 return fpv 8767 } 8768 8769 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue struct { 8770 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath 8771 value interface{} 8772 } 8773 8774 var _ NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue)(nil) 8775 8776 // GetRawValue returns raw value stored under selected path for 'OperatorHandling' as interface{} 8777 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) GetRawValue() interface{} { 8778 return fpv.value 8779 } 8780 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) AsCurrentStateValue() (alert.Alert_State_OperatorHandlingState, bool) { 8781 res, ok := fpv.value.(alert.Alert_State_OperatorHandlingState) 8782 return res, ok 8783 } 8784 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) AsNotesValue() (string, bool) { 8785 res, ok := fpv.value.(string) 8786 return res, ok 8787 } 8788 8789 // SetTo stores value for selected field for object OperatorHandling 8790 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) { 8791 if *target == nil { 8792 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 8793 } 8794 switch fpv.selector { 8795 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8796 (*target).CurrentState = fpv.value.(alert.Alert_State_OperatorHandlingState) 8797 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8798 (*target).Notes = fpv.value.(string) 8799 default: 8800 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fpv.selector)) 8801 } 8802 } 8803 8804 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) SetToRaw(target proto.Message) { 8805 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) 8806 fpv.SetTo(&typedObject) 8807 } 8808 8809 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling'. 8810 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) (int, bool) { 8811 switch fpv.selector { 8812 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8813 leftValue := fpv.value.(alert.Alert_State_OperatorHandlingState) 8814 rightValue := source.GetCurrentState() 8815 if (leftValue) == (rightValue) { 8816 return 0, true 8817 } else if (leftValue) < (rightValue) { 8818 return -1, true 8819 } else { 8820 return 1, true 8821 } 8822 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8823 leftValue := fpv.value.(string) 8824 rightValue := source.GetNotes() 8825 if (leftValue) == (rightValue) { 8826 return 0, true 8827 } else if (leftValue) < (rightValue) { 8828 return -1, true 8829 } else { 8830 return 1, true 8831 } 8832 default: 8833 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling: %d", fpv.selector)) 8834 } 8835 } 8836 8837 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 8838 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)) 8839 } 8840 8841 // NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue allows storing single item in Path-specific values for OperatorHandling according to their type 8842 // Present only for array (repeated) types. 8843 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue interface { 8844 gotenobject.FieldPathArrayItemValue 8845 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath 8846 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) bool 8847 } 8848 8849 // ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 8850 func ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue, error) { 8851 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(pathStr) 8852 if err != nil { 8853 return nil, err 8854 } 8855 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 8856 if err != nil { 8857 return nil, status.Errorf(codes.InvalidArgument, "error parsing OperatorHandling field path array item value from %s: %v", valueStr, err) 8858 } 8859 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue), nil 8860 } 8861 8862 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue { 8863 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue(pathStr, valueStr) 8864 if err != nil { 8865 panic(err) 8866 } 8867 return fpaiv 8868 } 8869 8870 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayItemValue struct { 8871 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath 8872 value interface{} 8873 } 8874 8875 var _ NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayItemValue)(nil) 8876 8877 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling as interface{} 8878 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 8879 return fpaiv.value 8880 } 8881 8882 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) (interface{}, bool) { 8883 return nil, false 8884 } 8885 8886 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 8887 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling)) 8888 } 8889 8890 // Contains returns a boolean indicating if value that is being held is present in given 'OperatorHandling' 8891 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_OperatorHandling) bool { 8892 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath.Get(source) 8893 for _, v := range slice { 8894 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 8895 if proto.Equal(asProtoMsg, v.(proto.Message)) { 8896 return true 8897 } 8898 } else if reflect.DeepEqual(v, fpaiv.value) { 8899 return true 8900 } 8901 } 8902 return false 8903 } 8904 8905 // NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues allows storing slice of values for OperatorHandling fields according to their type 8906 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues interface { 8907 gotenobject.FieldPathArrayOfValues 8908 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath 8909 } 8910 8911 func ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues, error) { 8912 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPath(pathStr) 8913 if err != nil { 8914 return nil, err 8915 } 8916 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 8917 if err != nil { 8918 return nil, status.Errorf(codes.InvalidArgument, "error parsing OperatorHandling field path array of values from %s: %v", valuesStr, err) 8919 } 8920 return fpaov.(NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues), nil 8921 } 8922 8923 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues { 8924 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues(pathStr, valuesStr) 8925 if err != nil { 8926 panic(err) 8927 } 8928 return fpaov 8929 } 8930 8931 type NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues struct { 8932 NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPath 8933 values interface{} 8934 } 8935 8936 var _ NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues)(nil) 8937 8938 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 8939 switch fpaov.selector { 8940 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorCurrentState: 8941 for _, v := range fpaov.values.([]alert.Alert_State_OperatorHandlingState) { 8942 values = append(values, v) 8943 } 8944 case NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldPathSelectorNotes: 8945 for _, v := range fpaov.values.([]string) { 8946 values = append(values, v) 8947 } 8948 } 8949 return 8950 } 8951 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues) AsCurrentStateArrayOfValues() ([]alert.Alert_State_OperatorHandlingState, bool) { 8952 res, ok := fpaov.values.([]alert.Alert_State_OperatorHandlingState) 8953 return res, ok 8954 } 8955 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertOperatorHandling_FieldTerminalPathArrayOfValues) AsNotesArrayOfValues() ([]string, bool) { 8956 res, ok := fpaov.values.([]string) 8957 return res, ok 8958 } 8959 8960 // FieldPath provides implementation to handle 8961 // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto 8962 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath interface { 8963 gotenobject.FieldPath 8964 Selector() NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector 8965 Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) []interface{} 8966 GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (interface{}, bool) 8967 ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 8968 8969 // Those methods build corresponding NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue 8970 // (or array of values) and holds passed value. Panics if injected type is incorrect. 8971 WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue 8972 WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues 8973 WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue 8974 } 8975 8976 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector int32 8977 8978 const ( 8979 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector = 0 8980 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector = 1 8981 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector = 2 8982 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector = 3 8983 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector = 4 8984 ) 8985 8986 func (s NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector) String() string { 8987 switch s { 8988 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 8989 return "query" 8990 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 8991 return "values" 8992 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 8993 return "upper_threshold" 8994 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 8995 return "lower_threshold" 8996 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 8997 return "raised_after" 8998 default: 8999 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", s)) 9000 } 9001 } 9002 9003 func BuildNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(fp gotenobject.RawFieldPath) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath, error) { 9004 if len(fp) == 0 { 9005 return nil, status.Error(codes.InvalidArgument, "empty field path for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries") 9006 } 9007 if len(fp) == 1 { 9008 switch fp[0] { 9009 case "query": 9010 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery}, nil 9011 case "values": 9012 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues}, nil 9013 case "upper_threshold", "upperThreshold", "upper-threshold": 9014 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold}, nil 9015 case "lower_threshold", "lowerThreshold", "lower-threshold": 9016 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold}, nil 9017 case "raised_after", "raisedAfter", "raised-after": 9018 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter}, nil 9019 } 9020 } else { 9021 switch fp[0] { 9022 case "upper_threshold", "upperThreshold", "upper-threshold": 9023 if subpath, err := rcommon.BuildAlertingThreshold_FieldPath(fp[1:]); err != nil { 9024 return nil, err 9025 } else { 9026 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold, subPath: subpath}, nil 9027 } 9028 case "lower_threshold", "lowerThreshold", "lower-threshold": 9029 if subpath, err := rcommon.BuildAlertingThreshold_FieldPath(fp[1:]); err != nil { 9030 return nil, err 9031 } else { 9032 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath{selector: NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold, subPath: subpath}, nil 9033 } 9034 } 9035 } 9036 return nil, status.Errorf(codes.InvalidArgument, "unknown field path '%s' for object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries", fp) 9037 } 9038 9039 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(rawField string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath, error) { 9040 fp, err := gotenobject.ParseRawFieldPath(rawField) 9041 if err != nil { 9042 return nil, err 9043 } 9044 return BuildNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(fp) 9045 } 9046 9047 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(rawField string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath { 9048 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(rawField) 9049 if err != nil { 9050 panic(err) 9051 } 9052 return fp 9053 } 9054 9055 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath struct { 9056 selector NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector 9057 } 9058 9059 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath)(nil) 9060 9061 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector { 9062 return fp.selector 9063 } 9064 9065 // String returns path representation in proto convention 9066 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) String() string { 9067 return fp.selector.String() 9068 } 9069 9070 // JSONString returns path representation is JSON convention 9071 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) JSONString() string { 9072 return strcase.ToLowerCamel(fp.String()) 9073 } 9074 9075 // Get returns all values pointed by specific field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries 9076 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (values []interface{}) { 9077 if source != nil { 9078 switch fp.selector { 9079 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9080 values = append(values, source.Query) 9081 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9082 for _, value := range source.GetValues() { 9083 values = append(values, value) 9084 } 9085 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9086 if source.UpperThreshold != nil { 9087 values = append(values, source.UpperThreshold) 9088 } 9089 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9090 if source.LowerThreshold != nil { 9091 values = append(values, source.LowerThreshold) 9092 } 9093 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9094 if source.RaisedAfter != nil { 9095 values = append(values, source.RaisedAfter) 9096 } 9097 default: 9098 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9099 } 9100 } 9101 return 9102 } 9103 9104 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) GetRaw(source proto.Message) []interface{} { 9105 return fp.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9106 } 9107 9108 // GetSingle returns value pointed by specific field of from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries 9109 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (interface{}, bool) { 9110 switch fp.selector { 9111 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9112 return source.GetQuery(), source != nil 9113 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9114 res := source.GetValues() 9115 return res, res != nil 9116 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9117 res := source.GetUpperThreshold() 9118 return res, res != nil 9119 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9120 res := source.GetLowerThreshold() 9121 return res, res != nil 9122 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9123 res := source.GetRaisedAfter() 9124 return res, res != nil 9125 default: 9126 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9127 } 9128 } 9129 9130 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 9131 return fp.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9132 } 9133 9134 // GetDefault returns a default value of the field type 9135 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) GetDefault() interface{} { 9136 switch fp.selector { 9137 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9138 return "" 9139 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9140 return ([]float64)(nil) 9141 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9142 return (*rcommon.AlertingThreshold)(nil) 9143 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9144 return (*rcommon.AlertingThreshold)(nil) 9145 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9146 return (*durationpb.Duration)(nil) 9147 default: 9148 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9149 } 9150 } 9151 9152 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) { 9153 if item != nil { 9154 switch fp.selector { 9155 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9156 item.Query = "" 9157 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9158 item.Values = nil 9159 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9160 item.UpperThreshold = nil 9161 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9162 item.LowerThreshold = nil 9163 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9164 item.RaisedAfter = nil 9165 default: 9166 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9167 } 9168 } 9169 } 9170 9171 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) ClearValueRaw(item proto.Message) { 9172 fp.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9173 } 9174 9175 // IsLeaf - whether field path is holds simple value 9176 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) IsLeaf() bool { 9177 return fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery || 9178 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues || 9179 fp.selector == NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter 9180 } 9181 9182 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 9183 return []gotenobject.FieldPath{fp} 9184 } 9185 9186 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue { 9187 switch fp.selector { 9188 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9189 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, value: value.(string)} 9190 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9191 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, value: value.([]float64)} 9192 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9193 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, value: value.(*rcommon.AlertingThreshold)} 9194 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9195 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, value: value.(*rcommon.AlertingThreshold)} 9196 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9197 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, value: value.(*durationpb.Duration)} 9198 default: 9199 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9200 } 9201 } 9202 9203 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 9204 return fp.WithIValue(value) 9205 } 9206 9207 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues { 9208 fpaov := &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp} 9209 switch fp.selector { 9210 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9211 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, values: values.([]string)} 9212 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9213 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, values: values.([][]float64)} 9214 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9215 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, values: values.([]*rcommon.AlertingThreshold)} 9216 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9217 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, values: values.([]*rcommon.AlertingThreshold)} 9218 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9219 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, values: values.([]*durationpb.Duration)} 9220 default: 9221 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9222 } 9223 return fpaov 9224 } 9225 9226 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 9227 return fp.WithIArrayOfValues(values) 9228 } 9229 9230 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue { 9231 switch fp.selector { 9232 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9233 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue{NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath: *fp, value: value.(float64)} 9234 default: 9235 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fp.selector)) 9236 } 9237 } 9238 9239 func (fp *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 9240 return fp.WithIArrayItemValue(value) 9241 } 9242 9243 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath struct { 9244 selector NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector 9245 subPath gotenobject.FieldPath 9246 } 9247 9248 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath)(nil) 9249 9250 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) Selector() NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelector { 9251 return fps.selector 9252 } 9253 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) AsUpperThresholdSubPath() (rcommon.AlertingThreshold_FieldPath, bool) { 9254 res, ok := fps.subPath.(rcommon.AlertingThreshold_FieldPath) 9255 return res, ok 9256 } 9257 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) AsLowerThresholdSubPath() (rcommon.AlertingThreshold_FieldPath, bool) { 9258 res, ok := fps.subPath.(rcommon.AlertingThreshold_FieldPath) 9259 return res, ok 9260 } 9261 9262 // String returns path representation in proto convention 9263 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) String() string { 9264 return fps.selector.String() + "." + fps.subPath.String() 9265 } 9266 9267 // JSONString returns path representation is JSON convention 9268 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) JSONString() string { 9269 return strcase.ToLowerCamel(fps.selector.String()) + "." + fps.subPath.JSONString() 9270 } 9271 9272 // Get returns all values pointed by selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries 9273 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) Get(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (values []interface{}) { 9274 switch fps.selector { 9275 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9276 values = append(values, fps.subPath.GetRaw(source.GetUpperThreshold())...) 9277 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9278 values = append(values, fps.subPath.GetRaw(source.GetLowerThreshold())...) 9279 default: 9280 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fps.selector)) 9281 } 9282 return 9283 } 9284 9285 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) GetRaw(source proto.Message) []interface{} { 9286 return fps.Get(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9287 } 9288 9289 // GetSingle returns value of selected field from source NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries 9290 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (interface{}, bool) { 9291 switch fps.selector { 9292 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9293 if source.GetUpperThreshold() == nil { 9294 return nil, false 9295 } 9296 return fps.subPath.GetSingleRaw(source.GetUpperThreshold()) 9297 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9298 if source.GetLowerThreshold() == nil { 9299 return nil, false 9300 } 9301 return fps.subPath.GetSingleRaw(source.GetLowerThreshold()) 9302 default: 9303 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fps.selector)) 9304 } 9305 } 9306 9307 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) GetSingleRaw(source proto.Message) (interface{}, bool) { 9308 return fps.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9309 } 9310 9311 // GetDefault returns a default value of the field type 9312 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) GetDefault() interface{} { 9313 return fps.subPath.GetDefault() 9314 } 9315 9316 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) ClearValue(item *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) { 9317 if item != nil { 9318 switch fps.selector { 9319 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9320 fps.subPath.ClearValueRaw(item.UpperThreshold) 9321 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9322 fps.subPath.ClearValueRaw(item.LowerThreshold) 9323 default: 9324 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fps.selector)) 9325 } 9326 } 9327 } 9328 9329 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) ClearValueRaw(item proto.Message) { 9330 fps.ClearValue(item.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9331 } 9332 9333 // IsLeaf - whether field path is holds simple value 9334 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) IsLeaf() bool { 9335 return fps.subPath.IsLeaf() 9336 } 9337 9338 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) SplitIntoTerminalIPaths() []gotenobject.FieldPath { 9339 iPaths := []gotenobject.FieldPath{&NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath{selector: fps.selector}} 9340 iPaths = append(iPaths, fps.subPath.SplitIntoTerminalIPaths()...) 9341 return iPaths 9342 } 9343 9344 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) WithIValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue { 9345 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue{fps, fps.subPath.WithRawIValue(value)} 9346 } 9347 9348 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) WithRawIValue(value interface{}) gotenobject.FieldPathValue { 9349 return fps.WithIValue(value) 9350 } 9351 9352 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) WithIArrayOfValues(values interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues { 9353 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayOfValues{fps, fps.subPath.WithRawIArrayOfValues(values)} 9354 } 9355 9356 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) WithRawIArrayOfValues(values interface{}) gotenobject.FieldPathArrayOfValues { 9357 return fps.WithIArrayOfValues(values) 9358 } 9359 9360 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) WithIArrayItemValue(value interface{}) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue { 9361 return &NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayItemValue{fps, fps.subPath.WithRawIArrayItemValue(value)} 9362 } 9363 9364 func (fps *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPath) WithRawIArrayItemValue(value interface{}) gotenobject.FieldPathArrayItemValue { 9365 return fps.WithIArrayItemValue(value) 9366 } 9367 9368 // NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue allows storing values for TimeSeries fields according to their type 9369 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue interface { 9370 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath 9371 gotenobject.FieldPathValue 9372 SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 9373 CompareWith(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (cmp int, comparable bool) 9374 } 9375 9376 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue, error) { 9377 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(pathStr) 9378 if err != nil { 9379 return nil, err 9380 } 9381 fpv, err := gotenobject.ParseFieldPathValue(fp, valueStr) 9382 if err != nil { 9383 return nil, status.Errorf(codes.InvalidArgument, "error parsing TimeSeries field path value from %s: %v", valueStr, err) 9384 } 9385 return fpv.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue), nil 9386 } 9387 9388 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue { 9389 fpv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue(pathStr, valueStr) 9390 if err != nil { 9391 panic(err) 9392 } 9393 return fpv 9394 } 9395 9396 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue struct { 9397 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath 9398 value interface{} 9399 } 9400 9401 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue)(nil) 9402 9403 // GetRawValue returns raw value stored under selected path for 'TimeSeries' as interface{} 9404 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) GetRawValue() interface{} { 9405 return fpv.value 9406 } 9407 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) AsQueryValue() (string, bool) { 9408 res, ok := fpv.value.(string) 9409 return res, ok 9410 } 9411 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) AsValuesValue() ([]float64, bool) { 9412 res, ok := fpv.value.([]float64) 9413 return res, ok 9414 } 9415 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) AsUpperThresholdValue() (*rcommon.AlertingThreshold, bool) { 9416 res, ok := fpv.value.(*rcommon.AlertingThreshold) 9417 return res, ok 9418 } 9419 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) AsLowerThresholdValue() (*rcommon.AlertingThreshold, bool) { 9420 res, ok := fpv.value.(*rcommon.AlertingThreshold) 9421 return res, ok 9422 } 9423 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) AsRaisedAfterValue() (*durationpb.Duration, bool) { 9424 res, ok := fpv.value.(*durationpb.Duration) 9425 return res, ok 9426 } 9427 9428 // SetTo stores value for selected field for object TimeSeries 9429 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) { 9430 if *target == nil { 9431 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 9432 } 9433 switch fpv.selector { 9434 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9435 (*target).Query = fpv.value.(string) 9436 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9437 (*target).Values = fpv.value.([]float64) 9438 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9439 (*target).UpperThreshold = fpv.value.(*rcommon.AlertingThreshold) 9440 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9441 (*target).LowerThreshold = fpv.value.(*rcommon.AlertingThreshold) 9442 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9443 (*target).RaisedAfter = fpv.value.(*durationpb.Duration) 9444 default: 9445 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fpv.selector)) 9446 } 9447 } 9448 9449 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) SetToRaw(target proto.Message) { 9450 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 9451 fpv.SetTo(&typedObject) 9452 } 9453 9454 // CompareWith compares value in the 'NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue' with the value under path in 'NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries'. 9455 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (int, bool) { 9456 switch fpv.selector { 9457 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9458 leftValue := fpv.value.(string) 9459 rightValue := source.GetQuery() 9460 if (leftValue) == (rightValue) { 9461 return 0, true 9462 } else if (leftValue) < (rightValue) { 9463 return -1, true 9464 } else { 9465 return 1, true 9466 } 9467 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9468 return 0, false 9469 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9470 return 0, false 9471 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9472 return 0, false 9473 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9474 leftValue := fpv.value.(*durationpb.Duration) 9475 rightValue := source.GetRaisedAfter() 9476 if leftValue == nil { 9477 if rightValue != nil { 9478 return -1, true 9479 } 9480 return 0, true 9481 } 9482 if rightValue == nil { 9483 return 1, true 9484 } 9485 if leftValue.AsDuration() == rightValue.AsDuration() { 9486 return 0, true 9487 } else if leftValue.AsDuration() < rightValue.AsDuration() { 9488 return -1, true 9489 } else { 9490 return 1, true 9491 } 9492 default: 9493 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fpv.selector)) 9494 } 9495 } 9496 9497 func (fpv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathValue) CompareWithRaw(source proto.Message) (int, bool) { 9498 return fpv.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9499 } 9500 9501 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue struct { 9502 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath 9503 subPathValue gotenobject.FieldPathValue 9504 } 9505 9506 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathValue = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue)(nil) 9507 9508 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) AsUpperThresholdPathValue() (rcommon.AlertingThreshold_FieldPathValue, bool) { 9509 res, ok := fpvs.subPathValue.(rcommon.AlertingThreshold_FieldPathValue) 9510 return res, ok 9511 } 9512 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) AsLowerThresholdPathValue() (rcommon.AlertingThreshold_FieldPathValue, bool) { 9513 res, ok := fpvs.subPathValue.(rcommon.AlertingThreshold_FieldPathValue) 9514 return res, ok 9515 } 9516 9517 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) SetTo(target **NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) { 9518 if *target == nil { 9519 *target = new(NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 9520 } 9521 switch fpvs.Selector() { 9522 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9523 fpvs.subPathValue.(rcommon.AlertingThreshold_FieldPathValue).SetTo(&(*target).UpperThreshold) 9524 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9525 fpvs.subPathValue.(rcommon.AlertingThreshold_FieldPathValue).SetTo(&(*target).LowerThreshold) 9526 default: 9527 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fpvs.Selector())) 9528 } 9529 } 9530 9531 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) SetToRaw(target proto.Message) { 9532 typedObject := target.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) 9533 fpvs.SetTo(&typedObject) 9534 } 9535 9536 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) GetRawValue() interface{} { 9537 return fpvs.subPathValue.GetRawValue() 9538 } 9539 9540 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) CompareWith(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (int, bool) { 9541 switch fpvs.Selector() { 9542 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9543 return fpvs.subPathValue.(rcommon.AlertingThreshold_FieldPathValue).CompareWith(source.GetUpperThreshold()) 9544 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9545 return fpvs.subPathValue.(rcommon.AlertingThreshold_FieldPathValue).CompareWith(source.GetLowerThreshold()) 9546 default: 9547 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fpvs.Selector())) 9548 } 9549 } 9550 9551 func (fpvs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathValue) CompareWithRaw(source proto.Message) (int, bool) { 9552 return fpvs.CompareWith(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9553 } 9554 9555 // NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue allows storing single item in Path-specific values for TimeSeries according to their type 9556 // Present only for array (repeated) types. 9557 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue interface { 9558 gotenobject.FieldPathArrayItemValue 9559 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath 9560 ContainsValue(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) bool 9561 } 9562 9563 // ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue parses string and JSON-encoded value to its Value 9564 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue(pathStr, valueStr string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue, error) { 9565 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(pathStr) 9566 if err != nil { 9567 return nil, err 9568 } 9569 fpaiv, err := gotenobject.ParseFieldPathArrayItemValue(fp, valueStr) 9570 if err != nil { 9571 return nil, status.Errorf(codes.InvalidArgument, "error parsing TimeSeries field path array item value from %s: %v", valueStr, err) 9572 } 9573 return fpaiv.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue), nil 9574 } 9575 9576 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue(pathStr, valueStr string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue { 9577 fpaiv, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue(pathStr, valueStr) 9578 if err != nil { 9579 panic(err) 9580 } 9581 return fpaiv 9582 } 9583 9584 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue struct { 9585 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath 9586 value interface{} 9587 } 9588 9589 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayItemValue = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue)(nil) 9590 9591 // GetRawValue returns stored element value for array in object NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries as interface{} 9592 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue) GetRawItemValue() interface{} { 9593 return fpaiv.value 9594 } 9595 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue) AsValuesItemValue() (float64, bool) { 9596 res, ok := fpaiv.value.(float64) 9597 return res, ok 9598 } 9599 9600 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue) GetSingle(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) (interface{}, bool) { 9601 return nil, false 9602 } 9603 9604 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue) GetSingleRaw(source proto.Message) (interface{}, bool) { 9605 return fpaiv.GetSingle(source.(*NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries)) 9606 } 9607 9608 // Contains returns a boolean indicating if value that is being held is present in given 'TimeSeries' 9609 func (fpaiv *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) bool { 9610 slice := fpaiv.NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath.Get(source) 9611 for _, v := range slice { 9612 if asProtoMsg, ok := fpaiv.value.(proto.Message); ok { 9613 if proto.Equal(asProtoMsg, v.(proto.Message)) { 9614 return true 9615 } 9616 } else if reflect.DeepEqual(v, fpaiv.value) { 9617 return true 9618 } 9619 } 9620 return false 9621 } 9622 9623 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayItemValue struct { 9624 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath 9625 subPathItemValue gotenobject.FieldPathArrayItemValue 9626 } 9627 9628 // GetRawValue returns stored array item value 9629 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayItemValue) GetRawItemValue() interface{} { 9630 return fpaivs.subPathItemValue.GetRawItemValue() 9631 } 9632 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayItemValue) AsUpperThresholdPathItemValue() (rcommon.AlertingThreshold_FieldPathArrayItemValue, bool) { 9633 res, ok := fpaivs.subPathItemValue.(rcommon.AlertingThreshold_FieldPathArrayItemValue) 9634 return res, ok 9635 } 9636 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayItemValue) AsLowerThresholdPathItemValue() (rcommon.AlertingThreshold_FieldPathArrayItemValue, bool) { 9637 res, ok := fpaivs.subPathItemValue.(rcommon.AlertingThreshold_FieldPathArrayItemValue) 9638 return res, ok 9639 } 9640 9641 // Contains returns a boolean indicating if value that is being held is present in given 'TimeSeries' 9642 func (fpaivs *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayItemValue) ContainsValue(source *NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries) bool { 9643 switch fpaivs.Selector() { 9644 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9645 return fpaivs.subPathItemValue.(rcommon.AlertingThreshold_FieldPathArrayItemValue).ContainsValue(source.GetUpperThreshold()) 9646 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9647 return fpaivs.subPathItemValue.(rcommon.AlertingThreshold_FieldPathArrayItemValue).ContainsValue(source.GetLowerThreshold()) 9648 default: 9649 panic(fmt.Sprintf("Invalid selector for NotificationMsg_AlertsGroup_ConditionAlerts_Alert_ViolationInfo_TimeSeries: %d", fpaivs.Selector())) 9650 } 9651 } 9652 9653 // NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues allows storing slice of values for TimeSeries fields according to their type 9654 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues interface { 9655 gotenobject.FieldPathArrayOfValues 9656 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath 9657 } 9658 9659 func ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues(pathStr, valuesStr string) (NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues, error) { 9660 fp, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath(pathStr) 9661 if err != nil { 9662 return nil, err 9663 } 9664 fpaov, err := gotenobject.ParseFieldPathArrayOfValues(fp, valuesStr) 9665 if err != nil { 9666 return nil, status.Errorf(codes.InvalidArgument, "error parsing TimeSeries field path array of values from %s: %v", valuesStr, err) 9667 } 9668 return fpaov.(NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues), nil 9669 } 9670 9671 func MustParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues(pathStr, valuesStr string) NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues { 9672 fpaov, err := ParseNotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues(pathStr, valuesStr) 9673 if err != nil { 9674 panic(err) 9675 } 9676 return fpaov 9677 } 9678 9679 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues struct { 9680 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPath 9681 values interface{} 9682 } 9683 9684 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues)(nil) 9685 9686 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues) GetRawValues() (values []interface{}) { 9687 switch fpaov.selector { 9688 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorQuery: 9689 for _, v := range fpaov.values.([]string) { 9690 values = append(values, v) 9691 } 9692 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorValues: 9693 for _, v := range fpaov.values.([][]float64) { 9694 values = append(values, v) 9695 } 9696 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorUpperThreshold: 9697 for _, v := range fpaov.values.([]*rcommon.AlertingThreshold) { 9698 values = append(values, v) 9699 } 9700 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorLowerThreshold: 9701 for _, v := range fpaov.values.([]*rcommon.AlertingThreshold) { 9702 values = append(values, v) 9703 } 9704 case NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathSelectorRaisedAfter: 9705 for _, v := range fpaov.values.([]*durationpb.Duration) { 9706 values = append(values, v) 9707 } 9708 } 9709 return 9710 } 9711 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues) AsQueryArrayOfValues() ([]string, bool) { 9712 res, ok := fpaov.values.([]string) 9713 return res, ok 9714 } 9715 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues) AsValuesArrayOfValues() ([][]float64, bool) { 9716 res, ok := fpaov.values.([][]float64) 9717 return res, ok 9718 } 9719 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues) AsUpperThresholdArrayOfValues() ([]*rcommon.AlertingThreshold, bool) { 9720 res, ok := fpaov.values.([]*rcommon.AlertingThreshold) 9721 return res, ok 9722 } 9723 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues) AsLowerThresholdArrayOfValues() ([]*rcommon.AlertingThreshold, bool) { 9724 res, ok := fpaov.values.([]*rcommon.AlertingThreshold) 9725 return res, ok 9726 } 9727 func (fpaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldTerminalPathArrayOfValues) AsRaisedAfterArrayOfValues() ([]*durationpb.Duration, bool) { 9728 res, ok := fpaov.values.([]*durationpb.Duration) 9729 return res, ok 9730 } 9731 9732 type NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayOfValues struct { 9733 NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPath 9734 subPathArrayOfValues gotenobject.FieldPathArrayOfValues 9735 } 9736 9737 var _ NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldPathArrayOfValues = (*NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayOfValues)(nil) 9738 9739 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayOfValues) GetRawValues() []interface{} { 9740 return fpsaov.subPathArrayOfValues.GetRawValues() 9741 } 9742 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayOfValues) AsUpperThresholdPathArrayOfValues() (rcommon.AlertingThreshold_FieldPathArrayOfValues, bool) { 9743 res, ok := fpsaov.subPathArrayOfValues.(rcommon.AlertingThreshold_FieldPathArrayOfValues) 9744 return res, ok 9745 } 9746 func (fpsaov *NotificationMsgAlertsGroupConditionAlertsAlertViolationInfoTimeSeries_FieldSubPathArrayOfValues) AsLowerThresholdPathArrayOfValues() (rcommon.AlertingThreshold_FieldPathArrayOfValues, bool) { 9747 res, ok := fpsaov.subPathArrayOfValues.(rcommon.AlertingThreshold_FieldPathArrayOfValues) 9748 return res, ok 9749 }