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