forked from loafle/openapi-generator-original
fix(rust,client): use local_var prefix for configuration (#10419)
* fix(rust,client): use local_var prefix for configuration This avoids conflicting with params named "configuration". * chore(rust,client): capture updated samples
This commit is contained in:
@@ -210,19 +210,21 @@ pub enum UploadFileError {
|
||||
|
||||
|
||||
pub async fn add_pet(configuration: &configuration::Configuration, params: AddPetParams) -> Result<ResponseContent<AddPetSuccess>, Error<AddPetError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let pet = params.pet;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/pet", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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) = configuration.oauth_access_token {
|
||||
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(&pet);
|
||||
@@ -245,23 +247,25 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe
|
||||
}
|
||||
|
||||
pub async fn delete_pet(configuration: &configuration::Configuration, params: DeletePetParams) -> Result<ResponseContent<DeletePetSuccess>, Error<DeletePetError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let pet_id = params.pet_id;
|
||||
let api_key = params.api_key;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet/{petId}", configuration.base_path, petId=pet_id);
|
||||
let local_var_uri_str = format!("{}/pet/{petId}", local_var_configuration.base_path, petId=pet_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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(local_var_param_value) = api_key {
|
||||
local_var_req_builder = local_var_req_builder.header("api_key", local_var_param_value.to_string());
|
||||
}
|
||||
if let Some(ref local_var_token) = configuration.oauth_access_token {
|
||||
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());
|
||||
};
|
||||
|
||||
@@ -284,20 +288,22 @@ pub async fn delete_pet(configuration: &configuration::Configuration, params: De
|
||||
|
||||
/// Multiple status values can be provided with comma separated strings
|
||||
pub async fn find_pets_by_status(configuration: &configuration::Configuration, params: FindPetsByStatusParams) -> Result<ResponseContent<FindPetsByStatusSuccess>, Error<FindPetsByStatusError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let status = params.status;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet/findByStatus", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/pet/findByStatus", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
local_var_req_builder = local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]);
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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) = configuration.oauth_access_token {
|
||||
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());
|
||||
};
|
||||
|
||||
@@ -320,20 +326,22 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
||||
|
||||
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
pub async fn find_pets_by_tags(configuration: &configuration::Configuration, params: FindPetsByTagsParams) -> Result<ResponseContent<FindPetsByTagsSuccess>, Error<FindPetsByTagsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let tags = params.tags;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet/findByTags", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/pet/findByTags", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
local_var_req_builder = local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]);
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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) = configuration.oauth_access_token {
|
||||
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());
|
||||
};
|
||||
|
||||
@@ -356,19 +364,21 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par
|
||||
|
||||
/// Returns a single pet
|
||||
pub async fn get_pet_by_id(configuration: &configuration::Configuration, params: GetPetByIdParams) -> Result<ResponseContent<GetPetByIdSuccess>, Error<GetPetByIdError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let pet_id = params.pet_id;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet/{petId}", configuration.base_path, petId=pet_id);
|
||||
let local_var_uri_str = format!("{}/pet/{petId}", local_var_configuration.base_path, petId=pet_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -395,19 +405,21 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params:
|
||||
}
|
||||
|
||||
pub async fn update_pet(configuration: &configuration::Configuration, params: UpdatePetParams) -> Result<ResponseContent<UpdatePetSuccess>, Error<UpdatePetError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let pet = params.pet;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/pet", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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) = configuration.oauth_access_token {
|
||||
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(&pet);
|
||||
@@ -430,21 +442,23 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up
|
||||
}
|
||||
|
||||
pub async fn update_pet_with_form(configuration: &configuration::Configuration, params: UpdatePetWithFormParams) -> Result<ResponseContent<UpdatePetWithFormSuccess>, Error<UpdatePetWithFormError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let pet_id = params.pet_id;
|
||||
let name = params.name;
|
||||
let status = params.status;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet/{petId}", configuration.base_path, petId=pet_id);
|
||||
let local_var_uri_str = format!("{}/pet/{petId}", local_var_configuration.base_path, petId=pet_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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) = configuration.oauth_access_token {
|
||||
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());
|
||||
};
|
||||
let mut local_var_form_params = std::collections::HashMap::new();
|
||||
@@ -474,21 +488,23 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration,
|
||||
}
|
||||
|
||||
pub async fn upload_file(configuration: &configuration::Configuration, params: UploadFileParams) -> Result<ResponseContent<UploadFileSuccess>, Error<UploadFileError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let pet_id = params.pet_id;
|
||||
let additional_metadata = params.additional_metadata;
|
||||
let file = params.file;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/pet/{petId}/uploadImage", configuration.base_path, petId=pet_id);
|
||||
let local_var_uri_str = format!("{}/pet/{petId}/uploadImage", local_var_configuration.base_path, petId=pet_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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) = configuration.oauth_access_token {
|
||||
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());
|
||||
};
|
||||
let mut local_var_form = reqwest::multipart::Form::new();
|
||||
|
||||
@@ -103,16 +103,18 @@ pub enum PlaceOrderError {
|
||||
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
pub async fn delete_order(configuration: &configuration::Configuration, params: DeleteOrderParams) -> Result<ResponseContent<DeleteOrderSuccess>, Error<DeleteOrderError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let order_id = params.order_id;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/store/order/{orderId}", configuration.base_path, orderId=crate::apis::urlencode(order_id));
|
||||
let local_var_uri_str = format!("{}/store/order/{orderId}", local_var_configuration.base_path, orderId=crate::apis::urlencode(order_id));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -135,18 +137,20 @@ pub async fn delete_order(configuration: &configuration::Configuration, params:
|
||||
|
||||
/// Returns a map of status codes to quantities
|
||||
pub async fn get_inventory(configuration: &configuration::Configuration) -> Result<ResponseContent<GetInventorySuccess>, Error<GetInventoryError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/store/inventory", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/store/inventory", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -174,16 +178,18 @@ pub async fn get_inventory(configuration: &configuration::Configuration) -> Resu
|
||||
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
pub async fn get_order_by_id(configuration: &configuration::Configuration, params: GetOrderByIdParams) -> Result<ResponseContent<GetOrderByIdSuccess>, Error<GetOrderByIdError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let order_id = params.order_id;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/store/order/{orderId}", configuration.base_path, orderId=order_id);
|
||||
let local_var_uri_str = format!("{}/store/order/{orderId}", local_var_configuration.base_path, orderId=order_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -205,16 +211,18 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param
|
||||
}
|
||||
|
||||
pub async fn place_order(configuration: &configuration::Configuration, params: PlaceOrderParams) -> Result<ResponseContent<PlaceOrderSuccess>, Error<PlaceOrderError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let order = params.order;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/store/order", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/store/order", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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());
|
||||
}
|
||||
local_var_req_builder = local_var_req_builder.json(&order);
|
||||
|
||||
@@ -196,19 +196,21 @@ pub enum UpdateUserError {
|
||||
|
||||
/// This can only be done by the logged in user.
|
||||
pub async fn create_user(configuration: &configuration::Configuration, params: CreateUserParams) -> Result<ResponseContent<CreateUserSuccess>, Error<CreateUserError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let user = params.user;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/user", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -236,19 +238,21 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C
|
||||
}
|
||||
|
||||
pub async fn create_users_with_array_input(configuration: &configuration::Configuration, params: CreateUsersWithArrayInputParams) -> Result<ResponseContent<CreateUsersWithArrayInputSuccess>, Error<CreateUsersWithArrayInputError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let user = params.user;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/createWithArray", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/user/createWithArray", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -276,19 +280,21 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config
|
||||
}
|
||||
|
||||
pub async fn create_users_with_list_input(configuration: &configuration::Configuration, params: CreateUsersWithListInputParams) -> Result<ResponseContent<CreateUsersWithListInputSuccess>, Error<CreateUsersWithListInputError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let user = params.user;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/createWithList", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/user/createWithList", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -317,19 +323,21 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu
|
||||
|
||||
/// This can only be done by the logged in user.
|
||||
pub async fn delete_user(configuration: &configuration::Configuration, params: DeleteUserParams) -> Result<ResponseContent<DeleteUserSuccess>, Error<DeleteUserError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let username = params.username;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/{username}", configuration.base_path, username=crate::apis::urlencode(username));
|
||||
let local_var_uri_str = format!("{}/user/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -356,16 +364,18 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D
|
||||
}
|
||||
|
||||
pub async fn get_user_by_name(configuration: &configuration::Configuration, params: GetUserByNameParams) -> Result<ResponseContent<GetUserByNameSuccess>, Error<GetUserByNameError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let username = params.username;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/{username}", configuration.base_path, username=crate::apis::urlencode(username));
|
||||
let local_var_uri_str = format!("{}/user/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -387,19 +397,21 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para
|
||||
}
|
||||
|
||||
pub async fn login_user(configuration: &configuration::Configuration, params: LoginUserParams) -> Result<ResponseContent<LoginUserSuccess>, Error<LoginUserError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let username = params.username;
|
||||
let password = params.password;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/login", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/user/login", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
local_var_req_builder = local_var_req_builder.query(&[("username", &username.to_string())]);
|
||||
local_var_req_builder = local_var_req_builder.query(&[("password", &password.to_string())]);
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -421,18 +433,20 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo
|
||||
}
|
||||
|
||||
pub async fn logout_user(configuration: &configuration::Configuration) -> Result<ResponseContent<LogoutUserSuccess>, Error<LogoutUserError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/logout", configuration.base_path);
|
||||
let local_var_uri_str = format!("{}/user/logout", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
@@ -460,20 +474,22 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result
|
||||
|
||||
/// This can only be done by the logged in user.
|
||||
pub async fn update_user(configuration: &configuration::Configuration, params: UpdateUserParams) -> Result<ResponseContent<UpdateUserSuccess>, Error<UpdateUserError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
// unbox the parameters
|
||||
let username = params.username;
|
||||
let user = params.user;
|
||||
|
||||
|
||||
let local_var_client = &configuration.client;
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/user/{username}", configuration.base_path, username=crate::apis::urlencode(username));
|
||||
let local_var_uri_str = format!("{}/user/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = configuration.user_agent {
|
||||
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_apikey) = configuration.api_key {
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
|
||||
Reference in New Issue
Block a user