code.cloudfoundry.org/cli@v7.1.0+incompatible/cf/models/service_plan.go (about)

     1  package models
     2  
     3  type ServicePlanFields struct {
     4  	GUID                string
     5  	Name                string
     6  	Free                bool
     7  	Public              bool
     8  	Description         string
     9  	Active              bool
    10  	ServiceOfferingGUID string
    11  	OrgNames            []string
    12  }
    13  
    14  type ServicePlan struct {
    15  	ServicePlanFields
    16  	ServiceOffering ServiceOfferingFields
    17  }
    18  
    19  type ServicePlanSummary struct {
    20  	GUID string
    21  	Name string
    22  }
    23  
    24  func (servicePlanFields ServicePlanFields) OrgHasVisibility(orgName string) bool {
    25  	if servicePlanFields.Public {
    26  		return true
    27  	}
    28  	for _, org := range servicePlanFields.OrgNames {
    29  		if org == orgName {
    30  			return true
    31  		}
    32  	}
    33  	return false
    34  }