function discoverEndpoint(request, done) {
	  var service = request.service || {};
	  if (hasCustomEndpoint(service) || request.isPresigned()) return done();

	  var operations = service.api.operations || {};
	  var operationModel = operations[request.operation];
	  var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL';
	  var isEnabled = resolveEndpointDiscoveryConfig(request);
	  var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery;
	  if (isEnabled || hasRequiredEndpointDiscovery) {
	    // Once a customer enables endpoint discovery, the SDK should start appending
	    // the string endpoint-discovery to the user-agent on all requests.
	    request.httpRequest.appendToUserAgent('endpoint-discovery');
	  }
	  switch (isEndpointDiscoveryRequired) {
	    case 'OPTIONAL':
	      if (isEnabled || hasRequiredEndpointDiscovery) {
	        // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery
	        // by default for all operations of that service, including operations where endpoint discovery is optional.
	        optionalDiscoverEndpoint(request);
	        request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);
	      }
	      done();
	      break;
	    case 'REQUIRED':
	      if (isEnabled === false) {
	        // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client,
	        // then the SDK must return a clear and actionable exception.
	        request.response.error = util.error(new Error(), {
	          code: 'ConfigurationException',
	          message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation +
	                    '() requires it. Please check your configurations.'
	        });
	        done();
	        break;
	      }
	      request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);
	      requiredDiscoverEndpoint(request, done);
	      break;
	    case 'NULL':
	    default:
	      done();
	      break;
	  }
	}
attach endpoint discovery logic to request object
@param [object] request
@api private