pub struct ScanApi { /* private fields */ }Expand description
Veracode Scan API operations
Implementations§
Source§impl ScanApi
impl ScanApi
Sourcepub fn new(client: VeracodeClient) -> Self
pub fn new(client: VeracodeClient) -> Self
Create a new ScanApi instance
Sourcepub async fn upload_file(
&self,
request: &UploadFileRequest,
) -> Result<UploadedFile, ScanError>
pub async fn upload_file( &self, request: &UploadFileRequest, ) -> Result<UploadedFile, ScanError>
Sourcepub async fn upload_large_file(
&self,
request: UploadLargeFileRequest,
) -> Result<UploadedFile, ScanError>
pub async fn upload_large_file( &self, request: UploadLargeFileRequest, ) -> Result<UploadedFile, ScanError>
Upload a large file using the uploadlargefile.do endpoint
This method uploads large files (up to 2GB) to an existing build. Unlike uploadfile.do, this endpoint requires a build to exist before uploading. It automatically creates a build if one doesn’t exist.
§Arguments
request- The upload large file request
§Returns
A Result containing the uploaded file information or an error.
Sourcepub async fn upload_large_file_with_progress<F>(
&self,
request: UploadLargeFileRequest,
progress_callback: F,
) -> Result<UploadedFile, ScanError>
pub async fn upload_large_file_with_progress<F>( &self, request: UploadLargeFileRequest, progress_callback: F, ) -> Result<UploadedFile, ScanError>
Upload a large file with progress tracking
This method provides the same functionality as upload_large_file but with progress tracking capabilities through a callback function.
§Arguments
request- The upload large file requestprogress_callback- Callback function for progress updates (bytes_uploaded, total_bytes, percentage)
§Returns
A Result containing the uploaded file information or an error.
Sourcepub async fn upload_file_smart(
&self,
request: &UploadFileRequest,
) -> Result<UploadedFile, ScanError>
pub async fn upload_file_smart( &self, request: &UploadFileRequest, ) -> Result<UploadedFile, ScanError>
Intelligently choose between uploadfile.do and uploadlargefile.do
This method automatically selects the appropriate upload endpoint based on file size and other factors, similar to the Java API wrapper behavior.
§Arguments
request- The upload file request (converted to appropriate format)
§Returns
A Result containing the uploaded file information or an error.
Sourcepub async fn begin_prescan(
&self,
request: &BeginPreScanRequest,
) -> Result<(), ScanError>
pub async fn begin_prescan( &self, request: &BeginPreScanRequest, ) -> Result<(), ScanError>
Sourcepub async fn get_prescan_results(
&self,
app_id: &str,
sandbox_id: Option<&str>,
build_id: Option<&str>,
) -> Result<PreScanResults, ScanError>
pub async fn get_prescan_results( &self, app_id: &str, sandbox_id: Option<&str>, build_id: Option<&str>, ) -> Result<PreScanResults, ScanError>
Sourcepub async fn begin_scan(
&self,
request: &BeginScanRequest,
) -> Result<(), ScanError>
pub async fn begin_scan( &self, request: &BeginScanRequest, ) -> Result<(), ScanError>
Sourcepub async fn get_file_list(
&self,
app_id: &str,
sandbox_id: Option<&str>,
build_id: Option<&str>,
) -> Result<Vec<UploadedFile>, ScanError>
pub async fn get_file_list( &self, app_id: &str, sandbox_id: Option<&str>, build_id: Option<&str>, ) -> Result<Vec<UploadedFile>, ScanError>
Sourcepub async fn remove_file(
&self,
app_id: &str,
file_id: &str,
sandbox_id: Option<&str>,
) -> Result<(), ScanError>
pub async fn remove_file( &self, app_id: &str, file_id: &str, sandbox_id: Option<&str>, ) -> Result<(), ScanError>
Sourcepub async fn delete_build(
&self,
app_id: &str,
build_id: &str,
sandbox_id: Option<&str>,
) -> Result<(), ScanError>
pub async fn delete_build( &self, app_id: &str, build_id: &str, sandbox_id: Option<&str>, ) -> Result<(), ScanError>
Sourcepub async fn delete_all_builds(
&self,
app_id: &str,
sandbox_id: Option<&str>,
) -> Result<(), ScanError>
pub async fn delete_all_builds( &self, app_id: &str, sandbox_id: Option<&str>, ) -> Result<(), ScanError>
Source§impl ScanApi
Convenience methods for common scan operations
impl ScanApi
Convenience methods for common scan operations
Sourcepub async fn upload_file_to_sandbox(
&self,
app_id: &str,
file_path: &str,
sandbox_id: &str,
) -> Result<UploadedFile, ScanError>
pub async fn upload_file_to_sandbox( &self, app_id: &str, file_path: &str, sandbox_id: &str, ) -> Result<UploadedFile, ScanError>
Sourcepub async fn upload_file_to_app(
&self,
app_id: &str,
file_path: &str,
) -> Result<UploadedFile, ScanError>
pub async fn upload_file_to_app( &self, app_id: &str, file_path: &str, ) -> Result<UploadedFile, ScanError>
Sourcepub async fn upload_large_file_to_sandbox(
&self,
app_id: &str,
file_path: &str,
sandbox_id: &str,
filename: Option<&str>,
) -> Result<UploadedFile, ScanError>
pub async fn upload_large_file_to_sandbox( &self, app_id: &str, file_path: &str, sandbox_id: &str, filename: Option<&str>, ) -> Result<UploadedFile, ScanError>
Sourcepub async fn upload_large_file_to_app(
&self,
app_id: &str,
file_path: &str,
filename: Option<&str>,
) -> Result<UploadedFile, ScanError>
pub async fn upload_large_file_to_app( &self, app_id: &str, file_path: &str, filename: Option<&str>, ) -> Result<UploadedFile, ScanError>
Sourcepub async fn upload_large_file_to_sandbox_with_progress<F>(
&self,
app_id: &str,
file_path: &str,
sandbox_id: &str,
filename: Option<&str>,
progress_callback: F,
) -> Result<UploadedFile, ScanError>
pub async fn upload_large_file_to_sandbox_with_progress<F>( &self, app_id: &str, file_path: &str, sandbox_id: &str, filename: Option<&str>, progress_callback: F, ) -> Result<UploadedFile, ScanError>
Upload a large file with progress tracking to a sandbox
§Arguments
app_id- The application IDfile_path- Path to the file to uploadsandbox_id- The sandbox IDfilename- Optional filename for flaw matchingprogress_callback- Callback for progress updates
§Returns
A Result containing the uploaded file information or an error.