forked from loafle/openapi-generator-original
Merge pull request #2415 from wing328/php_update_sample
[PHP] update sample code, update test case
This commit is contained in:
commit
b89531a722
@ -3,7 +3,7 @@
|
|||||||
{{{appDescription}}}
|
{{{appDescription}}}
|
||||||
{{/appDescription}}
|
{{/appDescription}}
|
||||||
|
|
||||||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
- API verion: {{appVersion}}
|
- API verion: {{appVersion}}
|
||||||
- Package version: {{artifactVersion}}
|
- Package version: {{artifactVersion}}
|
||||||
@ -20,7 +20,7 @@ PHP 5.4.0 and later
|
|||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
### Composer
|
### Composer
|
||||||
|
|
||||||
You can install the bindings via [Composer](http://getcomposer.org/). Add this to your `composer.json`:
|
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
@ -36,11 +36,12 @@ You can install the bindings via [Composer](http://getcomposer.org/). Add this t
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then install via `composer install`
|
Then run `composer install`
|
||||||
|
|
||||||
### Manual Installation
|
### Manual Installation
|
||||||
|
|
||||||
If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the `autoload.php` file.
|
Download the files and include `autoload.php`:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
require_once('/path/to/{{packagePath}}/autoload.php');
|
require_once('/path/to/{{packagePath}}/autoload.php');
|
||||||
```
|
```
|
||||||
@ -48,6 +49,7 @@ If you do not wish to use Composer, you can download the latest release. Then, t
|
|||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
To run the unit tests:
|
To run the unit tests:
|
||||||
|
|
||||||
```
|
```
|
||||||
composer install
|
composer install
|
||||||
./vendor/bin/phpunit lib/Tests
|
./vendor/bin/phpunit lib/Tests
|
||||||
@ -55,24 +57,24 @@ composer install
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Please follow the installation procedure and then run the following:
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
// Configure HTTP basic authorization: {{{name}}}
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setUsername('YOUR_USERNAME');
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}}
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}}
|
||||||
// Configure API key authorization: {{{name}}}
|
// Configure API key authorization: {{{name}}}
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY');
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// {{{invokerPackage}}}::getDefaultConfiguration->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
|
// {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
|
||||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}}
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}}
|
||||||
{{/hasAuthMethods}}
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
$api_instance = new {{invokerPackage}}\{{classname}}();
|
$api_instance = new {{invokerPackage}}\Api\{{classname}}();
|
||||||
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
|
@ -23,17 +23,17 @@ Method | HTTP request | Description
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
// Configure HTTP basic authorization: {{{name}}}
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setUsername('YOUR_USERNAME');
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}}
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}}
|
||||||
// Configure API key authorization: {{{name}}}
|
// Configure API key authorization: {{{name}}}
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY');
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// {{{invokerPackage}}}::getDefaultConfiguration->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
|
// {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
|
||||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
{{{invokerPackage}}}::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}}
|
{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}}
|
||||||
{{/hasAuthMethods}}
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
$api_instance = new {{invokerPackage}}\{{classname}}();
|
$api_instance = new {{invokerPackage}}\Api\{{classname}}();
|
||||||
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# SwaggerClient-php
|
# SwaggerClient-php
|
||||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||||
|
|
||||||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
- API verion: 1.0.0
|
- API verion: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-03-18T00:51:26.562+01:00
|
- Build date: 2016-03-19T16:11:03.465+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -15,7 +15,7 @@ PHP 5.4.0 and later
|
|||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
### Composer
|
### Composer
|
||||||
|
|
||||||
You can install the bindings via [Composer](http://getcomposer.org/). Add this to your `composer.json`:
|
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
@ -31,11 +31,12 @@ You can install the bindings via [Composer](http://getcomposer.org/). Add this t
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then install via `composer install`
|
Then run `composer install`
|
||||||
|
|
||||||
### Manual Installation
|
### Manual Installation
|
||||||
|
|
||||||
If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the `autoload.php` file.
|
Download the files and include `autoload.php`:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
require_once('/path/to/SwaggerClient-php/autoload.php');
|
require_once('/path/to/SwaggerClient-php/autoload.php');
|
||||||
```
|
```
|
||||||
@ -43,6 +44,7 @@ If you do not wish to use Composer, you can download the latest release. Then, t
|
|||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
To run the unit tests:
|
To run the unit tests:
|
||||||
|
|
||||||
```
|
```
|
||||||
composer install
|
composer install
|
||||||
./vendor/bin/phpunit lib/Tests
|
./vendor/bin/phpunit lib/Tests
|
||||||
@ -50,16 +52,16 @@ composer install
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Please follow the installation procedure and then run the following:
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -121,25 +123,10 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation For Authorization
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
## petstore_auth
|
## test_api_key_header
|
||||||
|
|
||||||
- **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
|
|
||||||
|
|
||||||
## test_api_client_id
|
|
||||||
|
|
||||||
- **Type**: API key
|
- **Type**: API key
|
||||||
- **API key parameter name**: x-test_api_client_id
|
- **API key parameter name**: test_api_key_header
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
## test_api_client_secret
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: x-test_api_client_secret
|
|
||||||
- **Location**: HTTP header
|
- **Location**: HTTP header
|
||||||
|
|
||||||
## api_key
|
## api_key
|
||||||
@ -152,17 +139,32 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- **Type**: HTTP basic authentication
|
- **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
|
## test_api_key_query
|
||||||
|
|
||||||
- **Type**: API key
|
- **Type**: API key
|
||||||
- **API key parameter name**: test_api_key_query
|
- **API key parameter name**: test_api_key_query
|
||||||
- **Location**: URL query string
|
- **Location**: URL query string
|
||||||
|
|
||||||
## test_api_key_header
|
## petstore_auth
|
||||||
|
|
||||||
- **Type**: API key
|
- **Type**: OAuth
|
||||||
- **API key parameter name**: test_api_key_header
|
- **Flow**: implicit
|
||||||
- **Location**: HTTP header
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**photo_urls** | **string[]** | | [optional]
|
**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional]
|
||||||
**name** | **string** | | [optional]
|
|
||||||
**id** | **int** | |
|
**id** | **int** | |
|
||||||
**category** | **object** | | [optional]
|
**category** | **object** | | [optional]
|
||||||
**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional]
|
|
||||||
**status** | **string** | pet status in the store | [optional]
|
**status** | **string** | pet status in the store | [optional]
|
||||||
|
**name** | **string** | | [optional]
|
||||||
|
**photo_urls** | **string[]** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **int** | | [optional]
|
**name** | **int** | | [optional]
|
||||||
|
**snake_case** | **int** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ Add a new pet to the store
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -77,9 +77,9 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$body = "B"; // string | Pet object in the form of byte array
|
$body = "B"; // string | Pet object in the form of byte array
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -124,9 +124,9 @@ Deletes a pet
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | Pet id to delete
|
$pet_id = 789; // int | Pet id to delete
|
||||||
$api_key = "api_key_example"; // string |
|
$api_key = "api_key_example"; // string |
|
||||||
|
|
||||||
@ -173,9 +173,9 @@ Multiple status values can be provided with comma separated strings
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$status = array("available"); // string[] | Status values that need to be considered for query
|
$status = array("available"); // string[] | Status values that need to be considered for query
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -221,9 +221,9 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$tags = array("tags_example"); // string[] | Tags to filter by
|
$tags = array("tags_example"); // string[] | Tags to filter by
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -268,14 +268,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -299,7 +299,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
@ -320,14 +320,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -351,7 +351,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
@ -372,14 +372,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -403,7 +403,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
@ -425,9 +425,9 @@ Update an existing pet
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -472,9 +472,9 @@ Updates a pet in the store with form data
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = "pet_id_example"; // string | ID of pet that needs to be updated
|
$pet_id = "pet_id_example"; // string | ID of pet that needs to be updated
|
||||||
$name = "name_example"; // string | Updated name of the pet
|
$name = "name_example"; // string | Updated name of the pet
|
||||||
$status = "status_example"; // string | Updated status of the pet
|
$status = "status_example"; // string | Updated status of the pet
|
||||||
@ -523,9 +523,9 @@ uploads an image
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet to update
|
$pet_id = 789; // int | ID of pet to update
|
||||||
$additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server
|
$additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server
|
||||||
$file = "/path/to/file.txt"; // \SplFileObject | file to upload
|
$file = "/path/to/file.txt"; // \SplFileObject | file to upload
|
||||||
|
@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$order_id = "order_id_example"; // string | ID of the order that needs to be deleted
|
$order_id = "order_id_example"; // string | ID of the order that needs to be deleted
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -69,15 +69,15 @@ A single status value can be provided as a string
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure API key authorization: test_api_client_id
|
// Configure API key authorization: test_api_client_id
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
||||||
// Configure API key authorization: test_api_client_secret
|
// Configure API key authorization: test_api_client_secret
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$status = "placed"; // string | Status value that needs to be considered for query
|
$status = "placed"; // string | Status value that needs to be considered for query
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -123,11 +123,11 @@ Returns a map of status codes to quantities
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->getInventory();
|
$result = $api_instance->getInventory();
|
||||||
@ -169,11 +169,11 @@ Returns an arbitrary object which is actually a map of status codes to quantitie
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->getInventoryInObject();
|
$result = $api_instance->getInventoryInObject();
|
||||||
@ -214,16 +214,16 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure API key authorization: test_api_key_query
|
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
|
||||||
// Configure API key authorization: test_api_key_header
|
// Configure API key authorization: test_api_key_header
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_key_query
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -247,7 +247,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[test_api_key_query](../README.md#test_api_key_query), [test_api_key_header](../README.md#test_api_key_header)
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
@ -269,15 +269,15 @@ Place an order for a pet
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure API key authorization: test_api_client_id
|
// Configure API key authorization: test_api_client_id
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
||||||
// Configure API key authorization: test_api_client_secret
|
// Configure API key authorization: test_api_client_secret
|
||||||
Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
|
$body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -26,7 +26,7 @@ This can only be done by the logged in user.
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object
|
$body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -70,7 +70,7 @@ Creates list of users with given input array
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
|
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -114,7 +114,7 @@ Creates list of users with given input array
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
|
$body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -159,10 +159,10 @@ This can only be done by the logged in user.
|
|||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure HTTP basic authorization: test_http_basic
|
// Configure HTTP basic authorization: test_http_basic
|
||||||
Swagger\Client::getDefaultConfiguration->setUsername('YOUR_USERNAME');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
|
||||||
Swagger\Client::getDefaultConfiguration->setPassword('YOUR_PASSWORD');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$username = "username_example"; // string | The name that needs to be deleted
|
$username = "username_example"; // string | The name that needs to be deleted
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -206,7 +206,7 @@ Get user by user name
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
|
$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -251,7 +251,7 @@ Logs user into the system
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$username = "username_example"; // string | The user name for login
|
$username = "username_example"; // string | The user name for login
|
||||||
$password = "password_example"; // string | The password for login in clear text
|
$password = "password_example"; // string | The password for login in clear text
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ Logs out current logged in user session
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$api_instance->logoutUser();
|
$api_instance->logoutUser();
|
||||||
@ -338,7 +338,7 @@ This can only be done by the logged in user.
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\UserApi();
|
$api_instance = new Swagger\Client\Api\UserApi();
|
||||||
$username = "username_example"; // string | name that need to be deleted
|
$username = "username_example"; // string | name that need to be deleted
|
||||||
$body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object
|
$body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object
|
||||||
|
|
||||||
|
@ -618,11 +618,6 @@ class PetApi
|
|||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// this endpoint requires OAuth (access token)
|
|
||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
@ -630,6 +625,11 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this endpoint requires OAuth (access token)
|
||||||
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -725,11 +725,6 @@ class PetApi
|
|||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// this endpoint requires OAuth (access token)
|
|
||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
@ -737,6 +732,11 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this endpoint requires OAuth (access token)
|
||||||
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -832,11 +832,6 @@ class PetApi
|
|||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
// this endpoint requires OAuth (access token)
|
|
||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
@ -844,6 +839,11 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this endpoint requires OAuth (access token)
|
||||||
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
|
@ -525,16 +525,16 @@ class StoreApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
$queryParams['test_api_key_query'] = $apiKey;
|
$headerParams['test_api_key_header'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
$headerParams['test_api_key_header'] = $apiKey;
|
$queryParams['test_api_key_query'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,12 +51,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $swaggerTypes = array(
|
static $swaggerTypes = array(
|
||||||
'photo_urls' => 'string[]',
|
'tags' => '\Swagger\Client\Model\Tag[]',
|
||||||
'name' => 'string',
|
|
||||||
'id' => 'int',
|
'id' => 'int',
|
||||||
'category' => 'object',
|
'category' => 'object',
|
||||||
'tags' => '\Swagger\Client\Model\Tag[]',
|
'status' => 'string',
|
||||||
'status' => 'string'
|
'name' => 'string',
|
||||||
|
'photo_urls' => 'string[]'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function swaggerTypes() {
|
static function swaggerTypes() {
|
||||||
@ -68,12 +68,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $attributeMap = array(
|
static $attributeMap = array(
|
||||||
'photo_urls' => 'photoUrls',
|
'tags' => 'tags',
|
||||||
'name' => 'name',
|
|
||||||
'id' => 'id',
|
'id' => 'id',
|
||||||
'category' => 'category',
|
'category' => 'category',
|
||||||
'tags' => 'tags',
|
'status' => 'status',
|
||||||
'status' => 'status'
|
'name' => 'name',
|
||||||
|
'photo_urls' => 'photoUrls'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function attributeMap() {
|
static function attributeMap() {
|
||||||
@ -85,12 +85,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $setters = array(
|
static $setters = array(
|
||||||
'photo_urls' => 'setPhotoUrls',
|
'tags' => 'setTags',
|
||||||
'name' => 'setName',
|
|
||||||
'id' => 'setId',
|
'id' => 'setId',
|
||||||
'category' => 'setCategory',
|
'category' => 'setCategory',
|
||||||
'tags' => 'setTags',
|
'status' => 'setStatus',
|
||||||
'status' => 'setStatus'
|
'name' => 'setName',
|
||||||
|
'photo_urls' => 'setPhotoUrls'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function setters() {
|
static function setters() {
|
||||||
@ -102,12 +102,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $getters = array(
|
static $getters = array(
|
||||||
'photo_urls' => 'getPhotoUrls',
|
'tags' => 'getTags',
|
||||||
'name' => 'getName',
|
|
||||||
'id' => 'getId',
|
'id' => 'getId',
|
||||||
'category' => 'getCategory',
|
'category' => 'getCategory',
|
||||||
'tags' => 'getTags',
|
'status' => 'getStatus',
|
||||||
'status' => 'getStatus'
|
'name' => 'getName',
|
||||||
|
'photo_urls' => 'getPhotoUrls'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function getters() {
|
static function getters() {
|
||||||
@ -116,16 +116,10 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $photo_urls
|
* $tags
|
||||||
* @var string[]
|
* @var \Swagger\Client\Model\Tag[]
|
||||||
*/
|
*/
|
||||||
protected $photo_urls;
|
protected $tags;
|
||||||
|
|
||||||
/**
|
|
||||||
* $name
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $name;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
@ -139,18 +133,24 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
protected $category;
|
protected $category;
|
||||||
|
|
||||||
/**
|
|
||||||
* $tags
|
|
||||||
* @var \Swagger\Client\Model\Tag[]
|
|
||||||
*/
|
|
||||||
protected $tags;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $status pet status in the store
|
* $status pet status in the store
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $status;
|
protected $status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $photo_urls
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $photo_urls;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -159,54 +159,33 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->photo_urls = $data["photo_urls"];
|
$this->tags = $data["tags"];
|
||||||
$this->name = $data["name"];
|
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->category = $data["category"];
|
$this->category = $data["category"];
|
||||||
$this->tags = $data["tags"];
|
|
||||||
$this->status = $data["status"];
|
$this->status = $data["status"];
|
||||||
|
$this->name = $data["name"];
|
||||||
|
$this->photo_urls = $data["photo_urls"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets photo_urls
|
* Gets tags
|
||||||
* @return string[]
|
* @return \Swagger\Client\Model\Tag[]
|
||||||
*/
|
*/
|
||||||
public function getPhotoUrls()
|
public function getTags()
|
||||||
{
|
{
|
||||||
return $this->photo_urls;
|
return $this->tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets photo_urls
|
* Sets tags
|
||||||
* @param string[] $photo_urls
|
* @param \Swagger\Client\Model\Tag[] $tags
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setPhotoUrls($photo_urls)
|
public function setTags($tags)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->photo_urls = $photo_urls;
|
$this->tags = $tags;
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets name
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets name
|
|
||||||
* @param string $name
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setName($name)
|
|
||||||
{
|
|
||||||
|
|
||||||
$this->name = $name;
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,27 +231,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets tags
|
|
||||||
* @return \Swagger\Client\Model\Tag[]
|
|
||||||
*/
|
|
||||||
public function getTags()
|
|
||||||
{
|
|
||||||
return $this->tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets tags
|
|
||||||
* @param \Swagger\Client\Model\Tag[] $tags
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setTags($tags)
|
|
||||||
{
|
|
||||||
|
|
||||||
$this->tags = $tags;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status
|
* Gets status
|
||||||
* @return string
|
* @return string
|
||||||
@ -297,6 +255,48 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets name
|
||||||
|
* @param string $name
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setName($name)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->name = $name;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets photo_urls
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function getPhotoUrls()
|
||||||
|
{
|
||||||
|
return $this->photo_urls;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets photo_urls
|
||||||
|
* @param string[] $photo_urls
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setPhotoUrls($photo_urls)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->photo_urls = $photo_urls;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
|
@ -51,7 +51,8 @@ class Name implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $swaggerTypes = array(
|
static $swaggerTypes = array(
|
||||||
'name' => 'int'
|
'name' => 'int',
|
||||||
|
'snake_case' => 'int'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function swaggerTypes() {
|
static function swaggerTypes() {
|
||||||
@ -63,7 +64,8 @@ class Name implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $attributeMap = array(
|
static $attributeMap = array(
|
||||||
'name' => 'name'
|
'name' => 'name',
|
||||||
|
'snake_case' => 'snake_case'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function attributeMap() {
|
static function attributeMap() {
|
||||||
@ -75,7 +77,8 @@ class Name implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $setters = array(
|
static $setters = array(
|
||||||
'name' => 'setName'
|
'name' => 'setName',
|
||||||
|
'snake_case' => 'setSnakeCase'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function setters() {
|
static function setters() {
|
||||||
@ -87,7 +90,8 @@ class Name implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $getters = array(
|
static $getters = array(
|
||||||
'name' => 'getName'
|
'name' => 'getName',
|
||||||
|
'snake_case' => 'getSnakeCase'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function getters() {
|
static function getters() {
|
||||||
@ -101,6 +105,12 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $snake_case
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $snake_case;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -110,6 +120,7 @@ class Name implements ArrayAccess
|
|||||||
{
|
{
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
|
$this->snake_case = $data["snake_case"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,6 +145,27 @@ class Name implements ArrayAccess
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets snake_case
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getSnakeCase()
|
||||||
|
{
|
||||||
|
return $this->snake_case;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets snake_case
|
||||||
|
* @param int $snake_case
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setSnakeCase($snake_case)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->snake_case = $snake_case;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
|
@ -257,7 +257,7 @@ class ObjectSerializer
|
|||||||
} else {
|
} else {
|
||||||
$deserialized = null;
|
$deserialized = null;
|
||||||
}
|
}
|
||||||
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
|
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
||||||
settype($data, $class);
|
settype($data, $class);
|
||||||
$deserialized = $data;
|
$deserialized = $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
|
@ -43,7 +43,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$new_pet->setTags(array($tag));
|
$new_pet->setTags(array($tag));
|
||||||
$new_pet->setCategory($category);
|
$new_pet->setCategory($category);
|
||||||
|
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI();
|
$pet_api = new Swagger\Client\Api\PetApi();
|
||||||
// add a new pet (model)
|
// add a new pet (model)
|
||||||
$add_response = $pet_api->addPet($new_pet);
|
$add_response = $pet_api->addPet($new_pet);
|
||||||
}
|
}
|
||||||
@ -74,14 +74,14 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$defaultHeader = $api_client->getConfig()->getDefaultHeaders();
|
$defaultHeader = $api_client->getConfig()->getDefaultHeaders();
|
||||||
$this->assertFalse(isset($defaultHeader['test2']));
|
$this->assertFalse(isset($defaultHeader['test2']));
|
||||||
|
|
||||||
$pet_api2 = new Swagger\Client\Api\PetAPI();
|
$pet_api2 = new Swagger\Client\Api\PetApi();
|
||||||
$config3 = new Swagger\Client\Configuration();
|
$config3 = new Swagger\Client\Configuration();
|
||||||
$apiClient3 = new Swagger\Client\ApiClient($config3);
|
$apiClient3 = new Swagger\Client\ApiClient($config3);
|
||||||
$apiClient3->getConfig()->setUserAgent('api client 3');
|
$apiClient3->getConfig()->setUserAgent('api client 3');
|
||||||
$config4 = new Swagger\Client\Configuration();
|
$config4 = new Swagger\Client\Configuration();
|
||||||
$apiClient4 = new Swagger\Client\ApiClient($config4);
|
$apiClient4 = new Swagger\Client\ApiClient($config4);
|
||||||
$apiClient4->getConfig()->setUserAgent('api client 4');
|
$apiClient4->getConfig()->setUserAgent('api client 4');
|
||||||
$pet_api3 = new Swagger\Client\Api\PetAPI($apiClient3);
|
$pet_api3 = new Swagger\Client\Api\PetApi($apiClient3);
|
||||||
|
|
||||||
// 2 different api clients are not the same
|
// 2 different api clients are not the same
|
||||||
$this->assertNotEquals($apiClient3, $apiClient4);
|
$this->assertNotEquals($apiClient3, $apiClient4);
|
||||||
@ -98,7 +98,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
// initialize the API client without host
|
// initialize the API client without host
|
||||||
$pet_id = 10005; // ID of pet that needs to be fetched
|
$pet_id = 10005; // ID of pet that needs to be fetched
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI();
|
$pet_api = new Swagger\Client\Api\PetApi();
|
||||||
$pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');
|
$pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');
|
||||||
// return Pet (model)
|
// return Pet (model)
|
||||||
$response = $pet_api->getPetById($pet_id);
|
$response = $pet_api->getPetById($pet_id);
|
||||||
@ -116,7 +116,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
// initialize the API client without host
|
// initialize the API client without host
|
||||||
$pet_id = 10005; // ID of pet that needs to be fetched
|
$pet_id = 10005; // ID of pet that needs to be fetched
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI();
|
$pet_api = new Swagger\Client\Api\PetApi();
|
||||||
$pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');
|
$pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');
|
||||||
// return Pet (inline model)
|
// return Pet (inline model)
|
||||||
$response = $pet_api->getPetByIdInObject($pet_id);
|
$response = $pet_api->getPetByIdInObject($pet_id);
|
||||||
@ -139,7 +139,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
// initialize the API client without host
|
// initialize the API client without host
|
||||||
$pet_id = 10005; // ID of pet that needs to be fetched
|
$pet_id = 10005; // ID of pet that needs to be fetched
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI();
|
$pet_api = new Swagger\Client\Api\PetApi();
|
||||||
$pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');
|
$pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');
|
||||||
// return Pet (model)
|
// return Pet (model)
|
||||||
list($response, $status_code, $response_headers) = $pet_api->getPetByIdWithHttpInfo($pet_id);
|
list($response, $status_code, $response_headers) = $pet_api->getPetByIdWithHttpInfo($pet_id);
|
||||||
@ -159,7 +159,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
// initialize the API client
|
// initialize the API client
|
||||||
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\ApiClient($config);
|
$api_client = new Swagger\Client\ApiClient($config);
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// return Pet (model)
|
// return Pet (model)
|
||||||
$response = $pet_api->findPetsByStatus("available");
|
$response = $pet_api->findPetsByStatus("available");
|
||||||
$this->assertGreaterThan(0, count($response)); // at least one object returned
|
$this->assertGreaterThan(0, count($response)); // at least one object returned
|
||||||
@ -179,7 +179,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
// initialize the API client
|
// initialize the API client
|
||||||
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\ApiClient($config);
|
$api_client = new Swagger\Client\ApiClient($config);
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// return Pet (model)
|
// return Pet (model)
|
||||||
$response = $pet_api->findPetsByTags("test php tag");
|
$response = $pet_api->findPetsByTags("test php tag");
|
||||||
$this->assertGreaterThan(0, count($response)); // at least one object returned
|
$this->assertGreaterThan(0, count($response)); // at least one object returned
|
||||||
@ -200,7 +200,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\ApiClient($config);
|
$api_client = new Swagger\Client\ApiClient($config);
|
||||||
$pet_id = 10001; // ID of pet that needs to be fetched
|
$pet_id = 10001; // ID of pet that needs to be fetched
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// create updated pet object
|
// create updated pet object
|
||||||
$updated_pet = new Swagger\Client\Model\Pet;
|
$updated_pet = new Swagger\Client\Model\Pet;
|
||||||
$updated_pet->setId($pet_id);
|
$updated_pet->setId($pet_id);
|
||||||
@ -224,7 +224,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\ApiClient($config);
|
$api_client = new Swagger\Client\ApiClient($config);
|
||||||
$pet_id = 10001; // ID of pet that needs to be fetched
|
$pet_id = 10001; // ID of pet that needs to be fetched
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// update Pet (form)
|
// update Pet (form)
|
||||||
list($update_response, $status_code, $http_headers) = $pet_api->updatePetWithFormWithHttpInfo($pet_id, 'update pet with form with http info');
|
list($update_response, $status_code, $http_headers) = $pet_api->updatePetWithFormWithHttpInfo($pet_id, 'update pet with form with http info');
|
||||||
// return nothing (void)
|
// return nothing (void)
|
||||||
@ -243,7 +243,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\ApiClient($config);
|
$api_client = new Swagger\Client\ApiClient($config);
|
||||||
$pet_id = 10001; // ID of pet that needs to be fetched
|
$pet_id = 10001; // ID of pet that needs to be fetched
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// update Pet (form)
|
// update Pet (form)
|
||||||
$update_response = $pet_api->updatePetWithForm($pet_id, 'update pet with form', 'sold');
|
$update_response = $pet_api->updatePetWithForm($pet_id, 'update pet with form', 'sold');
|
||||||
// return nothing (void)
|
// return nothing (void)
|
||||||
@ -264,7 +264,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$new_pet = new Swagger\Client\Model\Pet;
|
$new_pet = new Swagger\Client\Model\Pet;
|
||||||
$new_pet->setId($new_pet_id);
|
$new_pet->setId($new_pet_id);
|
||||||
$new_pet->setName("PHP Unit Test 2");
|
$new_pet->setName("PHP Unit Test 2");
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// add a new pet (model)
|
// add a new pet (model)
|
||||||
$add_response = $pet_api->addPet($new_pet);
|
$add_response = $pet_api->addPet($new_pet);
|
||||||
// return nothing (void)
|
// return nothing (void)
|
||||||
@ -298,7 +298,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$new_pet->setTags(array($tag));
|
$new_pet->setTags(array($tag));
|
||||||
$new_pet->setCategory($category);
|
$new_pet->setCategory($category);
|
||||||
|
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// add a new pet (model)
|
// add a new pet (model)
|
||||||
$object_serializer = new Swagger\Client\ObjectSerializer();
|
$object_serializer = new Swagger\Client\ObjectSerializer();
|
||||||
$pet_json_string = json_encode($object_serializer->sanitizeForSerialization($new_pet));
|
$pet_json_string = json_encode($object_serializer->sanitizeForSerialization($new_pet));
|
||||||
@ -319,7 +319,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
// initialize the API client
|
// initialize the API client
|
||||||
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
$config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\ApiClient($config);
|
$api_client = new Swagger\Client\ApiClient($config);
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// upload file
|
// upload file
|
||||||
$pet_id = 10001;
|
$pet_id = 10001;
|
||||||
$add_response = $pet_api->uploadFile($pet_id, "test meta", "./composer.json");
|
$add_response = $pet_api->uploadFile($pet_id, "test meta", "./composer.json");
|
||||||
@ -349,7 +349,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
$config = new Swagger\Client\Configuration();
|
$config = new Swagger\Client\Configuration();
|
||||||
$config->setHost('http://petstore.swagger.io/v2');
|
$config->setHost('http://petstore.swagger.io/v2');
|
||||||
$api_client = new Swagger\Client\APIClient($config);
|
$api_client = new Swagger\Client\APIClient($config);
|
||||||
$pet_api = new Swagger\Client\Api\PetAPI($api_client);
|
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||||
// test getPetByIdWithByteArray
|
// test getPetByIdWithByteArray
|
||||||
$pet_id = 10005;
|
$pet_id = 10005;
|
||||||
$bytes = $pet_api->petPetIdtestingByteArraytrueGet($pet_id);
|
$bytes = $pet_api->petPetIdtestingByteArraytrueGet($pet_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user