/*
* CrowdStrike API Specification
*
* Use this API specification as a reference for the API endpoints you can use to interact with your Falcon environment. These endpoints support authentication via OAuth2 and interact with detections and network containment. For detailed usage guides and examples, see our [documentation inside the Falcon console](https://falcon.crowdstrike.com/support/documentation). To use the APIs described below, combine the base URL with the path shown for each API endpoint. For commercial cloud customers, your base URL is `https://api.crowdstrike.com`. Each API endpoint requires authorization via an OAuth2 token. Your first API request should retrieve an OAuth2 token using the `oauth2/token` endpoint, such as `https://api.crowdstrike.com/oauth2/token`. For subsequent requests, include the OAuth2 token in an HTTP authorization header. Tokens expire after 30 minutes, after which you should make a new token request to continue making API requests.
*
* The version of the OpenAPI document: rolling
*
* Generated by: https://openapi-generator.tech
*/
use super::{ContentType, Error, configuration};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::de::Error as _;
/// struct for typed errors of method [`create_executor_node`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateExecutorNodeError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_integration`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateIntegrationError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_integration_task`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateIntegrationTaskError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_executor_node`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteExecutorNodeError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_integration`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIntegrationError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_integration_task`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIntegrationTaskError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketError
{
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_tags`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteTagsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_function_data`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionDataError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_function_data_count`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionDataCountError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_function_data_query`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionDataQueryError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_function_data_query_count`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionDataQueryCountError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_functions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_functions_count`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionsCountError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_functions_overtime`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionsOvertimeError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_functions_query`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionsQueryError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_functions_query_count`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionsQueryCountError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_functions_query_overtime`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteFunctionsQueryOvertimeError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`execute_query`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecuteQueryError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_cloud_security_integration_state`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCloudSecurityIntegrationStateError {
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_cspm_inventory_ba_services`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCspmInventoryBaServicesError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_cspm_inventory_service_details`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCspmInventoryServiceDetailsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_executor_nodes`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutorNodesError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_executor_nodes_metadata`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutorNodesMetadataError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integration_tasks`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationTasksError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integration_tasks_admin`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationTasksAdminError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integration_tasks_metadata`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationTasksMetadataError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integration_tasks_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationTasksV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integration_types`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationTypesError {
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integrations`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_integrations_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIntegrationsV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_service_artifacts`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetServiceArtifactsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_service_violation_types`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetServiceViolationTypesError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_services_count`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetServicesCountError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_slash_executor_nodes_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_instances_slash_csv`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSlashExecutorNodesSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashInstancesSlashCsvError
{
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashV2Error
{
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_slash_groups_slash_hier_slash_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSlashGroupsSlashHierSlashV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_slash_groups_slash_list_slash_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSlashGroupsSlashListSlashV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_slash_users_slash_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSlashUsersSlashV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_tags`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTagsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_update_default`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashUpdateDefaultError
{
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashV2Error
{
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_slash_group_slash_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostSlashGroupSlashV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`run_integration_task`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RunIntegrationTaskError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`run_integration_task_admin`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RunIntegrationTaskAdminError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`run_integration_task_v2`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RunIntegrationTaskV2Error {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`service_now_get_deployments`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ServiceNowGetDeploymentsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`service_now_get_services`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ServiceNowGetServicesError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`set_cloud_security_integration_state`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SetCloudSecurityIntegrationStateError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_executor_node`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateExecutorNodeError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_integration`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateIntegrationError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_integration_task`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateIntegrationTaskError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`upsert_business_applications`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpsertBusinessApplicationsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`upsert_tags`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpsertTagsError {
Status400(models::TypesErrorMessage),
Status401(models::TypesErrorMessage),
Status403(models::TypesErrorMessage),
Status429(models::MsaReplyMetaOnly),
Status500(models::MsaReplyMetaOnly),
Status503(models::TypesErrorMessage),
UnknownValue(serde_json::Value),
}
pub async fn create_executor_node(
configuration: &configuration::Configuration,
body: models::TypesExecutorNode,
) -> Result<models::TypesExecutorNode, Error<CreateExecutorNodeError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/executor_nodes",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesExecutorNode`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesExecutorNode`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<CreateExecutorNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn create_integration(
configuration: &configuration::Configuration,
body: models::TypesCreateIntegrationRequest,
) -> Result<models::TypesCreateIntegrationResponse, Error<CreateIntegrationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integrations",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesCreateIntegrationResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesCreateIntegrationResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<CreateIntegrationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn create_integration_task(
configuration: &configuration::Configuration,
body: models::TypesCreateIntegrationTaskRequest,
) -> Result<models::TypesIntegrationTaskResponse, Error<CreateIntegrationTaskError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesIntegrationTaskResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesIntegrationTaskResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<CreateIntegrationTaskError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn delete_executor_node(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<DeleteExecutorNodeError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/executor_nodes/{ID}",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteExecutorNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn delete_integration(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<DeleteIntegrationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integrations/{ID}",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteIntegrationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn delete_integration_task(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<DeleteIntegrationTaskError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/{ID}",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteIntegrationTaskError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn delete_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket(configuration: &configuration::Configuration, id: i32) -> Result<(), Error<DeleteSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketError>>{
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/group/{ID}",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn delete_tags(
configuration: &configuration::Configuration,
body: models::TypesEditTagRequest,
) -> Result<(), Error<DeleteTagsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!("{}/aspm-api-gateway/api/v1/tags", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteTagsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_function_data(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesGeneralQueryResponse, Error<ExecuteFunctionDataError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/combined/function-data/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGeneralQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGeneralQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_function_data_count(
configuration: &configuration::Configuration,
query_name: &str,
cloud_provider: &str,
aws_lambda_arn: Option<&str>,
gcp_cloud_function_url: Option<&str>,
azure_site_subscription_id: Option<&str>,
azure_site_resource_group: Option<&str>,
azure_function_app_name: Option<&str>,
) -> Result<models::TypesCountResponse, Error<ExecuteFunctionDataCountError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_query_name = query_name;
let p_query_cloud_provider = cloud_provider;
let p_query_aws_lambda_arn = aws_lambda_arn;
let p_query_gcp_cloud_function_url = gcp_cloud_function_url;
let p_query_azure_site_subscription_id = azure_site_subscription_id;
let p_query_azure_site_resource_group = azure_site_resource_group;
let p_query_azure_function_app_name = azure_function_app_name;
let uri_str = format!(
"{}/application-security/aggregates/function-data/count/v1",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("query_name", &p_query_query_name.to_string())]);
req_builder = req_builder.query(&[("cloud_provider", &p_query_cloud_provider.to_string())]);
if let Some(ref param_value) = p_query_aws_lambda_arn {
req_builder = req_builder.query(&[("aws_lambda_arn", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_gcp_cloud_function_url {
req_builder = req_builder.query(&[("gcp_cloud_function_url", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_azure_site_subscription_id {
req_builder =
req_builder.query(&[("azure_site_subscription_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_azure_site_resource_group {
req_builder = req_builder.query(&[("azure_site_resource_group", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_azure_function_app_name {
req_builder = req_builder.query(&[("azure_function_app_name", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesCountResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesCountResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionDataCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_function_data_query(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesGeneralQueryResponse, Error<ExecuteFunctionDataQueryError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/combined/query-function-data/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGeneralQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGeneralQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionDataQueryError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_function_data_query_count(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesCountResponse, Error<ExecuteFunctionDataQueryCountError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/aggregates/query-function-data-count/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesCountResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesCountResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionDataQueryCountError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_functions(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesGeneralQueryResponse, Error<ExecuteFunctionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/combined/functions/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGeneralQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGeneralQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_functions_count(
configuration: &configuration::Configuration,
query_name: &str,
cloud_provider: Option<Vec<String>>,
cloud_account_id: Option<Vec<String>>,
region: Option<Vec<String>>,
cid: Option<Vec<String>>,
) -> Result<models::TypesCountResponse, Error<ExecuteFunctionsCountError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_query_name = query_name;
let p_query_cloud_provider = cloud_provider;
let p_query_cloud_account_id = cloud_account_id;
let p_query_region = region;
let p_query_cid = cid;
let uri_str = format!(
"{}/application-security/aggregates/functions/count/v1",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("query_name", &p_query_query_name.to_string())]);
if let Some(ref param_value) = p_query_cloud_provider {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("cloud_provider".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"cloud_provider",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_cloud_account_id {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("cloud_account_id".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"cloud_account_id",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_region {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("region".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"region",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_cid {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("cid".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"cid",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesCountResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesCountResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionsCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_functions_overtime(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesOvertimeResponse, Error<ExecuteFunctionsOvertimeError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/combined/functions-overtime/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesOvertimeResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesOvertimeResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionsOvertimeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_functions_query(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesGeneralQueryResponse, Error<ExecuteFunctionsQueryError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/combined/query-functions/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGeneralQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGeneralQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionsQueryError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_functions_query_count(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesCountResponse, Error<ExecuteFunctionsQueryCountError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/aggregates/query-functions-count/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesCountResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesCountResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionsQueryCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_functions_query_overtime(
configuration: &configuration::Configuration,
field: &str,
) -> Result<models::TypesOvertimeResponse, Error<ExecuteFunctionsQueryOvertimeError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_field = field;
let uri_str = format!(
"{}/application-security/combined/query-functions-overtime/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("field", &p_query_field.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesOvertimeResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesOvertimeResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteFunctionsQueryOvertimeError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn execute_query(
configuration: &configuration::Configuration,
body: models::TypesQueryRequest,
) -> Result<models::TypesQueryResponse, Error<ExecuteQueryError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!("{}/aspm-api-gateway/api/v1/query", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ExecuteQueryError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_cloud_security_integration_state(
configuration: &configuration::Configuration,
) -> Result<
models::TypesGetCloudSecurityIntegrationStateResponse,
Error<GetCloudSecurityIntegrationStateError>,
> {
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/cloud_security_config",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGetCloudSecurityIntegrationStateResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGetCloudSecurityIntegrationStateResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetCloudSecurityIntegrationStateError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_cspm_inventory_ba_services(
configuration: &configuration::Configuration,
business_application_name: &str,
offset: Option<i32>,
limit: Option<i32>,
) -> Result<models::TypesGeneralQueryResponse, Error<GetCspmInventoryBaServicesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_business_application_name = business_application_name;
let p_query_offset = offset;
let p_query_limit = limit;
let uri_str = format!(
"{}/application-security/combined/cspm-inventory-ba-services/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[(
"business_application_name",
&p_query_business_application_name.to_string(),
)]);
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGeneralQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGeneralQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetCspmInventoryBaServicesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_cspm_inventory_service_details(
configuration: &configuration::Configuration,
persistent_signature: &str,
) -> Result<models::TypesGeneralQueryResponse, Error<GetCspmInventoryServiceDetailsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_persistent_signature = persistent_signature;
let uri_str = format!(
"{}/application-security/combined/cspm-inventory-service-data/v1",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[(
"persistent_signature",
&p_query_persistent_signature.to_string(),
)]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGeneralQueryResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGeneralQueryResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetCspmInventoryServiceDetailsError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_executor_nodes(
configuration: &configuration::Configuration,
node_type: &str,
integration_type: Option<i32>,
offset: Option<i32>,
limit: Option<i32>,
order_by: Option<&str>,
direction: Option<&str>,
executor_node_ids: Option<Vec<String>>,
executor_node_names: Option<Vec<String>>,
executor_node_states: Option<Vec<i32>>,
executor_node_types: Option<Vec<String>>,
) -> Result<models::TypesListExecutorNodesResponse, Error<GetExecutorNodesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_node_type = node_type;
let p_query_integration_type = integration_type;
let p_query_offset = offset;
let p_query_limit = limit;
let p_query_order_by = order_by;
let p_query_direction = direction;
let p_query_executor_node_ids = executor_node_ids;
let p_query_executor_node_names = executor_node_names;
let p_query_executor_node_states = executor_node_states;
let p_query_executor_node_types = executor_node_types;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/executor_nodes",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("node_type", &p_query_node_type.to_string())]);
if let Some(ref param_value) = p_query_integration_type {
req_builder = req_builder.query(&[("integration_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_executor_node_ids {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_ids".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_ids",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_executor_node_names {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_names".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_names",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_executor_node_states {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_states".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_states",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_executor_node_types {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_types".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_types",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListExecutorNodesResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListExecutorNodesResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetExecutorNodesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_executor_nodes_metadata(
configuration: &configuration::Configuration,
executor_node_ids: Option<Vec<String>>,
executor_node_names: Option<Vec<String>>,
executor_node_states: Option<Vec<i32>>,
executor_node_types: Option<Vec<String>>,
) -> Result<models::TypesGetExecutorNodesMetadataResponse, Error<GetExecutorNodesMetadataError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_executor_node_ids = executor_node_ids;
let p_query_executor_node_names = executor_node_names;
let p_query_executor_node_states = executor_node_states;
let p_query_executor_node_types = executor_node_types;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/executor_nodes/metadata",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_executor_node_ids {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_ids".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_ids",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_executor_node_names {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_names".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_names",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_executor_node_states {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_states".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_states",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_executor_node_types {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("executor_node_types".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"executor_node_types",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGetExecutorNodesMetadataResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGetExecutorNodesMetadataResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetExecutorNodesMetadataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integration_tasks(
configuration: &configuration::Configuration,
integration_task_type: Option<i32>,
category: Option<&str>,
offset: Option<i32>,
limit: Option<i32>,
order_by: Option<&str>,
direction: Option<&str>,
integration_task_types: Option<i32>,
ids: Option<i32>,
names: Option<&str>,
) -> Result<models::TypesListIntegrationTasksResponse, Error<GetIntegrationTasksError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_integration_task_type = integration_task_type;
let p_query_category = category;
let p_query_offset = offset;
let p_query_limit = limit;
let p_query_order_by = order_by;
let p_query_direction = direction;
let p_query_integration_task_types = integration_task_types;
let p_query_ids = ids;
let p_query_names = names;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_integration_task_type {
req_builder = req_builder.query(&[("integration_task_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = req_builder.query(&[("orderBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_integration_task_types {
req_builder = req_builder.query(&[("integration_task_types", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ids {
req_builder = req_builder.query(&[("ids", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_names {
req_builder = req_builder.query(&[("names", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListIntegrationTasksResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListIntegrationTasksResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationTasksError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integration_tasks_admin(
configuration: &configuration::Configuration,
integration_task_type: Option<i32>,
category: Option<&str>,
offset: Option<i32>,
limit: Option<i32>,
order_by: Option<&str>,
direction: Option<&str>,
integration_task_types: Option<i32>,
ids: Option<i32>,
names: Option<&str>,
) -> Result<models::TypesListIntegrationTasksResponse, Error<GetIntegrationTasksAdminError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_integration_task_type = integration_task_type;
let p_query_category = category;
let p_query_offset = offset;
let p_query_limit = limit;
let p_query_order_by = order_by;
let p_query_direction = direction;
let p_query_integration_task_types = integration_task_types;
let p_query_ids = ids;
let p_query_names = names;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/admin",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_integration_task_type {
req_builder = req_builder.query(&[("integration_task_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = req_builder.query(&[("orderBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_integration_task_types {
req_builder = req_builder.query(&[("integration_task_types", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ids {
req_builder = req_builder.query(&[("ids", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_names {
req_builder = req_builder.query(&[("names", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListIntegrationTasksResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListIntegrationTasksResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationTasksAdminError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integration_tasks_metadata(
configuration: &configuration::Configuration,
category: Option<&str>,
integration_task_types: Option<i32>,
ids: Option<i32>,
names: Option<&str>,
) -> Result<models::TypesGetIntegrationTasksMetadataResponse, Error<GetIntegrationTasksMetadataError>>
{
// add a prefix to parameters to efficiently prevent name collisions
let p_query_category = category;
let p_query_integration_task_types = integration_task_types;
let p_query_ids = ids;
let p_query_names = names;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/metadata",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_integration_task_types {
req_builder = req_builder.query(&[("integration_task_types", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ids {
req_builder = req_builder.query(&[("ids", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_names {
req_builder = req_builder.query(&[("names", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGetIntegrationTasksMetadataResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGetIntegrationTasksMetadataResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationTasksMetadataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integration_tasks_v2(
configuration: &configuration::Configuration,
integration_task_type: Option<i32>,
category: Option<&str>,
offset: Option<i32>,
limit: Option<i32>,
order_by: Option<&str>,
direction: Option<&str>,
integration_task_types: Option<i32>,
ids: Option<i32>,
names: Option<&str>,
) -> Result<models::TypesListIntegrationTasksResponse, Error<GetIntegrationTasksV2Error>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_integration_task_type = integration_task_type;
let p_query_category = category;
let p_query_offset = offset;
let p_query_limit = limit;
let p_query_order_by = order_by;
let p_query_direction = direction;
let p_query_integration_task_types = integration_task_types;
let p_query_ids = ids;
let p_query_names = names;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/v2",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_integration_task_type {
req_builder = req_builder.query(&[("integration_task_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = req_builder.query(&[("orderBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_integration_task_types {
req_builder = req_builder.query(&[("integration_task_types", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ids {
req_builder = req_builder.query(&[("ids", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_names {
req_builder = req_builder.query(&[("names", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListIntegrationTasksResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListIntegrationTasksResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationTasksV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integration_types(
configuration: &configuration::Configuration,
) -> Result<models::TypesListIntegrationTypesResponse, Error<GetIntegrationTypesError>> {
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_types",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListIntegrationTypesResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListIntegrationTypesResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationTypesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integrations(
configuration: &configuration::Configuration,
integration_type: Option<i32>,
category: Option<&str>,
) -> Result<models::TypesListIntegrationsResponse, Error<GetIntegrationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_integration_type = integration_type;
let p_query_category = category;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integrations",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_integration_type {
req_builder = req_builder.query(&[("integration_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListIntegrationsResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListIntegrationsResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_integrations_v2(
configuration: &configuration::Configuration,
integration_type: Option<i32>,
category: Option<&str>,
) -> Result<models::TypesListIntegrationsResponse, Error<GetIntegrationsV2Error>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_integration_type = integration_type;
let p_query_category = category;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integrations/v2",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_integration_type {
req_builder = req_builder.query(&[("integration_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesListIntegrationsResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesListIntegrationsResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetIntegrationsV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_service_artifacts(
configuration: &configuration::Configuration,
persistent_signature: &str,
optional_time: Option<i32>,
revision_id: Option<i32>,
limit: Option<i32>,
offset: Option<i32>,
order_by: Option<Vec<String>>,
direction: Option<&str>,
) -> Result<models::TypesArtifacts, Error<GetServiceArtifactsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_persistent_signature = persistent_signature;
let p_query_optional_time = optional_time;
let p_query_revision_id = revision_id;
let p_query_limit = limit;
let p_query_offset = offset;
let p_query_order_by = order_by;
let p_query_direction = direction;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/artifacts",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[(
"persistentSignature",
&p_query_persistent_signature.to_string(),
)]);
if let Some(ref param_value) = p_query_optional_time {
req_builder = req_builder.query(&[("optionalTime", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_revision_id {
req_builder = req_builder.query(&[("revisionId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("orderBy".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"orderBy",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesArtifacts`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesArtifacts`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetServiceArtifactsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_service_violation_types(
configuration: &configuration::Configuration,
body: models::TypesGenericUserFacingRequest,
) -> Result<models::TypesGetViolationTypesResponse, Error<GetServiceViolationTypesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/services/violations/types",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGetViolationTypesResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGetViolationTypesResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetServiceViolationTypesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_services_count(
configuration: &configuration::Configuration,
body: models::TypesGetServicesRequest,
) -> Result<(), Error<GetServicesCountError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/services/count",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetServicesCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_slash_executor_nodes_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_instances_slash_csv(configuration: &configuration::Configuration, id: i32, body: models::TypesExecutorNode) -> Result<String, Error<GetSlashExecutorNodesSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashInstancesSlashCsvError>>{
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/executor_nodes/{ID}/instances/csv",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `String`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `String`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetSlashExecutorNodesSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashInstancesSlashCsvError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_v2(configuration: &configuration::Configuration, id: i32) -> Result<models::TypesGroupDetails, Error<GetSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashV2Error>>{
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/group/{ID}/v2",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGroupDetails`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGroupDetails`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_slash_groups_slash_hier_slash_v2(
configuration: &configuration::Configuration,
) -> Result<models::TypesGroupHierarchyResponse, Error<GetSlashGroupsSlashHierSlashV2Error>> {
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/groups/hier/v2",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesGroupHierarchyResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesGroupHierarchyResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetSlashGroupsSlashHierSlashV2Error> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_slash_groups_slash_list_slash_v2(
configuration: &configuration::Configuration,
r#type: Option<&str>,
) -> Result<Vec<models::TypesGroupListItem>, Error<GetSlashGroupsSlashListSlashV2Error>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_type = r#type;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/groups/list/v2",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_type {
req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `Vec<models::TypesGroupListItem>`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TypesGroupListItem>`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetSlashGroupsSlashListSlashV2Error> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_slash_users_slash_v2(
configuration: &configuration::Configuration,
pagination: Option<&str>,
) -> Result<models::TypesUsersResponse, Error<GetSlashUsersSlashV2Error>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_pagination = pagination;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/users/v2",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_pagination {
req_builder = req_builder.query(&[("pagination", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesUsersResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesUsersResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetSlashUsersSlashV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn get_tags(
configuration: &configuration::Configuration,
is_unique: Option<bool>,
tag_name: Option<&str>,
limit: Option<i32>,
offset: Option<i32>,
name: Option<Vec<String>>,
) -> Result<models::TypesTagsDataResponse, Error<GetTagsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_is_unique = is_unique;
let p_query_tag_name = tag_name;
let p_query_limit = limit;
let p_query_offset = offset;
let p_query_name = name;
let uri_str = format!("{}/aspm-api-gateway/api/v1/tags", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_is_unique {
req_builder = req_builder.query(&[("isUnique", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_tag_name {
req_builder = req_builder.query(&[("tagName", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = match "csv" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("name".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"name",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesTagsDataResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesTagsDataResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<GetTagsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn post_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_update_default(configuration: &configuration::Configuration, id: i32) -> Result<(), Error<PostSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashUpdateDefaultError>>{
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/group/{ID}/update_default",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashUpdateDefaultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn post_slash_group_slash_left_curly_bracket_id_left_square_bracket_09_right_square_bracket_plus_right_curly_bracket_slash_v2(configuration: &configuration::Configuration, id: i32, body: models::TypesUpdateGroupRequest) -> Result<(), Error<PostSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashV2Error>>{
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/group/{ID}/v2",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostSlashGroupSlashLeftCurlyBracketIdLeftSquareBracket09RightSquareBracketPlusRightCurlyBracketSlashV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn post_slash_group_slash_v2(
configuration: &configuration::Configuration,
body: models::TypesCreateGroupRequest,
) -> Result<(), Error<PostSlashGroupSlashV2Error>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/group/v2",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostSlashGroupSlashV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn run_integration_task(
configuration: &configuration::Configuration,
id: i32,
body: models::TypesRunIntegrationTaskRequest,
category: Option<&str>,
) -> Result<models::TypesIntegrationTaskTestConnectionResponse, Error<RunIntegrationTaskError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let p_query_category = category;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/{ID}/run",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesIntegrationTaskTestConnectionResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesIntegrationTaskTestConnectionResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<RunIntegrationTaskError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn run_integration_task_admin(
configuration: &configuration::Configuration,
id: i32,
body: models::TypesRunIntegrationTaskRequest,
category: Option<&str>,
) -> Result<models::TypesIntegrationTaskTestConnectionResponse, Error<RunIntegrationTaskAdminError>>
{
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let p_query_category = category;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/{ID}/run/admin",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesIntegrationTaskTestConnectionResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesIntegrationTaskTestConnectionResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<RunIntegrationTaskAdminError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn run_integration_task_v2(
configuration: &configuration::Configuration,
id: i32,
body: models::TypesRunIntegrationTaskRequest,
category: Option<&str>,
) -> Result<models::TypesIntegrationTaskTestConnectionResponse, Error<RunIntegrationTaskV2Error>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let p_query_category = category;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/{ID}/run/v2",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_query_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesIntegrationTaskTestConnectionResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesIntegrationTaskTestConnectionResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<RunIntegrationTaskV2Error> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn service_now_get_deployments(
configuration: &configuration::Configuration,
ql_filters: Option<&str>,
limit: Option<i32>,
offset: Option<i32>,
order_by: Option<&str>,
direction: Option<&str>,
) -> Result<models::TypesServiceNowDeploymentsResponse, Error<ServiceNowGetDeploymentsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_ql_filters = ql_filters;
let p_query_limit = limit;
let p_query_offset = offset;
let p_query_order_by = order_by;
let p_query_direction = direction;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/servicenow/deployments",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_ql_filters {
req_builder = req_builder.query(&[("ql_filters", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = req_builder.query(&[("orderBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesServiceNowDeploymentsResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesServiceNowDeploymentsResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ServiceNowGetDeploymentsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn service_now_get_services(
configuration: &configuration::Configuration,
ql_filters: Option<&str>,
exclude_artifacts: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
order_by: Option<&str>,
direction: Option<&str>,
) -> Result<models::TypesServiceNowServicesResponse, Error<ServiceNowGetServicesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_ql_filters = ql_filters;
let p_query_exclude_artifacts = exclude_artifacts;
let p_query_limit = limit;
let p_query_offset = offset;
let p_query_order_by = order_by;
let p_query_direction = direction;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/servicenow/services",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_ql_filters {
req_builder = req_builder.query(&[("ql_filters", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_exclude_artifacts {
req_builder = req_builder.query(&[("exclude_artifacts", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_order_by {
req_builder = req_builder.query(&[("orderBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesServiceNowServicesResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesServiceNowServicesResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<ServiceNowGetServicesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn set_cloud_security_integration_state(
configuration: &configuration::Configuration,
body: models::TypesSetCloudSecurityIntegrationStateRequest,
) -> Result<(), Error<SetCloudSecurityIntegrationStateError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/cloud_security_config",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<SetCloudSecurityIntegrationStateError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn update_executor_node(
configuration: &configuration::Configuration,
body: models::TypesExecutorNode,
) -> Result<models::TypesExecutorNode, Error<UpdateExecutorNodeError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/executor_nodes",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesExecutorNode`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesExecutorNode`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateExecutorNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn update_integration(
configuration: &configuration::Configuration,
id: i32,
body: models::TypesUpdateIntegrationRequest,
) -> Result<models::TypesIntegrationResponse, Error<UpdateIntegrationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integrations/{ID}",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesIntegrationResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesIntegrationResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateIntegrationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn update_integration_task(
configuration: &configuration::Configuration,
id: i32,
body: models::TypesUpdateIntegrationTaskRequest,
) -> Result<models::TypesIntegrationTaskResponse, Error<UpdateIntegrationTaskError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_id = id;
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/integration_tasks/{ID}",
configuration.base_path,
ID = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::TypesIntegrationTaskResponse`",
)));
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::TypesIntegrationTaskResponse`"
))));
}
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateIntegrationTaskError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn upsert_business_applications(
configuration: &configuration::Configuration,
body: models::TypesUpsertBusinessApplicationRequest,
) -> Result<(), Error<UpsertBusinessApplicationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!(
"{}/aspm-api-gateway/api/v1/business_applications",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<UpsertBusinessApplicationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn upsert_tags(
configuration: &configuration::Configuration,
body: models::TypesEditUniqueTagRequest,
) -> Result<(), Error<UpsertTagsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_body = body;
let uri_str = format!("{}/aspm-api-gateway/api/v1/tags", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.oauth_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<UpsertTagsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}