github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/alerting_condition/alerting_condition.pb.view.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: AlertingCondition 3 // DO NOT EDIT!!! 4 5 package alerting_condition 6 7 import ( 8 googlefieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 9 10 "github.com/cloudwan/goten-sdk/types/view" 11 ) 12 13 // proto imports 14 import ( 15 alerting_policy "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_policy" 16 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 17 time_serie "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/time_serie" 18 meta "github.com/cloudwan/goten-sdk/types/meta" 19 durationpb "google.golang.org/protobuf/types/known/durationpb" 20 ) 21 22 // ensure the imports are used 23 var ( 24 _ = googlefieldmaskpb.FieldMask{} 25 26 _ = view.View_UNSPECIFIED 27 ) 28 29 // make sure we're using proto imports 30 var ( 31 _ = &alerting_policy.AlertingPolicy{} 32 _ = &common.LabelDescriptor{} 33 _ = &time_serie.Point{} 34 _ = &durationpb.Duration{} 35 _ = &meta.Meta{} 36 ) 37 38 func ResourceViewFieldMask(viewName view.View, extraMask *AlertingCondition_FieldMask) *AlertingCondition_FieldMask { 39 protoFieldMask := &googlefieldmaskpb.FieldMask{} 40 41 switch viewName { 42 case view.View_UNSPECIFIED: 43 return extraMask 44 case view.View_FULL: 45 return nil 46 case view.View_BASIC: 47 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "display_name", "state.firing_alerts_count") 48 break 49 case view.View_NAME: 50 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "display_name") 51 break 52 default: 53 return extraMask 54 } 55 if extraMask != nil { 56 protoFieldMask.Paths = append(protoFieldMask.Paths, extraMask.ToProtoFieldMask().Paths...) 57 } 58 res := &AlertingCondition_FieldMask{} 59 _ = res.FromProtoFieldMask(protoFieldMask) 60 return res 61 }