package downloader

import (
	

	

	
)

var errHashesNotSupported = errors.New("this schema does not support hashes fetch")

// web is a web file download schema.
// See https://core.telegram.org/api/files#downloading-webfiles.
type web struct {
	client Client
	// retryHandler observes retried transient downloader errors.
	retryHandler RetryHandler

	location tg.InputWebFileLocationClass
}

var _ schema = web{}

func ( web) ( string,  int,  error) {
	if  < 1 ||  == nil || .retryHandler == nil {
		return
	}
	.retryHandler(RetryEvent{
		Operation: ,
		Attempt:   ,
		Err:       ,
	})
}

func ( web) ( context.Context,  int64,  int) (chunk, error) {
	,  := .client.UploadGetWebFile(, &tg.UploadGetWebFileRequest{
		Location: .location,
		Offset:   int(),
		Limit:    ,
	})
	if  != nil {
		return chunk{}, 
	}

	return chunk{data: .Bytes, tag: .FileType}, nil
}

func ( web) ( context.Context,  int64) ([]tg.FileHash, error) {
	return nil, errHashesNotSupported
}