github.com/cloudwan/edgelq-sdk@v1.15.4/iam/resources/v1/project_invitation/project_invitation.pb.view.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: ProjectInvitation 3 // DO NOT EDIT!!! 4 5 package project_invitation 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_invitation "github.com/cloudwan/edgelq-sdk/iam/resources/v1/invitation" 16 project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project" 17 meta "github.com/cloudwan/goten-sdk/types/meta" 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 _ = &iam_invitation.Actor{} 30 _ = &project.Project{} 31 _ = &meta.Meta{} 32 ) 33 34 func ResourceViewFieldMask(viewName view.View, extraMask *ProjectInvitation_FieldMask) *ProjectInvitation_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_NAME: 43 protoFieldMask.Paths = append(protoFieldMask.Paths, "name") 44 break 45 default: 46 return extraMask 47 } 48 if extraMask != nil { 49 protoFieldMask.Paths = append(protoFieldMask.Paths, extraMask.ToProtoFieldMask().Paths...) 50 } 51 res := &ProjectInvitation_FieldMask{} 52 _ = res.FromProtoFieldMask(protoFieldMask) 53 return res 54 }