github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/resources/v1/ts_entry/ts_entry.pb.view.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: TsEntry 3 // DO NOT EDIT!!! 4 5 package ts_entry 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 rcommon "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/common" 16 ts_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_condition" 17 monitoring_common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 18 meta "github.com/cloudwan/goten-sdk/types/meta" 19 durationpb "google.golang.org/protobuf/types/known/durationpb" 20 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 21 ) 22 23 // ensure the imports are used 24 var ( 25 _ = googlefieldmaskpb.FieldMask{} 26 27 _ = view.View_UNSPECIFIED 28 ) 29 30 // make sure we're using proto imports 31 var ( 32 _ = &rcommon.LogCndSpec{} 33 _ = &ts_condition.TsCondition{} 34 _ = &monitoring_common.LabelDescriptor{} 35 _ = &durationpb.Duration{} 36 _ = ×tamppb.Timestamp{} 37 _ = &meta.Meta{} 38 ) 39 40 func ResourceViewFieldMask(viewName view.View, extraMask *TsEntry_FieldMask) *TsEntry_FieldMask { 41 protoFieldMask := &googlefieldmaskpb.FieldMask{} 42 43 switch viewName { 44 case view.View_UNSPECIFIED: 45 return extraMask 46 case view.View_FULL: 47 return nil 48 case view.View_BASIC: 49 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "info.alerting_resource.name", "info.alerting_resource.kind", "state.models.analysis_window", "state.models.sensitiveness", "state.thresholds.lower", "state.thresholds.upper") 50 break 51 case view.View_DETAIL: 52 protoFieldMask.Paths = append(protoFieldMask.Paths, "name", "info.alerting_resource", "info.common_metric_labels", "info.common_resource_labels", "state.models.analysis_window", "state.models.training_mean_err", "state.models.training_max_err", "state.models.trained_in_epochs", "state.models.trained_in", "state.models.train_after", "state.models.training_period", "state.models.sensitiveness", "state.thresholds") 53 break 54 case view.View_NAME: 55 protoFieldMask.Paths = append(protoFieldMask.Paths, "name") 56 break 57 default: 58 return extraMask 59 } 60 if extraMask != nil { 61 protoFieldMask.Paths = append(protoFieldMask.Paths, extraMask.ToProtoFieldMask().Paths...) 62 } 63 res := &TsEntry_FieldMask{} 64 _ = res.FromProtoFieldMask(protoFieldMask) 65 return res 66 }