pub struct ApplicationQuery {
pub name: Option<String>,
pub policy_compliance: Option<String>,
pub modified_after: Option<String>,
pub modified_before: Option<String>,
pub created_after: Option<String>,
pub created_before: Option<String>,
pub scan_type: Option<String>,
pub tags: Option<String>,
pub business_unit: Option<String>,
pub page: Option<u32>,
pub size: Option<u32>,
}Expand description
Query parameters for filtering applications.
Fields§
§name: Option<String>Filter by application name (partial match)
policy_compliance: Option<String>Filter by policy compliance status (PASSED, DID_NOT_PASS, etc.)
modified_after: Option<String>Filter applications modified after this date (ISO 8601 format)
modified_before: Option<String>Filter applications modified before this date (ISO 8601 format)
created_after: Option<String>Filter applications created after this date (ISO 8601 format)
created_before: Option<String>Filter applications created before this date (ISO 8601 format)
scan_type: Option<String>Filter by scan type (STATIC, DYNAMIC, MANUAL, SCA)
Filter by tags (comma-separated)
business_unit: Option<String>Filter by business unit name
page: Option<u32>Page number for pagination (0-based)
size: Option<u32>Number of items per page (default: 20, max: 500)
Implementations§
Source§impl ApplicationQuery
impl ApplicationQuery
Sourcepub fn with_policy_compliance(self, compliance: &str) -> Self
pub fn with_policy_compliance(self, compliance: &str) -> Self
Filter applications by policy compliance status.
Sourcepub fn with_modified_after(self, date: &str) -> Self
pub fn with_modified_after(self, date: &str) -> Self
Filter applications modified after the specified date.
Sourcepub fn with_modified_before(self, date: &str) -> Self
pub fn with_modified_before(self, date: &str) -> Self
Filter applications modified before the specified date.
Sourcepub fn normalize(self) -> Result<Self, ValidationError>
pub fn normalize(self) -> Result<Self, ValidationError>
Normalize and validate pagination parameters.
This method ensures that pagination parameters are within safe bounds
to prevent resource exhaustion attacks. It uses the library-wide
validation functions from the validation module.
§Behavior
- Sets default page size if not specified
- Rejects page size of 0
- Caps page size at maximum with warning
- Caps page number at maximum with warning
§Returns
A Result containing the normalized query or a ValidationError.
§Errors
Returns an error if the page size is 0.
§Security
This method prevents DoS attacks from unbounded pagination requests.
Sourcepub fn to_query_params(&self) -> Vec<(String, String)>
pub fn to_query_params(&self) -> Vec<(String, String)>
Convert the query to URL query parameters.
Trait Implementations§
Source§impl Clone for ApplicationQuery
impl Clone for ApplicationQuery
Source§fn clone(&self) -> ApplicationQuery
fn clone(&self) -> ApplicationQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ApplicationQuery
impl Debug for ApplicationQuery
Source§impl Default for ApplicationQuery
impl Default for ApplicationQuery
Source§fn default() -> ApplicationQuery
fn default() -> ApplicationQuery
Source§impl From<&ApplicationQuery> for Vec<(String, String)>
Convert ApplicationQuery to query parameters by borrowing (allows reuse)
impl From<&ApplicationQuery> for Vec<(String, String)>
Convert ApplicationQuery to query parameters by borrowing (allows reuse)
§Security
All query parameter values are properly URL-encoded to prevent injection attacks.
Source§fn from(query: &ApplicationQuery) -> Self
fn from(query: &ApplicationQuery) -> Self
Source§impl From<ApplicationQuery> for Vec<(String, String)>
Convert ApplicationQuery to query parameters by consuming (better performance)
impl From<ApplicationQuery> for Vec<(String, String)>
Convert ApplicationQuery to query parameters by consuming (better performance)
§Security
All query parameter values are properly URL-encoded to prevent injection attacks.