pub struct Client { /* private fields */ }Expand description
Client for Quality Backend API
API for Quality Backend application
Version: 1.0.0
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
pub fn new(baseurl: &str) -> Self
Create a new client.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client,
allowing more control over its configuration.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Source§impl Client
impl Client
Sourcepub fn list_coverage_reports_coverage_projects_project_id_reports_get(
&self,
) -> ListCoverageReportsCoverageProjectsProjectIdReportsGet<'_>
pub fn list_coverage_reports_coverage_projects_project_id_reports_get( &self, ) -> ListCoverageReportsCoverageProjectsProjectIdReportsGet<'_>
List Coverage Reports
List all coverage reports for a project.
Returns metadata about coverage reports (commit, branch, timestamp, etc.)
Sends a GET request to /coverage/projects/{project_id}/reports
Arguments:
project_id: Project IDbranch_name: Filter by branch name
let response = client.list_coverage_reports_coverage_projects_project_id_reports_get()
.project_id(project_id)
.branch_name(branch_name)
.send()
.await;Sourcepub fn receive_profiles_profiling_profiles_post(
&self,
) -> ReceiveProfilesProfilingProfilesPost<'_>
pub fn receive_profiles_profiling_profiles_post( &self, ) -> ReceiveProfilesProfilingProfilesPost<'_>
Receive Profiles
Receive profile data from quality-agent.
Authentication: Requires project API key in Authorization header:
Authorization: Bearer ivp_XXXXXX...Supports two content types:
- application/x-protobuf: Binary protobuf format (default, ~70% smaller)
- application/json: JSON format (for debugging)
Protobuf Format: Binary format defined in proto/profile.proto
JSON Format:
{
"profiles": [
{
"language": "python",
"source_file": "server.py",
"timestamp": "2024-01-15T12:00:00Z",
"static_analysis": {...},
"runtime_analysis": {...}
}
],
"reported_at": "2024-01-15T12:05:00Z",
"agent_version": "1.0.0"
}Sends a POST request to /profiling/profiles
let response = client.receive_profiles_profiling_profiles_post()
.send()
.await;Sourcepub fn register_upload_salt_tests_salt_post(
&self,
) -> RegisterUploadSaltTestsSaltPost<'_>
pub fn register_upload_salt_tests_salt_post( &self, ) -> RegisterUploadSaltTestsSaltPost<'_>
Register Upload Salt
Register a client-generated salt for anonymizing file paths in uploads.
If a salt already exists for this project+commit, returns the existing salt. Otherwise, stores the client-provided salt. This ensures:
- Client controls salt generation for trust guarantees
- All uploads for the same commit use the same salt
- Coverage data from different test types can be combined
- Test results can be correlated with coverage data
- File paths can be de-anonymized using the file tree
Sends a POST request to /tests/salt
Arguments:
commit_sha: Git commit SHAsalt: 64-character hex salt generated by client
let response = client.register_upload_salt_tests_salt_post()
.commit_sha(commit_sha)
.salt(salt)
.send()
.await;