github.com/cloudwan/edgelq-sdk@v1.15.4/logging/resources/v1/log/log.pb.view.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: Log 3 // DO NOT EDIT!!! 4 5 package log 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 iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization" 16 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project" 17 bucket "github.com/cloudwan/edgelq-sdk/logging/resources/v1/bucket" 18 log_descriptor "github.com/cloudwan/edgelq-sdk/logging/resources/v1/log_descriptor" 19 meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service" 20 meta "github.com/cloudwan/goten-sdk/types/meta" 21 anypb "google.golang.org/protobuf/types/known/anypb" 22 structpb "google.golang.org/protobuf/types/known/structpb" 23 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 24 ) 25 26 // ensure the imports are used 27 var ( 28 _ = googlefieldmaskpb.FieldMask{} 29 30 _ = view.View_UNSPECIFIED 31 ) 32 33 // make sure we're using proto imports 34 var ( 35 _ = &iam_organization.Organization{} 36 _ = &iam_project.Project{} 37 _ = &bucket.Bucket{} 38 _ = &log_descriptor.LogDescriptor{} 39 _ = &anypb.Any{} 40 _ = &structpb.Struct{} 41 _ = ×tamppb.Timestamp{} 42 _ = &meta_service.Service{} 43 _ = &meta.Meta{} 44 ) 45 46 func ResourceViewFieldMask(viewName view.View, extraMask *Log_FieldMask) *Log_FieldMask { 47 protoFieldMask := &googlefieldmaskpb.FieldMask{} 48 49 switch viewName { 50 case view.View_UNSPECIFIED: 51 return extraMask 52 case view.View_FULL: 53 return nil 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 := &Log_FieldMask{} 64 _ = res.FromProtoFieldMask(protoFieldMask) 65 return res 66 }