VeracodeWorkflow

Struct VeracodeWorkflow 

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

High-level workflow operations for Veracode platform

Implementations§

Source§

impl VeracodeWorkflow

Source

pub fn new(client: VeracodeClient) -> Self

Create a new workflow instance

Source

pub async fn execute_complete_workflow( &self, config: WorkflowConfig, ) -> WorkflowResult<WorkflowResultData>

Execute the complete XML API workflow

This method implements the full workflow:

  1. Check for application existence, create if not exist
  2. Handle access denied scenarios
  3. Check sandbox exists, if not create
  4. Handle access denied scenarios
  5. Upload multiple files to sandbox
  6. Start prescan with available options
§Arguments
  • config - Workflow configuration
§Returns

A Result containing the workflow result or an error.

Source

pub async fn ensure_app_and_sandbox( &self, app_name: &str, sandbox_name: &str, business_criticality: BusinessCriticality, ) -> WorkflowResult<(Application, Sandbox, String, String)>

Execute a simplified workflow with just application and sandbox creation

This method implements a subset of the full workflow for cases where you only need to ensure the application and sandbox exist.

§Arguments
  • app_name - Application name
  • sandbox_name - Sandbox name
  • business_criticality - Business criticality for new applications
§Returns

A Result containing application and sandbox information.

Source

pub async fn get_application_by_name( &self, app_name: &str, ) -> WorkflowResult<Application>

Get application by name with helpful error messages

§Arguments
  • app_name - Application name to search for
§Returns

A Result containing the application or an error.

Source

pub async fn get_sandbox_by_name( &self, app_guid: &str, sandbox_name: &str, ) -> WorkflowResult<Sandbox>

Get sandbox by name with helpful error messages

§Arguments
  • app_guid - Application GUID
  • sandbox_name - Sandbox name to search for
§Returns

A Result containing the sandbox or an error.

Source

pub async fn delete_sandbox_builds( &self, app_name: &str, sandbox_name: &str, ) -> WorkflowResult<()>

Delete all builds from a sandbox

This removes all uploaded files and scan data from the sandbox.

§Arguments
  • app_name - Application name
  • sandbox_name - Sandbox name
§Returns

A Result indicating success or an error.

Source

pub async fn delete_sandbox( &self, app_name: &str, sandbox_name: &str, ) -> WorkflowResult<()>

Delete a sandbox

This removes the sandbox and all its associated data.

§Arguments
  • app_name - Application name
  • sandbox_name - Sandbox name
§Returns

A Result indicating success or an error.

Source

pub async fn delete_application(&self, app_name: &str) -> WorkflowResult<()>

Delete an application

This removes the application and all its associated data including all sandboxes. Use with extreme caution as this is irreversible.

§Arguments
  • app_name - Application name
§Returns

A Result indicating success or an error.

Source

pub async fn complete_cleanup(&self, app_name: &str) -> WorkflowResult<()>

Complete cleanup workflow

This method performs a complete cleanup of an application and all its resources:

  1. Delete all builds from all sandboxes
  2. Delete all sandboxes
  3. Delete all application builds
  4. Delete the application
§Arguments
  • app_name - Application name to clean up
§Returns

A Result indicating success or an error.

Source

pub async fn ensure_build_exists( &self, app_id: &str, sandbox_id: Option<&str>, version: Option<&str>, ) -> WorkflowResult<Build>

Ensure a build exists for an application or sandbox

This method checks if a build exists and creates one if it doesn’t. This is required for uploadlargefile.do operations.

§Arguments
  • app_id - Application ID (numeric)
  • sandbox_id - Optional sandbox ID (numeric)
  • version - Optional build version
§Returns

A Result containing the build information or an error.

Source

pub async fn ensure_build_exists_with_policy( &self, app_id: &str, sandbox_id: Option<&str>, version: Option<&str>, deletion_policy: u8, ) -> WorkflowResult<Build>

Ensure a build exists for the application/sandbox with configurable deletion policy

This method checks if a build already exists and handles it according to the deletion policy:

  • Policy 0: Never delete builds, fail if build exists
  • Policy 1: Delete only “safe” builds (incomplete, failed, cancelled states)
  • Policy 2: Delete any build except “Results Ready”
§Arguments
  • app_id - Application ID (numeric)
  • sandbox_id - Optional sandbox ID (numeric)
  • version - Optional build version
  • deletion_policy - Build deletion policy level (0, 1, or 2)
§Returns

A Result containing the build information or an error.

Source

pub async fn upload_large_file_with_build_management( &self, app_id: &str, sandbox_id: Option<&str>, file_path: &str, filename: Option<&str>, version: Option<&str>, ) -> WorkflowResult<UploadedFile>

Upload a large file with automatic build management

This method ensures a build exists before attempting to use uploadlargefile.do. If no build exists, it creates one automatically.

§Arguments
  • app_id - Application ID (numeric)
  • sandbox_id - Optional sandbox ID (numeric)
  • file_path - Path to the file to upload
  • filename - Optional custom filename for flaw matching
  • version - Optional build version (auto-generated if not provided)
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn upload_large_file_with_progress_and_build_management<F>( &self, app_id: &str, sandbox_id: Option<&str>, file_path: &str, filename: Option<&str>, version: Option<&str>, progress_callback: F, ) -> WorkflowResult<UploadedFile>
where F: Fn(u64, u64, f64) + Send + Sync,

Upload a large file with progress tracking and build management

This method ensures a build exists before attempting to use uploadlargefile.do and provides progress tracking capabilities.

§Arguments
  • app_id - Application ID (numeric)
  • sandbox_id - Optional sandbox ID (numeric)
  • file_path - Path to the file to upload
  • filename - Optional custom filename for flaw matching
  • version - Optional build version (auto-generated if not provided)
  • progress_callback - Callback function for progress updates
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn upload_file_with_smart_build_management( &self, app_id: &str, sandbox_id: Option<&str>, file_path: &str, filename: Option<&str>, version: Option<&str>, ) -> WorkflowResult<UploadedFile>

Complete file upload workflow with intelligent endpoint selection and build management

This method automatically chooses between uploadfile.do and uploadlargefile.do based on file size and ensures builds exist when needed.

§Arguments
  • app_id - Application ID (numeric)
  • sandbox_id - Optional sandbox ID (numeric)
  • file_path - Path to the file to upload
  • filename - Optional custom filename
  • version - Optional build version
§Returns

A Result containing the uploaded file information or an error.

Source

pub async fn get_or_create_build( &self, app_id: &str, sandbox_id: Option<&str>, version: Option<&str>, ) -> WorkflowResult<Build>

Get or create a build for upload operations

This is a convenience method that handles the build dependency for upload operations.

§Arguments
  • app_id - Application ID (numeric)
  • sandbox_id - Optional sandbox ID (numeric)
  • version - Optional build version
§Returns

A Result containing the build information 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,