github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v3/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/v3/alerting_policy" 16 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/common" 17 meta "github.com/cloudwan/goten-sdk/types/meta" 18 durationpb "google.golang.org/protobuf/types/known/durationpb" 19 ) 20 21 // ensure the imports are used 22 var ( 23 _ = googlefieldmaskpb.FieldMask{} 24 25 _ = view.View_UNSPECIFIED 26 ) 27 28 // make sure we're using proto imports 29 var ( 30 _ = &alerting_policy.AlertingPolicy{} 31 _ = &common.LabelDescriptor{} 32 _ = &durationpb.Duration{} 33 _ = &meta.Meta{} 34 ) 35 36 func ResourceViewFieldMask(viewName view.View, extraMask *AlertingCondition_FieldMask) *AlertingCondition_FieldMask { 37 protoFieldMask := &googlefieldmaskpb.FieldMask{} 38 39 switch viewName { 40 case view.View_UNSPECIFIED: 41 return extraMask 42 case view.View_FULL: 43 return nil 44 case view.View_BASIC: 45 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "display_name", "state.firing_alerts_count") 46 break 47 case view.View_NAME: 48 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "display_name") 49 break 50 default: 51 return extraMask 52 } 53 if extraMask != nil { 54 protoFieldMask.Paths = append(protoFieldMask.Paths, extraMask.ToProtoFieldMask().Paths...) 55 } 56 res := &AlertingCondition_FieldMask{} 57 _ = res.FromProtoFieldMask(protoFieldMask) 58 return res 59 }