forked from loafle/openapi-generator-original
[Rust] Fixed rust keyword params in reqwest-trait library (#20333)
* Fixed rust keywords in reqwest-trait lib * Update tests and samples
This commit is contained in:
parent
ea2ba0c349
commit
47891245e9
@ -52,12 +52,15 @@ import org.openapitools.codegen.model.ModelMap;
|
|||||||
import org.openapitools.codegen.model.ModelsMap;
|
import org.openapitools.codegen.model.ModelsMap;
|
||||||
import org.openapitools.codegen.model.OperationMap;
|
import org.openapitools.codegen.model.OperationMap;
|
||||||
import org.openapitools.codegen.model.OperationsMap;
|
import org.openapitools.codegen.model.OperationsMap;
|
||||||
|
import org.openapitools.codegen.templating.mustache.ReplaceAllLambda;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
import org.openapitools.codegen.utils.StringUtils;
|
import org.openapitools.codegen.utils.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
|
import com.samskivert.mustache.Mustache.Lambda;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.Discriminator;
|
import io.swagger.v3.oas.models.media.Discriminator;
|
||||||
@ -692,4 +695,14 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ImmutableMap.Builder<String, Lambda> addMustacheLambdas() {
|
||||||
|
return super.addMustacheLambdas()
|
||||||
|
// Convert variable names to lifetime names.
|
||||||
|
// Generally they are the same, but `#` is not valid in lifetime names.
|
||||||
|
// Rust uses `r#` prefix for variables that are also keywords.
|
||||||
|
.put("lifetimeName", new ReplaceAllLambda("^r#", "r_"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ pub trait {{{classname}}}: Send + Sync {
|
|||||||
async fn {{{operationId}}}(&self, {{#allParams}}{{#-first}} params: {{{operationIdCamelCase}}}Params {{/-first}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>>;
|
async fn {{{operationId}}}(&self, {{#allParams}}{{#-first}} params: {{{operationIdCamelCase}}}Params {{/-first}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>>;
|
||||||
{{/vendorExtensions.x-group-parameters}}
|
{{/vendorExtensions.x-group-parameters}}
|
||||||
{{^vendorExtensions.x-group-parameters}}
|
{{^vendorExtensions.x-group-parameters}}
|
||||||
async fn {{{operationId}}}<{{#allParams}}'{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}>(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{{paramName}}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>>;
|
async fn {{{operationId}}}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>>;
|
||||||
{{/vendorExtensions.x-group-parameters}}
|
{{/vendorExtensions.x-group-parameters}}
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
@ -86,7 +86,7 @@ impl {{classname}} for {{classname}}Client {
|
|||||||
|
|
||||||
{{/vendorExtensions.x-group-parameters}}
|
{{/vendorExtensions.x-group-parameters}}
|
||||||
{{^vendorExtensions.x-group-parameters}}
|
{{^vendorExtensions.x-group-parameters}}
|
||||||
async fn {{{operationId}}}<{{#allParams}}'{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}>(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{{paramName}}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>> {
|
async fn {{{operationId}}}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>> {
|
||||||
{{/vendorExtensions.x-group-parameters}}
|
{{/vendorExtensions.x-group-parameters}}
|
||||||
let local_var_configuration = &self.configuration;
|
let local_var_configuration = &self.configuration;
|
||||||
|
|
||||||
|
@ -95,6 +95,22 @@ paths:
|
|||||||
- pending
|
- pending
|
||||||
- sold
|
- sold
|
||||||
default: available
|
default: available
|
||||||
|
- name: type
|
||||||
|
in: query
|
||||||
|
description: Make sure that Rust keywords like type work as query params
|
||||||
|
required: false
|
||||||
|
style: form
|
||||||
|
explode: false
|
||||||
|
deprecated: true
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- available
|
||||||
|
- pending
|
||||||
|
- sold
|
||||||
|
default: available
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: successful operation
|
description: successful operation
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ impl<C: Connect> PetApiClient<C>
|
|||||||
pub trait PetApi: Send + Sync {
|
pub trait PetApi: Send + Sync {
|
||||||
fn add_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>> + Send>>;
|
fn add_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>> + Send>>;
|
||||||
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
|
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
|
||||||
fn find_pets_by_status(&self, status: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>> + Send>>;
|
fn find_pets_by_status(&self, status: Vec<String>, r#type: Option<Vec<String>>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>> + Send>>;
|
||||||
fn find_pets_by_tags(&self, tags: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>> + Send>>;
|
fn find_pets_by_tags(&self, tags: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>> + Send>>;
|
||||||
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>> + Send>>;
|
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>> + Send>>;
|
||||||
fn update_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>> + Send>>;
|
fn update_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>> + Send>>;
|
||||||
@ -74,11 +74,15 @@ impl<C: Connect>PetApi for PetApiClient<C>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused_mut)]
|
#[allow(unused_mut)]
|
||||||
fn find_pets_by_status(&self, status: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>> + Send>> {
|
fn find_pets_by_status(&self, status: Vec<String>, r#type: Option<Vec<String>>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>> + Send>> {
|
||||||
let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string())
|
let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string())
|
||||||
.with_auth(__internal_request::Auth::Oauth)
|
.with_auth(__internal_request::Auth::Oauth)
|
||||||
;
|
;
|
||||||
req = req.with_query_param("status".to_string(), status.join(",").to_string());
|
req = req.with_query_param("status".to_string(), status.join(",").to_string());
|
||||||
|
if let Some(ref s) = r#type {
|
||||||
|
let query_value = s.iter().map(|s| s.to_string()).collect::<Vec<String>>().join(",");
|
||||||
|
req = req.with_query_param("type".to_string(), query_value);
|
||||||
|
}
|
||||||
|
|
||||||
req.execute(self.configuration.borrow())
|
req.execute(self.configuration.borrow())
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ impl<C: hyper::client::connect::Connect> PetApiClient<C>
|
|||||||
pub trait PetApi {
|
pub trait PetApi {
|
||||||
fn add_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>>>>;
|
fn add_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>>>>;
|
||||||
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
|
fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
|
||||||
fn find_pets_by_status(&self, status: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>>>>;
|
fn find_pets_by_status(&self, status: Vec<String>, r#type: Option<Vec<String>>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>>>>;
|
||||||
fn find_pets_by_tags(&self, tags: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>>>>;
|
fn find_pets_by_tags(&self, tags: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>>>>;
|
||||||
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>>>>;
|
fn get_pet_by_id(&self, pet_id: i64) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>>>>;
|
||||||
fn update_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>>>>;
|
fn update_pet(&self, pet: models::Pet) -> Pin<Box<dyn Future<Output = Result<models::Pet, Error>>>>;
|
||||||
@ -73,11 +73,15 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused_mut)]
|
#[allow(unused_mut)]
|
||||||
fn find_pets_by_status(&self, status: Vec<String>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>>>> {
|
fn find_pets_by_status(&self, status: Vec<String>, r#type: Option<Vec<String>>) -> Pin<Box<dyn Future<Output = Result<Vec<models::Pet>, Error>>>> {
|
||||||
let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string())
|
let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string())
|
||||||
.with_auth(__internal_request::Auth::Oauth)
|
.with_auth(__internal_request::Auth::Oauth)
|
||||||
;
|
;
|
||||||
req = req.with_query_param("status".to_string(), status.join(",").to_string());
|
req = req.with_query_param("status".to_string(), status.join(",").to_string());
|
||||||
|
if let Some(ref s) = r#type {
|
||||||
|
let query_value = s.iter().map(|s| s.to_string()).collect::<Vec<String>>().join(",");
|
||||||
|
req = req.with_query_param("type".to_string(), query_value);
|
||||||
|
}
|
||||||
|
|
||||||
req.execute(self.configuration.borrow())
|
req.execute(self.configuration.borrow())
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ use super::{Error, configuration};
|
|||||||
pub trait PetApi: Send + Sync {
|
pub trait PetApi: Send + Sync {
|
||||||
async fn add_pet<'pet>(&self, pet: models::Pet) -> Result<models::Pet, Error<AddPetError>>;
|
async fn add_pet<'pet>(&self, pet: models::Pet) -> Result<models::Pet, Error<AddPetError>>;
|
||||||
async fn delete_pet<'pet_id, 'api_key>(&self, pet_id: i64, api_key: Option<&'api_key str>) -> Result<(), Error<DeletePetError>>;
|
async fn delete_pet<'pet_id, 'api_key>(&self, pet_id: i64, api_key: Option<&'api_key str>) -> Result<(), Error<DeletePetError>>;
|
||||||
async fn find_pets_by_status<'status>(&self, status: Vec<String>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>>;
|
async fn find_pets_by_status<'status, 'r_type>(&self, status: Vec<String>, r#type: Option<Vec<String>>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>>;
|
||||||
async fn find_pets_by_tags<'tags>(&self, tags: Vec<String>) -> Result<Vec<models::Pet>, Error<FindPetsByTagsError>>;
|
async fn find_pets_by_tags<'tags>(&self, tags: Vec<String>) -> Result<Vec<models::Pet>, Error<FindPetsByTagsError>>;
|
||||||
async fn get_pet_by_id<'pet_id>(&self, pet_id: i64) -> Result<models::Pet, Error<GetPetByIdError>>;
|
async fn get_pet_by_id<'pet_id>(&self, pet_id: i64) -> Result<models::Pet, Error<GetPetByIdError>>;
|
||||||
async fn update_pet<'pet>(&self, pet: models::Pet) -> Result<models::Pet, Error<UpdatePetError>>;
|
async fn update_pet<'pet>(&self, pet: models::Pet) -> Result<models::Pet, Error<UpdatePetError>>;
|
||||||
@ -112,7 +112,7 @@ impl PetApi for PetApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
async fn find_pets_by_status<'status>(&self, status: Vec<String>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
|
async fn find_pets_by_status<'status, 'r_type>(&self, status: Vec<String>, r#type: Option<Vec<String>>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
|
||||||
let local_var_configuration = &self.configuration;
|
let local_var_configuration = &self.configuration;
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -124,6 +124,12 @@ impl PetApi for PetApiClient {
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -33,7 +33,9 @@ pub struct DeletePetParams {
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct FindPetsByStatusParams {
|
pub struct FindPetsByStatusParams {
|
||||||
/// Status values that need to be considered for filter
|
/// Status values that need to be considered for filter
|
||||||
pub status: Vec<String>
|
pub status: Vec<String>,
|
||||||
|
/// Make sure that Rust keywords like type work as query params
|
||||||
|
pub r#type: Option<Vec<String>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
||||||
@ -296,6 +298,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
|
|
||||||
// unbox the parameters
|
// unbox the parameters
|
||||||
let status = params.status;
|
let status = params.status;
|
||||||
|
let r#type = params.r#type;
|
||||||
|
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -307,6 +310,12 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -33,7 +33,9 @@ pub struct DeletePetParams {
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct FindPetsByStatusParams {
|
pub struct FindPetsByStatusParams {
|
||||||
/// Status values that need to be considered for filter
|
/// Status values that need to be considered for filter
|
||||||
pub status: Vec<String>
|
pub status: Vec<String>,
|
||||||
|
/// Make sure that Rust keywords like type work as query params
|
||||||
|
pub r#type: Option<Vec<String>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
||||||
@ -300,6 +302,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
|
|
||||||
// unbox the parameters
|
// unbox the parameters
|
||||||
let status = params.status;
|
let status = params.status;
|
||||||
|
let r#type = params.r#type;
|
||||||
|
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -311,6 +314,12 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -33,7 +33,9 @@ pub struct DeletePetParams {
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct FindPetsByStatusParams {
|
pub struct FindPetsByStatusParams {
|
||||||
/// Status values that need to be considered for filter
|
/// Status values that need to be considered for filter
|
||||||
pub status: Vec<String>
|
pub status: Vec<String>,
|
||||||
|
/// Make sure that Rust keywords like type work as query params
|
||||||
|
pub r#type: Option<Vec<String>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
||||||
@ -296,6 +298,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
|
|
||||||
// unbox the parameters
|
// unbox the parameters
|
||||||
let status = params.status;
|
let status = params.status;
|
||||||
|
let r#type = params.r#type;
|
||||||
|
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -307,6 +310,12 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -33,7 +33,9 @@ pub struct DeletePetParams {
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct FindPetsByStatusParams {
|
pub struct FindPetsByStatusParams {
|
||||||
/// Status values that need to be considered for filter
|
/// Status values that need to be considered for filter
|
||||||
pub status: Vec<String>
|
pub status: Vec<String>,
|
||||||
|
/// Make sure that Rust keywords like type work as query params
|
||||||
|
pub r#type: Option<Vec<String>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
/// struct for passing parameters to the method [`find_pets_by_tags`]
|
||||||
@ -296,6 +298,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
|
|
||||||
// unbox the parameters
|
// unbox the parameters
|
||||||
let status = params.status;
|
let status = params.status;
|
||||||
|
let r#type = params.r#type;
|
||||||
|
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -307,6 +310,12 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
|
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>, r#type: Option<Vec<String>>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
|
||||||
let local_var_configuration = configuration;
|
let local_var_configuration = configuration;
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -188,6 +188,12 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status:
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key {
|
if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key {
|
||||||
let local_var_new_headers = match local_var_aws_v4_key.sign(
|
let local_var_new_headers = match local_var_aws_v4_key.sign(
|
||||||
&local_var_uri_str,
|
&local_var_uri_str,
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::FooPet> find_pets_by_status(status)
|
> Vec<models::FooPet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>) -> Result<Vec<models::FooPet>, Error<FindPetsByStatusError>> {
|
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>, r#type: Option<Vec<String>>) -> Result<Vec<models::FooPet>, Error<FindPetsByStatusError>> {
|
||||||
let local_var_configuration = configuration;
|
let local_var_configuration = configuration;
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -162,6 +162,12 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status:
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes
|
|||||||
|
|
||||||
## find_pets_by_status
|
## find_pets_by_status
|
||||||
|
|
||||||
> Vec<models::Pet> find_pets_by_status(status)
|
> Vec<models::Pet> find_pets_by_status(status, r#type)
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings
|
Multiple status values can be provided with comma separated strings
|
||||||
@ -89,6 +89,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
Name | Type | Description | Required | Notes
|
Name | Type | Description | Required | Notes
|
||||||
------------- | ------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
**status** | [**Vec<String>**](String.md) | Status values that need to be considered for filter | [required] |
|
||||||
|
**r#type** | Option<[**Vec<String>**](String.md)> | Make sure that Rust keywords like type work as query params | |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
|
pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec<String>, r#type: Option<Vec<String>>) -> Result<Vec<models::Pet>, Error<FindPetsByStatusError>> {
|
||||||
let local_var_configuration = configuration;
|
let local_var_configuration = configuration;
|
||||||
|
|
||||||
let local_var_client = &local_var_configuration.client;
|
let local_var_client = &local_var_configuration.client;
|
||||||
@ -162,6 +162,12 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status:
|
|||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => 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_str) = r#type {
|
||||||
|
local_var_req_builder = match "csv" {
|
||||||
|
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
|
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
|
};
|
||||||
|
}
|
||||||
if let Some(ref local_var_user_agent) = local_var_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.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user