github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v3/notification_channel/notification_channel.pb.view.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: NotificationChannel 3 // DO NOT EDIT!!! 4 5 package notification_channel 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 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/project" 16 meta "github.com/cloudwan/goten-sdk/types/meta" 17 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 18 ) 19 20 // ensure the imports are used 21 var ( 22 _ = googlefieldmaskpb.FieldMask{} 23 24 _ = view.View_UNSPECIFIED 25 ) 26 27 // make sure we're using proto imports 28 var ( 29 _ = &project.Project{} 30 _ = ×tamppb.Timestamp{} 31 _ = &meta.Meta{} 32 ) 33 34 func ResourceViewFieldMask(viewName view.View, extraMask *NotificationChannel_FieldMask) *NotificationChannel_FieldMask { 35 protoFieldMask := &googlefieldmaskpb.FieldMask{} 36 37 switch viewName { 38 case view.View_UNSPECIFIED: 39 return extraMask 40 case view.View_FULL: 41 return nil 42 case view.View_BASIC: 43 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "display_name", "spec.enabled", "spec.type") 44 break 45 case view.View_NAME: 46 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "display_name") 47 break 48 default: 49 return extraMask 50 } 51 if extraMask != nil { 52 protoFieldMask.Paths = append(protoFieldMask.Paths, extraMask.ToProtoFieldMask().Paths...) 53 } 54 res := &NotificationChannel_FieldMask{} 55 _ = res.FromProtoFieldMask(protoFieldMask) 56 return res 57 }