pub struct VeracodeWorkflow { /* private fields */ }
Expand description
High-level workflow operations for Veracode platform
Implementations§
Source§impl VeracodeWorkflow
impl VeracodeWorkflow
Sourcepub fn new(client: VeracodeClient) -> Self
pub fn new(client: VeracodeClient) -> Self
Create a new workflow instance
Sourcepub async fn execute_complete_workflow(
&self,
config: WorkflowConfig,
) -> WorkflowResult<WorkflowResultData>
pub async fn execute_complete_workflow( &self, config: WorkflowConfig, ) -> WorkflowResult<WorkflowResultData>
Execute the complete XML API workflow
This method implements the full workflow:
- Check for application existence, create if not exist
- Handle access denied scenarios
- Check sandbox exists, if not create
- Handle access denied scenarios
- Upload multiple files to sandbox
- Start prescan with available options
§Arguments
config
- Workflow configuration
§Returns
A Result
containing the workflow result or an error.
Sourcepub async fn ensure_app_and_sandbox(
&self,
app_name: &str,
sandbox_name: &str,
business_criticality: BusinessCriticality,
) -> WorkflowResult<(Application, Sandbox, String, String)>
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 namesandbox_name
- Sandbox namebusiness_criticality
- Business criticality for new applications
§Returns
A Result
containing application and sandbox information.
Sourcepub async fn get_application_by_name(
&self,
app_name: &str,
) -> WorkflowResult<Application>
pub async fn get_application_by_name( &self, app_name: &str, ) -> WorkflowResult<Application>
Sourcepub async fn get_sandbox_by_name(
&self,
app_guid: &str,
sandbox_name: &str,
) -> WorkflowResult<Sandbox>
pub async fn get_sandbox_by_name( &self, app_guid: &str, sandbox_name: &str, ) -> WorkflowResult<Sandbox>
Sourcepub async fn delete_sandbox_builds(
&self,
app_name: &str,
sandbox_name: &str,
) -> WorkflowResult<()>
pub async fn delete_sandbox_builds( &self, app_name: &str, sandbox_name: &str, ) -> WorkflowResult<()>
Sourcepub async fn delete_sandbox(
&self,
app_name: &str,
sandbox_name: &str,
) -> WorkflowResult<()>
pub async fn delete_sandbox( &self, app_name: &str, sandbox_name: &str, ) -> WorkflowResult<()>
Sourcepub async fn delete_application(&self, app_name: &str) -> WorkflowResult<()>
pub async fn delete_application(&self, app_name: &str) -> WorkflowResult<()>
Sourcepub async fn complete_cleanup(&self, app_name: &str) -> WorkflowResult<()>
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:
- Delete all builds from all sandboxes
- Delete all sandboxes
- Delete all application builds
- Delete the application
§Arguments
app_name
- Application name to clean up
§Returns
A Result
indicating success or an error.
Sourcepub async fn ensure_build_exists(
&self,
app_id: &str,
sandbox_id: Option<&str>,
version: Option<&str>,
) -> WorkflowResult<Build>
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.
Sourcepub async fn ensure_build_exists_with_policy(
&self,
app_id: &str,
sandbox_id: Option<&str>,
version: Option<&str>,
deletion_policy: u8,
) -> WorkflowResult<Build>
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 versiondeletion_policy
- Build deletion policy level (0, 1, or 2)
§Returns
A Result
containing the build information or an error.
Sourcepub 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>
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 uploadfilename
- Optional custom filename for flaw matchingversion
- Optional build version (auto-generated if not provided)
§Returns
A Result
containing the uploaded file information or an error.
Sourcepub 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>
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>
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 uploadfilename
- Optional custom filename for flaw matchingversion
- 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.
Sourcepub 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>
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 uploadfilename
- Optional custom filenameversion
- Optional build version
§Returns
A Result
containing the uploaded file information or an error.
Sourcepub async fn get_or_create_build(
&self,
app_id: &str,
sandbox_id: Option<&str>,
version: Option<&str>,
) -> WorkflowResult<Build>
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.