|
| 1 | +# SwaggerClient |
| 2 | + |
| 3 | +This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters |
| 4 | + |
| 5 | +This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 6 | + |
| 7 | +- API version: 1.0.0 |
| 8 | +- Package version: |
| 9 | +- Generator version: 7.19.0-SNAPSHOT |
| 10 | +- Build package: org.openapitools.codegen.languages.ObjcClientCodegen |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project. |
| 15 | + |
| 16 | +## Installation & Usage |
| 17 | +### Install from Github using [CocoaPods](https://cocoapods.org/) |
| 18 | + |
| 19 | +Add the following to the Podfile: |
| 20 | + |
| 21 | +```ruby |
| 22 | +pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' |
| 23 | +``` |
| 24 | + |
| 25 | +To specify a particular branch, append `, :branch => 'branch-name-here'` |
| 26 | + |
| 27 | +To specify a particular commit, append `, :commit => '11aa22'` |
| 28 | + |
| 29 | +### Install from local path using [CocoaPods](https://cocoapods.org/) |
| 30 | + |
| 31 | +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: |
| 32 | + |
| 33 | +```ruby |
| 34 | +pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' |
| 35 | +``` |
| 36 | + |
| 37 | +### Usage |
| 38 | + |
| 39 | +Import the following: |
| 40 | + |
| 41 | +```objc |
| 42 | +#import <SwaggerClient/SWGApiClient.h> |
| 43 | +#import <SwaggerClient/SWGDefaultConfiguration.h> |
| 44 | +// load models |
| 45 | +#import <SwaggerClient/SWGCategory.h> |
| 46 | +#import <SwaggerClient/SWGOrder.h> |
| 47 | +#import <SwaggerClient/SWGPet.h> |
| 48 | +#import <SwaggerClient/SWGTag.h> |
| 49 | +#import <SwaggerClient/SWGUser.h> |
| 50 | +// load API classes for accessing endpoints |
| 51 | +#import <SwaggerClient/SWGPetApi.h> |
| 52 | +#import <SwaggerClient/SWGStoreApi.h> |
| 53 | +#import <SwaggerClient/SWGUserApi.h> |
| 54 | + |
| 55 | +``` |
| 56 | + |
| 57 | +## Recommendation |
| 58 | + |
| 59 | +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. |
| 60 | + |
| 61 | +## Getting Started |
| 62 | + |
| 63 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 64 | + |
| 65 | +```objc |
| 66 | + |
| 67 | +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; |
| 68 | + |
| 69 | +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) |
| 70 | +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; |
| 71 | + |
| 72 | + |
| 73 | +SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) |
| 74 | + |
| 75 | +SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; |
| 76 | + |
| 77 | +// Add a new pet to the store |
| 78 | +[apiInstance addPetWithPet:pet |
| 79 | + completionHandler: ^(NSError* error) { |
| 80 | + if (error) { |
| 81 | + NSLog(@"Error: %@", error); |
| 82 | + } |
| 83 | + }]; |
| 84 | + |
| 85 | +``` |
| 86 | +
|
| 87 | +## Documentation for API Endpoints |
| 88 | +
|
| 89 | +All URIs are relative to *http://petstore.swagger.io/v2* |
| 90 | +
|
| 91 | +Class | Method | HTTP request | Description |
| 92 | +------------ | ------------- | ------------- | ------------- |
| 93 | +*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store |
| 94 | +*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet |
| 95 | +*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status |
| 96 | +*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags |
| 97 | +*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID |
| 98 | +*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet |
| 99 | +*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data |
| 100 | +*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image |
| 101 | +*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID |
| 102 | +*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status |
| 103 | +*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID |
| 104 | +*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet |
| 105 | +*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user |
| 106 | +*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array |
| 107 | +*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array |
| 108 | +*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user |
| 109 | +*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name |
| 110 | +*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system |
| 111 | +*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session |
| 112 | +*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user |
| 113 | +
|
| 114 | +
|
| 115 | +## Documentation For Models |
| 116 | +
|
| 117 | + - [SWGCategory](docs/SWGCategory.md) |
| 118 | + - [SWGOrder](docs/SWGOrder.md) |
| 119 | + - [SWGPet](docs/SWGPet.md) |
| 120 | + - [SWGTag](docs/SWGTag.md) |
| 121 | + - [SWGUser](docs/SWGUser.md) |
| 122 | +
|
| 123 | +
|
| 124 | +## Documentation For Authorization |
| 125 | +
|
| 126 | +
|
| 127 | +Authentication schemes defined for the API: |
| 128 | +### api_key |
| 129 | +
|
| 130 | +- **Type**: API key |
| 131 | +- **API key parameter name**: api_key |
| 132 | +- **Location**: HTTP header |
| 133 | +
|
| 134 | +### petstore_auth |
| 135 | +
|
| 136 | +- **Type**: OAuth |
| 137 | +- **Flow**: implicit |
| 138 | +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog |
| 139 | +- **Scopes**: |
| 140 | + - **write:pets**: modify pets in your account |
| 141 | + - **read:pets**: read your pets |
| 142 | +
|
| 143 | +
|
| 144 | +## Author |
| 145 | +
|
| 146 | +
|
| 147 | +
|
0 commit comments