-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from isimluk/swagger-update
Re-generate the codebase using the latest swagger
- Loading branch information
Showing
6 changed files
with
353 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* 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 more information about API endpoints that don't yet support OAuth2, 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 reqwest; | ||
|
||
use super::{configuration, Error}; | ||
use crate::apis::ResponseContent; | ||
|
||
/// struct for typed errors of method [`customer_settings_update`] | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(untagged)] | ||
pub enum CustomerSettingsUpdateError { | ||
Status400(crate::models::MsaReplyMetaOnly), | ||
Status403(crate::models::MsaReplyMetaOnly), | ||
Status404(crate::models::MsaQueryResponse), | ||
Status429(crate::models::MsaReplyMetaOnly), | ||
Status500(crate::models::MsaReplyMetaOnly), | ||
DefaultResponse(crate::models::MsaQueryResponse), | ||
UnknownValue(serde_json::Value), | ||
} | ||
|
||
pub async fn customer_settings_update(configuration: &configuration::Configuration, body: crate::models::ApiCustomerSettingsPatchRequestV1) -> Result<crate::models::MsaQueryResponse, Error<CustomerSettingsUpdateError>> { | ||
let local_var_configuration = configuration; | ||
|
||
let local_var_client = &local_var_configuration.client; | ||
|
||
let local_var_uri_str = format!("{}/installation-tokens/entities/customer-settings/v1", local_var_configuration.base_path); | ||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); | ||
|
||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { | ||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); | ||
} | ||
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { | ||
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); | ||
}; | ||
local_var_req_builder = local_var_req_builder.json(&body); | ||
|
||
let local_var_req = local_var_req_builder.build()?; | ||
let local_var_resp = local_var_client.execute(local_var_req).await?; | ||
|
||
let local_var_status = local_var_resp.status(); | ||
let local_var_content = local_var_resp.text().await?; | ||
|
||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() { | ||
serde_json::from_str(&local_var_content).map_err(Error::from) | ||
} else { | ||
let local_var_entity: Option<CustomerSettingsUpdateError> = serde_json::from_str(&local_var_content).ok(); | ||
let local_var_error = ResponseContent { | ||
status: local_var_status, | ||
content: local_var_content, | ||
entity: local_var_entity, | ||
}; | ||
Err(Error::ResponseError(local_var_error)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.