|
| 1 | +# petstore_api |
| 2 | +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. |
| 3 | + |
| 4 | +This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: |
| 5 | + |
| 6 | +- API version: 1.0.0 |
| 7 | +- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen |
| 8 | + |
| 9 | +## Requirements |
| 10 | + |
| 11 | +Dart 2 or later OR Flutter 0.7.0 or later. |
| 12 | + |
| 13 | +Once your code is generated, you need to run the build_runner command to let Jaguar implement your API: |
| 14 | + |
| 15 | +```sh |
| 16 | +flutter packages pub run build_runner build |
| 17 | +or |
| 18 | +pub run build_runner build |
| 19 | +``` |
| 20 | + |
| 21 | +## Installation & Usage |
| 22 | + |
| 23 | +### Github |
| 24 | +If this Dart package is published to Github, please include the following in pubspec.yaml |
| 25 | +``` |
| 26 | +name: petstore_api |
| 27 | +version: 1.0.0 |
| 28 | +description: OpenAPI API client |
| 29 | +dependencies: |
| 30 | + petstore_api: |
| 31 | + git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
| 32 | + version: 'any' |
| 33 | +``` |
| 34 | + |
| 35 | +### Local |
| 36 | +To use the package in your local drive, please include the following in pubspec.yaml |
| 37 | +``` |
| 38 | +dependencies: |
| 39 | + petstore_api: |
| 40 | + path: /path/to/petstore_api |
| 41 | +``` |
| 42 | + |
| 43 | +## Tests |
| 44 | + |
| 45 | +TODO |
| 46 | + |
| 47 | +## Getting Started |
| 48 | + |
| 49 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 50 | + |
| 51 | +```dart |
| 52 | +import 'package:petstore_api/api.dart'; |
| 53 | +
|
| 54 | +// TODO Configure OAuth2 access token for authorization: petstore_auth |
| 55 | +//petstore_api.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; |
| 56 | +
|
| 57 | +final jaguarApiGen = PetstoreApi(); |
| 58 | +var api_instance = jaguarApiGen.getPetApi(); |
| 59 | +var body = new Pet(); // Pet | Pet object that needs to be added to the store |
| 60 | +
|
| 61 | +try { |
| 62 | + api_instance.addPet(body); |
| 63 | +} catch (e) { |
| 64 | + print("Exception when calling PetApi->addPet: $e\n"); |
| 65 | +} |
| 66 | +
|
| 67 | +``` |
| 68 | + |
| 69 | +## Documentation for API Endpoints |
| 70 | + |
| 71 | +All URIs are relative to *http://petstore.swagger.io/v2* |
| 72 | + |
| 73 | +Class | Method | HTTP request | Description |
| 74 | +------------ | ------------- | ------------- | ------------- |
| 75 | +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store |
| 76 | +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet |
| 77 | +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status |
| 78 | +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags |
| 79 | +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID |
| 80 | +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet |
| 81 | +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data |
| 82 | +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image |
| 83 | +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID |
| 84 | +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status |
| 85 | +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID |
| 86 | +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet |
| 87 | +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user |
| 88 | +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array |
| 89 | +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array |
| 90 | +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user |
| 91 | +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name |
| 92 | +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system |
| 93 | +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session |
| 94 | +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user |
| 95 | + |
| 96 | + |
| 97 | +## Documentation For Models |
| 98 | + |
| 99 | + - [ApiResponse](doc//ApiResponse.md) |
| 100 | + - [Category](doc//Category.md) |
| 101 | + - [Order](doc//Order.md) |
| 102 | + - [Pet](doc//Pet.md) |
| 103 | + - [Tag](doc//Tag.md) |
| 104 | + - [User](doc//User.md) |
| 105 | + |
| 106 | + |
| 107 | +## Documentation For Authorization |
| 108 | + |
| 109 | + |
| 110 | +## api_key |
| 111 | + |
| 112 | +- **Type**: API key |
| 113 | +- **API key parameter name**: api_key |
| 114 | +- **Location**: HTTP header |
| 115 | + |
| 116 | +## petstore_auth |
| 117 | + |
| 118 | +- **Type**: OAuth |
| 119 | +- **Flow**: implicit |
| 120 | +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog |
| 121 | +- **Scopes**: |
| 122 | + - **write:pets**: modify pets in your account |
| 123 | + - **read:pets**: read your pets |
| 124 | + |
| 125 | + |
| 126 | +## Author |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
0 commit comments