Returns the parameter if it is a destination, calls getDestination otherwise (which will try to fetch the destination
from the Cloud Foundry destination service).
Fetching a destination requires:
A binding to exactly one XSUAA service instance with service plan "application".
A binding to a destination service instance.
If either of the prerequisites is not met or one of the services returns an error, this function will either throw an error or return a promise that rejects.
Returns
A promise resolving to the requested destination on success.
Returns the parameter if it is a destination, calls getDestination otherwise (which will try to fetch the destination from the Cloud Foundry destination service).
Fetching a destination requires:
If either of the prerequisites is not met or one of the services returns an error, this function will either throw an error or return a promise that rejects.
Returns
A promise resolving to the requested destination on success.