Added DownloadAsset methods to ReleaseClient#3039
Open
DiegoG1019 wants to merge 2 commits intooctokit:mainfrom
Open
Added DownloadAsset methods to ReleaseClient#3039DiegoG1019 wants to merge 2 commits intooctokit:mainfrom
DownloadAsset methods to ReleaseClient#3039DiegoG1019 wants to merge 2 commits intooctokit:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #3038
Before the change?
Currently, to download a Release Asset, one would need to delve into ApiConnection and Connection objects, get a byte[] array and manually set the Accept header
It's bulky, and not much documentation is available for this
After the change?
Two new easily discoverable methods are present in ReleaseClient:
Task<Stream> DownloadAsset(long, long)andTask<Stream> DownloadAsset(string, string, long)Even if no documentation is available, any good enough IDE can allow a programmer to discover the two methods and use them
I reviewed the tests but was unable to find a relevant test to modify -- The download uses the same string building techniques the rest of the API uses and that the tests try for
I did test it on my own machine, but didn't want to pollute the Tests set with file download tests when none are present (that I could find) even for obtaining response results
Pull request checklist
Does this introduce a breaking change?
No breaking changes, lengths were taken to exclusively add and not modify nor remove
I'd like to additionally include that I didn't deem it necessary to update the documentation, but if there's anything that I missed, misunderstood, or that is pending for me to include, I would greatly appreciate being told, and I'll gladly do it!