Benoît Courtine f4eb96933a [Rust] Client library choice between hyper and reqwest (#1258)
* Port of PR https://github.com/swagger-api/swagger-codegen/pull/8804.

* Correction of conflict with PR #528 (missing template file).

* Add rust-reqwest samples to Circle CI tests.

* Add integration test pom.xml file with launcher to trigger cargo execution.

* Deduplicate Maven project name.

* Fix "api_key" header for Petstore.

* Better API key management.

* Fix query param for lists of objects other than strings (numbers, etc.).

* Update to reqwest 0.9, and refactor of header management (using reqwest transition feature).

* Merge scripts generating rust-hyper and rust-reqwest samples.

* Consistent full stops.

* Use raw variables in all Rust mustache templates.

* Replace production build in CI with a quick simple check.

* Update samples.

* Finish Reqwest 0.9 migration (removing "hyper 0.11" transition feature).

* Configuration implements Default trait.

* API template reorganized: HashMap is not required anymore.

* Revert "Merge scripts generating rust-hyper and rust-reqwest samples."

This reverts commit 970f996566a740045f2a986fd70fc70f11952925.

* Remove deprecated "-XX:MaxPermSize" java arg.
2018-10-26 10:24:14 +01:00

8.3 KiB

\PetApi

All URIs are relative to http://petstore.swagger.io/v2

Method HTTP request Description
add_pet Post /pet Add a new pet to the store
delete_pet Delete /pet/{petId} Deletes a pet
find_pets_by_status Get /pet/findByStatus Finds Pets by status
find_pets_by_tags Get /pet/findByTags Finds Pets by tags
get_pet_by_id Get /pet/{petId} Find pet by ID
update_pet Put /pet Update an existing pet
update_pet_with_form Post /pet/{petId} Updates a pet in the store with form data
upload_file Post /pet/{petId}/uploadImage uploads an image

add_pet

add_pet(ctx, pet) Add a new pet to the store

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
pet Pet Pet object that needs to be added to the store

Return type

(empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_pet

delete_pet(ctx, pet_id, optional) Deletes a pet

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
pet_id i64 Pet id to delete
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
pet_id i64 Pet id to delete
api_key String

Return type

(empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

find_pets_by_status

Vec<::models::Pet> find_pets_by_status(ctx, status) Finds Pets by status

Multiple status values can be provided with comma separated strings

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
status Vec Status values that need to be considered for filter

Return type

Vec<::models::Pet>

Authorization

petstore_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

find_pets_by_tags

Vec<::models::Pet> find_pets_by_tags(ctx, tags) Finds Pets by tags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
tags Vec Tags to filter by

Return type

Vec<::models::Pet>

Authorization

petstore_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_pet_by_id

::models::Pet get_pet_by_id(ctx, pet_id) Find pet by ID

Returns a single pet

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
pet_id i64 ID of pet to return

Return type

::models::Pet

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_pet

update_pet(ctx, pet) Update an existing pet

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
pet Pet Pet object that needs to be added to the store

Return type

(empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_pet_with_form

update_pet_with_form(ctx, pet_id, optional) Updates a pet in the store with form data

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
pet_id i64 ID of pet that needs to be updated
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
pet_id i64 ID of pet that needs to be updated
name String Updated name of the pet
status String Updated status of the pet

Return type

(empty response body)

Authorization

petstore_auth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upload_file

::models::ApiResponse upload_file(ctx, pet_id, optional) uploads an image

Required Parameters

Name Type Description Notes
ctx context.Context context containing the authentication nil if no authentication
pet_id i64 ID of pet to update
optional map[string]interface{} optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a map[string]interface{}.

Name Type Description Notes
pet_id i64 ID of pet to update
additional_metadata String Additional data to pass to server
file ::models::File file to upload

Return type

::models::ApiResponse

Authorization

petstore_auth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]