swagger_client
This is a sample server Petstore server. You can find out more about Swagger at <a href="http://swagger.io">http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key "special-key" to test the authorization filters
This Python package is automatically generated by the Swagger Codegen project:
- API verion: 1.0.0
- Package version:
- Build date: 2016-03-30T17:18:44.943+08:00
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git
(you may need to run the command with root permission: sudo pip install git+https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git
)
Import the pacakge:
import swagger_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Import the pacakge:
import swagger_client
Manual Installation
Download the latest release to the project folder (e.g. ./path/to/swagger_client) and import the package:
import path.to.swagger_client
Getting Started
Please follow the installation procedure and then run the following:
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: petstore_auth
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.PetApi
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store (optional)
try:
# Add a new pet to the store
api_instance.add_pet(body=body);
except ApiException as e:
print "Exception when calling PetApi->add_pet: %s\n" % e
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io/v2
Class | Method | HTTP request | Description |
---|---|---|---|
PetApi | add_pet | POST /pet | Add a new pet to the store |
PetApi | add_pet_using_byte_array | POST /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store |
PetApi | delete_pet | DELETE /pet/{petId} | Deletes a pet |
PetApi | find_pets_by_status | GET /pet/findByStatus | Finds Pets by status |
PetApi | find_pets_by_tags | GET /pet/findByTags | Finds Pets by tags |
PetApi | get_pet_by_id | GET /pet/{petId} | Find pet by ID |
PetApi | get_pet_by_id_in_object | GET /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' |
PetApi | pet_pet_idtesting_byte_arraytrue_get | GET /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' |
PetApi | update_pet | PUT /pet | Update an existing pet |
PetApi | update_pet_with_form | POST /pet/{petId} | Updates a pet in the store with form data |
PetApi | upload_file | POST /pet/{petId}/uploadImage | uploads an image |
StoreApi | delete_order | DELETE /store/order/{orderId} | Delete purchase order by ID |
StoreApi | find_orders_by_status | GET /store/findByStatus | Finds orders by status |
StoreApi | get_inventory | GET /store/inventory | Returns pet inventories by status |
StoreApi | get_inventory_in_object | GET /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' |
StoreApi | get_order_by_id | GET /store/order/{orderId} | Find purchase order by ID |
StoreApi | place_order | POST /store/order | Place an order for a pet |
UserApi | create_user | POST /user | Create user |
UserApi | create_users_with_array_input | POST /user/createWithArray | Creates list of users with given input array |
UserApi | create_users_with_list_input | POST /user/createWithList | Creates list of users with given input array |
UserApi | delete_user | DELETE /user/{username} | Delete user |
UserApi | get_user_by_name | GET /user/{username} | Get user by user name |
UserApi | login_user | GET /user/login | Logs user into the system |
UserApi | logout_user | GET /user/logout | Logs out current logged in user session |
UserApi | update_user | PUT /user/{username} | Updated user |
Documentation For Models
- Animal
- Cat
- Category
- Dog
- InlineResponse200
- Model200Response
- ModelReturn
- Name
- Order
- Pet
- SpecialModelName
- Tag
- User
Documentation For Authorization
test_api_key_header
- Type: API key
- API key parameter name: test_api_key_header
- Location: HTTP header
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
test_http_basic
- Type: HTTP basic authentication
test_api_client_secret
- Type: API key
- API key parameter name: x-test_api_client_secret
- Location: HTTP header
test_api_client_id
- Type: API key
- API key parameter name: x-test_api_client_id
- Location: HTTP header
test_api_key_query
- Type: API key
- API key parameter name: test_api_key_query
- Location: URL query string
petstore_auth
- Type: OAuth
- Flow: implicit
- Authorizatoin URL: http://petstore.swagger.io/api/oauth/dialog
- Scopes:
- write:pets: modify pets in your account
- read:pets: read your pets