Struct ScanApi

Source
pub struct ScanApi { /* private fields */ }
Expand description

Veracode Scan API operations

Implementations§

Source§

impl ScanApi

Source

pub fn new(client: VeracodeClient) -> Self

Create a new ScanApi instance

Source

pub async fn upload_file( &self, request: UploadFileRequest, ) -> Result<UploadedFile, ScanError>

Upload a file to an application or sandbox

§Arguments
  • request - The upload file request
§Returns

A Result containing the uploaded file information or an error.

Source

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.

Source

pub async fn upload_large_file_with_progress<F>( &self, request: UploadLargeFileRequest, progress_callback: F, ) -> Result<UploadedFile, ScanError>
where F: Fn(u64, u64, f64) + Send + Sync,

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 request
  • progress_callback - Callback function for progress updates (bytes_uploaded, total_bytes, percentage)
§Returns

A Result containing the uploaded file information or an error.

Source

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.

Source

pub async fn begin_prescan( &self, request: BeginPreScanRequest, ) -> Result<(), ScanError>

Begin pre-scan for an application or sandbox

§Arguments
  • request - The pre-scan request
§Returns

A Result indicating success or an error.

Source

pub async fn get_prescan_results( &self, app_id: &str, sandbox_id: Option<&str>, build_id: Option<&str>, ) -> Result<PreScanResults, ScanError>

Get pre-scan results for an application or sandbox

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID (optional)
  • build_id - The build ID (optional)
§Returns

A Result containing the pre-scan results or an error.

Source

pub async fn begin_scan( &self, request: BeginScanRequest, ) -> Result<(), ScanError>

Begin scan for an application or sandbox

§Arguments
  • request - The scan request
§Returns

A Result indicating success or an error.

Source

pub async fn get_file_list( &self, app_id: &str, sandbox_id: Option<&str>, build_id: Option<&str>, ) -> Result<Vec<UploadedFile>, ScanError>

Get list of uploaded files for an application or sandbox

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID (optional)
  • build_id - The build ID (optional)
§Returns

A Result containing the list of uploaded files or an error.

Source

pub async fn remove_file( &self, app_id: &str, file_id: &str, sandbox_id: Option<&str>, ) -> Result<(), ScanError>

Remove a file from an application or sandbox

§Arguments
  • app_id - The application ID
  • file_id - The file ID to remove
  • sandbox_id - The sandbox ID (optional)
§Returns

A Result indicating success or an error.

Source

pub async fn delete_build( &self, app_id: &str, build_id: &str, sandbox_id: Option<&str>, ) -> Result<(), ScanError>

Delete a build from an application or sandbox

This removes all uploaded files and scan data for a specific build.

§Arguments
  • app_id - The application ID
  • build_id - The build ID to delete
  • sandbox_id - The sandbox ID (optional)
§Returns

A Result indicating success or an error.

Source

pub async fn delete_all_builds( &self, app_id: &str, sandbox_id: Option<&str>, ) -> Result<(), ScanError>

Delete all builds for an application or sandbox

This removes all uploaded files and scan data for all builds. Use with caution as this is irreversible.

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID (optional)
§Returns

A Result indicating success or an error.

Source

pub async fn get_build_info( &self, app_id: &str, build_id: Option<&str>, sandbox_id: Option<&str>, ) -> Result<ScanInfo, ScanError>

Get build information for an application or sandbox

§Arguments
  • app_id - The application ID
  • build_id - The build ID (optional)
  • sandbox_id - The sandbox ID (optional)
§Returns

A Result containing the scan information or an error.

Source§

impl ScanApi

Convenience methods for common scan operations

Source

pub async fn upload_file_to_sandbox( &self, app_id: &str, file_path: &str, sandbox_id: &str, ) -> Result<UploadedFile, ScanError>

Upload a file to a sandbox with simple parameters

§Arguments
  • app_id - The application ID
  • file_path - Path to the file to upload
  • sandbox_id - The sandbox ID
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn upload_file_to_app( &self, app_id: &str, file_path: &str, ) -> Result<UploadedFile, ScanError>

Upload a file to an application (non-sandbox)

§Arguments
  • app_id - The application ID
  • file_path - Path to the file to upload
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn upload_large_file_to_sandbox( &self, app_id: &str, file_path: &str, sandbox_id: &str, filename: Option<&str>, ) -> Result<UploadedFile, ScanError>

Upload a large file to a sandbox using uploadlargefile.do

§Arguments
  • app_id - The application ID
  • file_path - Path to the file to upload
  • sandbox_id - The sandbox ID
  • filename - Optional filename for flaw matching
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn upload_large_file_to_app( &self, app_id: &str, file_path: &str, filename: Option<&str>, ) -> Result<UploadedFile, ScanError>

Upload a large file to an application using uploadlargefile.do

§Arguments
  • app_id - The application ID
  • file_path - Path to the file to upload
  • filename - Optional filename for flaw matching
§Returns

A Result containing the uploaded file information or an error.

Source

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>
where F: Fn(u64, u64, f64) + Send + Sync,

Upload a large file with progress tracking to a sandbox

§Arguments
  • app_id - The application ID
  • file_path - Path to the file to upload
  • sandbox_id - The sandbox ID
  • filename - Optional filename for flaw matching
  • progress_callback - Callback for progress updates
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn begin_sandbox_prescan( &self, app_id: &str, sandbox_id: &str, ) -> Result<(), ScanError>

Begin a simple pre-scan for a sandbox

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID
§Returns

A Result containing the build ID or an error.

Source

pub async fn begin_sandbox_scan_all_modules( &self, app_id: &str, sandbox_id: &str, ) -> Result<(), ScanError>

Begin a simple scan for a sandbox with all modules

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID
§Returns

A Result containing the build ID or an error.

Source

pub async fn upload_and_scan_sandbox( &self, app_id: &str, sandbox_id: &str, file_path: &str, ) -> Result<String, ScanError>

Complete workflow: upload file, pre-scan, and begin scan for sandbox

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID
  • file_path - Path to the file to upload
§Returns

A Result containing the scan build ID or an error.

Source

pub async fn delete_sandbox_build( &self, app_id: &str, build_id: &str, sandbox_id: &str, ) -> Result<(), ScanError>

Delete a build from a sandbox

§Arguments
  • app_id - The application ID
  • build_id - The build ID to delete
  • sandbox_id - The sandbox ID
§Returns

A Result indicating success or an error.

Source

pub async fn delete_all_sandbox_builds( &self, app_id: &str, sandbox_id: &str, ) -> Result<(), ScanError>

Delete all builds from a sandbox

§Arguments
  • app_id - The application ID
  • sandbox_id - The sandbox ID
§Returns

A Result indicating success or an error.

Source

pub async fn delete_app_build( &self, app_id: &str, build_id: &str, ) -> Result<(), ScanError>

Delete a build from an application (non-sandbox)

§Arguments
  • app_id - The application ID
  • build_id - The build ID to delete
§Returns

A Result indicating success or an error.

Source

pub async fn delete_all_app_builds(&self, app_id: &str) -> Result<(), ScanError>

Delete all builds from an application (non-sandbox)

§Arguments
  • app_id - The application ID
§Returns

A Result indicating success or an error.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,