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