code: func (u *Upstream) ToAPI() api.Upstream {
  	return api.Upstream{
  		DestinationType:      api.UpstreamDestType(u.DestinationType),
  		DestinationNamespace: u.DestinationNamespace,
  		DestinationName:      u.DestinationName,
  		Datacenter:           u.Datacenter,
  		LocalBindAddress:     u.LocalBindAddress,
  		LocalBindPort:        u.LocalBindPort,
  		Config:               u.Config,
  	}
  }
docs: // ToAPI returns the api structs with the same fields. We have duplicates to
  // avoid the api package depending on this one which imports a ton of Consul's
  // core which you don't want if you are just trying to use our client in your
  // app.