Methods for Session file and Agent code download "as_bytes" and "to_path". Add overwrite option when downloading to path.#47673
Open
dargilco wants to merge 15 commits into
Conversation
… into dargilco/agent-code-upload-download-to-file
… into dargilco/agent-code-upload-download-to-file
overwrite to session file downloadoverwrite option when downloading to path.
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.
This pull request refactors and expands the agent code and session file download APIs for both sync and async clients. It standardizes method names for clarity, adds new methods to support direct-to-disk downloads with overwrite protection and SHA-256 verification, and updates internal request builders to match the new API surface.
API changes and method renaming:
download_codetodownload_code_as_bytesanddownload_session_filetodownload_session_file_as_bytesin both sync and async clients for clarity and consistency. [1] [2] [3] [4] [5]build_agents_download_code_as_bytes_request,build_agents_download_session_file_as_bytes_request). [1] [2]New features:
download_code_to_pathanddownload_session_file_to_pathmethods to both clients, allowing direct download of agent code or session files to a specified file path with overwrite protection. These methods raise errors if the path exists and is a directory, or if the file exists andoverwrite=False. [1] [2] [3] [4]download_code_to_pathreturns the SHA-256 hex digest of the downloaded file for integrity verification.Documentation and metadata updates:
api.md,apiview-properties.json, andapi.metadata.ymlto reflect the new API surface and method mappings. [1] [2] [3]Internal improvements:
Dependency changes:
hashlibimport for SHA-256 checksum calculation in the new download-to-disk methods. [1] [2]