public Task <IApiResponse <OptimizeResult> > Optimize(byte[] image, string filename, IOptimizeSetUploadRequest optimizeRequest, CancellationToken cancellationToken) { filename.ThrowIfNullOrEmpty("filename"); var message = _connection.ExecuteUpload <OptimizeResult>(new KrakenApiRequest(optimizeRequest, "v1/upload"), image, filename, cancellationToken); return(message); }
public Task <IApiResponse <OptimizeResult> > Optimize(string filePath, IOptimizeSetUploadRequest optimizeRequest, CancellationToken cancellationToken) { filePath.ThrowIfNullOrEmpty("filePath"); if (!File.Exists(filePath)) { throw new FileNotFoundException(); } var file = File.ReadAllBytes(filePath); var message = _connection.ExecuteUpload <OptimizeResult>(new KrakenApiRequest(optimizeRequest, "v1/upload"), file, filePath, cancellationToken); return(message); }
public Task <IApiResponse <OptimizeResult> > Optimize(string filePath, IOptimizeSetUploadRequest optimizeRequest) { return(Optimize(filePath, optimizeRequest, default(CancellationToken))); }
public Task <IApiResponse <OptimizeResult> > Optimize(byte[] image, string filename, IOptimizeSetUploadRequest optimizeRequest) { return(Optimize(image, filename, optimizeRequest, default(CancellationToken))); }