|
| 1 | +# swagger-client |
| 2 | +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ |
| 3 | + |
| 4 | +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: |
| 5 | + |
| 6 | +- API version: 1.0.0 |
| 7 | +- Package version: 1.0.0 |
| 8 | +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen |
| 9 | + |
| 10 | +## Requirements. |
| 11 | + |
| 12 | +Python 2.7 and 3.4+ |
| 13 | + |
| 14 | +## Installation & Usage |
| 15 | +### pip install |
| 16 | + |
| 17 | +If the python package is hosted on Github, you can install directly from Github |
| 18 | + |
| 19 | +```sh |
| 20 | +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
| 21 | +``` |
| 22 | +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
| 23 | + |
| 24 | +Then import the package: |
| 25 | +```python |
| 26 | +import swagger_client |
| 27 | +``` |
| 28 | + |
| 29 | +### Setuptools |
| 30 | + |
| 31 | +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 32 | + |
| 33 | +```sh |
| 34 | +python setup.py install --user |
| 35 | +``` |
| 36 | +(or `sudo python setup.py install` to install the package for all users) |
| 37 | + |
| 38 | +Then import the package: |
| 39 | +```python |
| 40 | +import swagger_client |
| 41 | +``` |
| 42 | + |
| 43 | +## Getting Started |
| 44 | + |
| 45 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 46 | + |
| 47 | +```python |
| 48 | +from __future__ import print_function |
| 49 | +import time |
| 50 | +import swagger_client |
| 51 | +from swagger_client.rest import ApiException |
| 52 | +from pprint import pprint |
| 53 | + |
| 54 | +# create an instance of the API class |
| 55 | +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) |
| 56 | +body = swagger_client.Animal() # Animal | Animal object that needs to be added to the store |
| 57 | + |
| 58 | +try: |
| 59 | + # Add a new animal to the store |
| 60 | + api_instance.add_animal(body) |
| 61 | +except ApiException as e: |
| 62 | + print("Exception when calling AnimalApi->add_animal: %s\n" % e) |
| 63 | + |
| 64 | +# create an instance of the API class |
| 65 | +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) |
| 66 | +animal_id = 789 # int | Animal id to delete |
| 67 | +api_key = 'api_key_example' # str | (optional) |
| 68 | + |
| 69 | +try: |
| 70 | + # Deletes a animal |
| 71 | + api_instance.delete_animal(animal_id, api_key=api_key) |
| 72 | +except ApiException as e: |
| 73 | + print("Exception when calling AnimalApi->delete_animal: %s\n" % e) |
| 74 | + |
| 75 | +# create an instance of the API class |
| 76 | +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) |
| 77 | +animal_id = 789 # int | ID of pet to return |
| 78 | + |
| 79 | +try: |
| 80 | + # Find animal by ID |
| 81 | + api_response = api_instance.get_animal_by_id(animal_id) |
| 82 | + pprint(api_response) |
| 83 | +except ApiException as e: |
| 84 | + print("Exception when calling AnimalApi->get_animal_by_id: %s\n" % e) |
| 85 | + |
| 86 | +# create an instance of the API class |
| 87 | +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) |
| 88 | +body = swagger_client.Animal() # Animal | Animal object that needs to be added. |
| 89 | + |
| 90 | +try: |
| 91 | + # Update an existing animal |
| 92 | + api_instance.update_animal(body) |
| 93 | +except ApiException as e: |
| 94 | + print("Exception when calling AnimalApi->update_animal: %s\n" % e) |
| 95 | + |
| 96 | +# create an instance of the API class |
| 97 | +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) |
| 98 | +animal_id = 789 # int | ID of animal that needs to be updated |
| 99 | +name = 'name_example' # str | (optional) |
| 100 | +status = 'status_example' # str | (optional) |
| 101 | + |
| 102 | +try: |
| 103 | + # Updates a animal |
| 104 | + api_instance.update_animal_with_form(animal_id, name=name, status=status) |
| 105 | +except ApiException as e: |
| 106 | + print("Exception when calling AnimalApi->update_animal_with_form: %s\n" % e) |
| 107 | +``` |
| 108 | + |
| 109 | +## Documentation for API Endpoints |
| 110 | + |
| 111 | +All URIs are relative to *http://petstore.swagger.io:80/v2* |
| 112 | + |
| 113 | +Class | Method | HTTP request | Description |
| 114 | +------------ | ------------- | ------------- | ------------- |
| 115 | +*AnimalApi* | [**add_animal**](docs/AnimalApi.md#add_animal) | **POST** /animal | Add a new animal to the store |
| 116 | +*AnimalApi* | [**delete_animal**](docs/AnimalApi.md#delete_animal) | **DELETE** /animal/{animalId} | Deletes a animal |
| 117 | +*AnimalApi* | [**get_animal_by_id**](docs/AnimalApi.md#get_animal_by_id) | **GET** /animal/{animalId} | Find animal by ID |
| 118 | +*AnimalApi* | [**update_animal**](docs/AnimalApi.md#update_animal) | **PUT** /animal | Update an existing animal |
| 119 | +*AnimalApi* | [**update_animal_with_form**](docs/AnimalApi.md#update_animal_with_form) | **POST** /animal/{animalId} | Updates a animal |
| 120 | +*AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags |
| 121 | +*DogApi* | [**add_dog**](docs/DogApi.md#add_dog) | **POST** /dog | Add a new dog to the store |
| 122 | +*DogApi* | [**delete_dog**](docs/DogApi.md#delete_dog) | **DELETE** /dog/{dogId} | Deletes a dog |
| 123 | +*DogApi* | [**get_dog_by_id**](docs/DogApi.md#get_dog_by_id) | **GET** /dog/{dogId} | Find dog by ID |
| 124 | +*DogApi* | [**update_dog**](docs/DogApi.md#update_dog) | **PUT** /dog | Update an existing dog |
| 125 | +*DogApi* | [**update_dog_with_form**](docs/DogApi.md#update_dog_with_form) | **POST** /dog/{dogId} | Updates a dog |
| 126 | +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | |
| 127 | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | |
| 128 | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | |
| 129 | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | |
| 130 | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model |
| 131 | +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
| 132 | +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters |
| 133 | +*FakeApi* | [**test_enum_request_body**](docs/FakeApi.md#test_enum_request_body) | **POST** /fake/enum/form | To test enum parameters |
| 134 | +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
| 135 | +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **POST** /fake/jsonFormData | test json serialization of form data |
| 136 | +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case |
| 137 | +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store |
| 138 | +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet |
| 139 | +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status |
| 140 | +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags |
| 141 | +*PetApi* | [**get_all_pets**](docs/PetApi.md#get_all_pets) | **GET** /allPets | |
| 142 | +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID |
| 143 | +*PetApi* | [**get_random_pet**](docs/PetApi.md#get_random_pet) | **GET** /randomPet | |
| 144 | +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet |
| 145 | +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data |
| 146 | +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image |
| 147 | +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID |
| 148 | +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status |
| 149 | +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID |
| 150 | +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet |
| 151 | +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user |
| 152 | +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array |
| 153 | +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array |
| 154 | +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user |
| 155 | +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name |
| 156 | +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system |
| 157 | +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session |
| 158 | +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user |
| 159 | + |
| 160 | +## Documentation For Models |
| 161 | + |
| 162 | + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) |
| 163 | + - [AllPetsResponse](docs/AllPetsResponse.md) |
| 164 | + - [Animal](docs/Animal.md) |
| 165 | + - [AnimalFarm](docs/AnimalFarm.md) |
| 166 | + - [ApiResponse](docs/ApiResponse.md) |
| 167 | + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) |
| 168 | + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) |
| 169 | + - [ArrayTest](docs/ArrayTest.md) |
| 170 | + - [Body](docs/Body.md) |
| 171 | + - [Body1](docs/Body1.md) |
| 172 | + - [Body2](docs/Body2.md) |
| 173 | + - [Body3](docs/Body3.md) |
| 174 | + - [Body4](docs/Body4.md) |
| 175 | + - [Body5](docs/Body5.md) |
| 176 | + - [Body6](docs/Body6.md) |
| 177 | + - [Body7](docs/Body7.md) |
| 178 | + - [Capitalization](docs/Capitalization.md) |
| 179 | + - [Cat](docs/Cat.md) |
| 180 | + - [Category](docs/Category.md) |
| 181 | + - [ClassModel](docs/ClassModel.md) |
| 182 | + - [Client](docs/Client.md) |
| 183 | + - [Dog](docs/Dog.md) |
| 184 | + - [EnumArrays](docs/EnumArrays.md) |
| 185 | + - [EnumClass](docs/EnumClass.md) |
| 186 | + - [EnumTest](docs/EnumTest.md) |
| 187 | + - [FormatTest](docs/FormatTest.md) |
| 188 | + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) |
| 189 | + - [List](docs/List.md) |
| 190 | + - [MapTest](docs/MapTest.md) |
| 191 | + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) |
| 192 | + - [Model200Response](docs/Model200Response.md) |
| 193 | + - [ModelReturn](docs/ModelReturn.md) |
| 194 | + - [Name](docs/Name.md) |
| 195 | + - [NumberOnly](docs/NumberOnly.md) |
| 196 | + - [OneOfAllPetsResponseItems](docs/OneOfAllPetsResponseItems.md) |
| 197 | + - [OneOfSinglePetResponsePet](docs/OneOfSinglePetResponsePet.md) |
| 198 | + - [Order](docs/Order.md) |
| 199 | + - [OuterBoolean](docs/OuterBoolean.md) |
| 200 | + - [OuterComposite](docs/OuterComposite.md) |
| 201 | + - [OuterEnum](docs/OuterEnum.md) |
| 202 | + - [OuterNumber](docs/OuterNumber.md) |
| 203 | + - [OuterString](docs/OuterString.md) |
| 204 | + - [Pet](docs/Pet.md) |
| 205 | + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) |
| 206 | + - [SinglePetResponse](docs/SinglePetResponse.md) |
| 207 | + - [SpecialModelName](docs/SpecialModelName.md) |
| 208 | + - [Tag](docs/Tag.md) |
| 209 | + - [User](docs/User.md) |
| 210 | + |
| 211 | +## Documentation For Authorization |
| 212 | + |
| 213 | + |
| 214 | +## api_key |
| 215 | + |
| 216 | +- **Type**: API key |
| 217 | +- **API key parameter name**: api_key |
| 218 | +- **Location**: HTTP header |
| 219 | + |
| 220 | +## api_key_query |
| 221 | + |
| 222 | +- **Type**: API key |
| 223 | +- **API key parameter name**: api_key_query |
| 224 | +- **Location**: URL query string |
| 225 | + |
| 226 | +## http_basic_test |
| 227 | + |
| 228 | +- **Type**: HTTP basic authentication |
| 229 | + |
| 230 | +## petstore_auth |
| 231 | + |
| 232 | +- **Type**: OAuth |
| 233 | +- **Flow**: implicit |
| 234 | +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog |
| 235 | +- **Scopes**: |
| 236 | + - ****: |
| 237 | + |
| 238 | + |
| 239 | +## Author |
| 240 | + |
| 241 | + |
0 commit comments