/// <summary>Removes the specified interceptor from the list of execute interceptors.</summary> public void RemoveExecuteInterceptor(IHttpExecuteInterceptor interceptor) { lock (executeInterceptorsLock) { executeInterceptors.Remove(interceptor); } }
public Drive(IServiceAccountApplication saApp) { credential = DriveCredentialsService.GetServiceAccountCredential(saApp); service = DriveCredentialsService.GetService(saApp); application = saApp; }
/// <summary>Adds the specified interceptor to the list of execute interceptors.</summary> public void AddExecuteInterceptor(IHttpExecuteInterceptor interceptor) { lock (executeInterceptorsLock) { executeInterceptors.Add(interceptor); } }
public Drive(IUserCredentialApplication ucApp) { credential = DriveCredentialsService.GetUserCredential(ucApp); service = DriveCredentialsService.GetService(ucApp); application = ucApp; }
public static BaseClientService AddExecuteInterceptor( this BaseClientService service, IHttpExecuteInterceptor interceptor) { service.HttpClient.MessageHandler.AddExecuteInterceptor(interceptor); return(service); }
/// <summary> /// Add an unsuccessful response handler for this request only. /// </summary> /// <param name="handler">The unsuccessful response handler. Must not be <c>null</c>.</param> public void AddExecuteInterceptor(IHttpExecuteInterceptor handler) { handler.ThrowIfNull(nameof(handler)); if (_executeInterceptors == null) { _executeInterceptors = new List <IHttpExecuteInterceptor>(); } _executeInterceptors.Add(handler); }
public static ClientServiceRequest <TResponse> AddExecInterceptor <TResponse>( this ClientServiceRequest <TResponse> request, IHttpExecuteInterceptor interceptor) { var existingInterceptor = request.Service.HttpClient.MessageHandler.ExecuteInterceptors .FirstOrDefault(i => i.GetType().IsInstanceOfType(interceptor)); if (existingInterceptor != null) { request.Service.HttpClient.MessageHandler.RemoveExecuteInterceptor(existingInterceptor); } request.Service.HttpClient.MessageHandler.AddExecuteInterceptor(interceptor); return(request); }