code: function invalidateCachedEndpoints(response) {
    var error = response.error;
    var httpResponse = response.httpResponse;
    if (error &&
      (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)
    ) {
      var request = response.request;
      var operations = request.service.api.operations || {};
      var inputShape = operations[request.operation] ? operations[request.operation].input : undefined;
      var identifiers = marshallCustomIdentifiers(request, inputShape);
      var cacheKey = getCacheKey(request);
      if (Object.keys(identifiers).length > 0) {
        cacheKey = util.update(cacheKey, identifiers);
        if (operations[request.operation]) cacheKey.operation = operations[request.operation].name;
      }
      AWS.endpointCache.remove(cacheKey);
    }
  }
docs: If api call gets invalid endpoint exception, SDK should attempt to remove the invalid
  endpoint from cache.
  @api private