/// <summary> /// Initializes a new instance of the <see cref="AmazonDrive"/> class. /// </summary> /// <param name="clientId">Your Application ClientID. From Amazon Developers Console.</param> /// <param name="clientSecret">Your Application Secret. From Amazon Developers Console.</param> public AmazonDrive(string clientId, string clientSecret) { this.clientSecret = clientSecret; this.clientId = clientId; http = new Tools.HttpClient(SettingsSetter); http.AddRetryErrorProcessor(HttpStatusCode.Unauthorized, ProcessUnauthorized); http.AddRetryErrorProcessor(429, async(code) => { await Task.Delay(1000).ConfigureAwait(false); return(true); }); }
/// <summary> /// Initializes a new instance of the <see cref="AmazonDrive"/> class. /// </summary> /// <param name="clientId">Your Application ClientID. From Amazon Developers Console.</param> /// <param name="clientSecret">Your Application Secret. From Amazon Developers Console.</param> public AmazonDrive(string clientId, string clientSecret) { this.clientSecret = clientSecret; this.clientId = clientId; http = new HttpClient(SettingsSetter); http.AddRetryErrorProcessor(HttpStatusCode.Unauthorized, async (code) => { await UpdateToken().ConfigureAwait(false); return true; }); http.AddRetryErrorProcessor(429, async (code) => { await Task.Delay(1000).ConfigureAwait(false); return true; }); http.AddRetryErrorProcessor(HttpStatusCode.NotFound, (code) => Task.FromResult(false)); }
/// <summary> /// Initializes a new instance of the <see cref="AmazonDrive"/> class. /// </summary> /// <param name="clientId">Your Application ClientID. From Amazon Developers Console.</param> /// <param name="clientSecret">Your Application Secret. From Amazon Developers Console.</param> public AmazonDrive(string clientId, string clientSecret) { this.clientSecret = clientSecret; this.clientId = clientId; http = new HttpClient(SettingsSetter); http.AddRetryErrorProcessor(HttpStatusCode.Unauthorized, async(code) => { await UpdateToken().ConfigureAwait(false); return(true); }); http.AddRetryErrorProcessor(429, async(code) => { await Task.Delay(1000).ConfigureAwait(false); return(true); }); http.AddRetryErrorProcessor(HttpStatusCode.NotFound, (code) => Task.FromResult(false)); }