MCPcopy Create free account
hub / github.com/cloudfoundry/cli / AttachOrgsToPlans

Method AttachOrgsToPlans

cf/actors/planbuilder/plan_builder.go:53–64  ·  view source on GitHub ↗
(plans []models.ServicePlanFields)

Source from the content-addressed store, hash-verified

51}
52
53func (builder Builder) AttachOrgsToPlans(plans []models.ServicePlanFields) ([]models.ServicePlanFields, error) {
54 visMap, err := builder.buildPlanToOrgsVisibilityMap()
55 if err != nil {
56 return nil, err
57 }
58 for planIndex := range plans {
59 plan := &plans[planIndex]
60 plan.OrgNames = visMap[plan.GUID]
61 }
62
63 return plans, nil
64}
65
66func (builder Builder) GetPlansForServiceForOrg(serviceGUID string, orgName string) ([]models.ServicePlanFields, error) {
67 plans, err := builder.servicePlanRepo.Search(map[string]string{"service_guid": serviceGUID})

Calls 1

Tested by

no test coverage detected