code: func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType constant.ApplicationHealthCheckType, httpEndpoint string) (Application, Warnings, error) {
  	if httpEndpoint != "/" && healthCheckType != constant.ApplicationHealthCheckHTTP {
  		return Application{}, nil, actionerror.HTTPHealthCheckInvalidError{}
  	}
  
  	var allWarnings Warnings
  
  	app, warnings, err := actor.GetApplicationByNameAndSpace(name, spaceGUID)
  	allWarnings = append(allWarnings, warnings...)
  
  	if err != nil {
  		return Application{}, allWarnings, err
  	}
  
  	if app.HealthCheckType != healthCheckType ||
  		healthCheckType == constant.ApplicationHealthCheckHTTP && app.HealthCheckHTTPEndpoint != httpEndpoint {
  		var healthCheckEndpoint string
  		if healthCheckType == constant.ApplicationHealthCheckHTTP {
  			healthCheckEndpoint = httpEndpoint
  		}
  
  		updatedApp, apiWarnings, err := actor.CloudControllerClient.UpdateApplication(ccv2.Application{
  			GUID:                    app.GUID,
  			HealthCheckType:         healthCheckType,
  			HealthCheckHTTPEndpoint: healthCheckEndpoint,
  		})
  
  		allWarnings = append(allWarnings, Warnings(apiWarnings)...)
  		return Application(updatedApp), allWarnings, err
  	}
  
  	return app, allWarnings, nil
  }
docs: // SetApplicationHealthCheckTypeByNameAndSpace updates an application's health
  // check type if it is not already the desired type.