github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/resources/service_brokers.go (about)

     1  package resources
     2  
     3  import "code.cloudfoundry.org/cli/cf/models"
     4  
     5  type ServiceBrokerResource struct {
     6  	Resource
     7  	Entity ServiceBrokerEntity
     8  }
     9  
    10  type ServiceBrokerEntity struct {
    11  	GUID     string
    12  	Name     string
    13  	Password string `json:"auth_password"`
    14  	Username string `json:"auth_username"`
    15  	URL      string `json:"broker_url"`
    16  }
    17  
    18  func (resource ServiceBrokerResource) ToFields() (fields models.ServiceBroker) {
    19  	fields.Name = resource.Entity.Name
    20  	fields.GUID = resource.Metadata.GUID
    21  	fields.URL = resource.Entity.URL
    22  	fields.Username = resource.Entity.Username
    23  	fields.Password = resource.Entity.Password
    24  	return
    25  }