(queryParams map[string]string)
| 57 | } |
| 58 | |
| 59 | func (repo CloudControllerServicePlanRepository) Search(queryParams map[string]string) (plans []models.ServicePlanFields, err error) { |
| 60 | err = repo.gateway.ListPaginatedResources( |
| 61 | repo.config.APIEndpoint(), |
| 62 | combineQueryParametersWithURI("/v2/service_plans", queryParams), |
| 63 | resources.ServicePlanResource{}, |
| 64 | func(resource interface{}) bool { |
| 65 | if sp, ok := resource.(resources.ServicePlanResource); ok { |
| 66 | plans = append(plans, sp.ToFields()) |
| 67 | } |
| 68 | return true |
| 69 | }) |
| 70 | return |
| 71 | } |
| 72 | |
| 73 | func combineQueryParametersWithURI(uri string, queryParams map[string]string) string { |
| 74 | if len(queryParams) == 0 { |
nothing calls this directly
no test coverage detected