example
This commit is contained in:
23
example/clients/php/SwaggerClient-php/.php_cs
Normal file
23
example/clients/php/SwaggerClient-php/.php_cs
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setUsingCache(true)
|
||||
->setRules([
|
||||
'@PSR2' => true,
|
||||
'ordered_imports' => true,
|
||||
'phpdoc_order' => true,
|
||||
'array_syntax' => [ 'syntax' => 'short' ],
|
||||
'strict_comparison' => true,
|
||||
'strict_param' => true,
|
||||
'no_trailing_whitespace' => false,
|
||||
'no_trailing_whitespace_in_comment' => false,
|
||||
'braces' => false,
|
||||
'single_blank_line_at_eof' => false,
|
||||
'blank_line_after_namespace' => false,
|
||||
])
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->exclude('test')
|
||||
->exclude('tests')
|
||||
->in(__DIR__)
|
||||
);
|
10
example/clients/php/SwaggerClient-php/.travis.yml
Normal file
10
example/clients/php/SwaggerClient-php/.travis.yml
Normal file
@ -0,0 +1,10 @@
|
||||
language: php
|
||||
sudo: false
|
||||
php:
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
before_install: "composer install"
|
||||
script: "vendor/bin/phpunit"
|
112
example/clients/php/SwaggerClient-php/README.md
Normal file
112
example/clients/php/SwaggerClient-php/README.md
Normal file
@ -0,0 +1,112 @@
|
||||
# SwaggerClient-php
|
||||
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
|
||||
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version:
|
||||
- Build package: io.swagger.codegen.languages.PhpClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
||||
PHP 5.5 and later
|
||||
|
||||
## Installation & Usage
|
||||
### Composer
|
||||
|
||||
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
|
||||
|
||||
```
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then run `composer install`
|
||||
|
||||
### Manual Installation
|
||||
|
||||
Download the files and include `autoload.php`:
|
||||
|
||||
```php
|
||||
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
To run the unit tests:
|
||||
|
||||
```
|
||||
composer install
|
||||
./vendor/bin/phpunit
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\GreetApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $apiInstance->ping();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling GreetApi->ping: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*GreetApi* | [**ping**](docs/Api/GreetApi.md#ping) | **GET** /user/ping |
|
||||
*UserApiApi* | [**getUserInfo**](docs/Api/UserApiApi.md#getuserinfo) | **GET** /api/user/{id} | 获取用户信息
|
||||
*UserApiApi* | [**login**](docs/Api/UserApiApi.md#login) | **POST** /api/user/login | 登录
|
||||
*UserApiApi* | [**register**](docs/Api/UserApiApi.md#register) | **POST** /api/user/register | 注册
|
||||
*UserApiApi* | [**searchUser**](docs/Api/UserApiApi.md#searchuser) | **GET** /api/user/search | 用户搜索
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [LoginReq](docs/Model/LoginReq.md)
|
||||
- [RegisterReq](docs/Model/RegisterReq.md)
|
||||
- [UserInfoReply](docs/Model/UserInfoReply.md)
|
||||
- [UserInfoReq](docs/Model/UserInfoReq.md)
|
||||
- [UserSearchReply](docs/Model/UserSearchReply.md)
|
||||
- [UserSearchReq](docs/Model/UserSearchReq.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
## apiKey
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: Authorization
|
||||
- **Location**: HTTP header
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
||||
|
36
example/clients/php/SwaggerClient-php/composer.json
Normal file
36
example/clients/php/SwaggerClient-php/composer.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "GIT_USER_ID/GIT_REPO_ID",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"swagger",
|
||||
"php",
|
||||
"sdk",
|
||||
"api"
|
||||
],
|
||||
"homepage": "http://swagger.io",
|
||||
"license": "proprietary",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Swagger and contributors",
|
||||
"homepage": "https://github.com/swagger-api/swagger-codegen"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"guzzlehttp/guzzle": "^6.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8",
|
||||
"squizlabs/php_codesniffer": "~2.6",
|
||||
"friendsofphp/php-cs-fixer": "~2.12"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Swagger\\Client\\" : "lib/" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Swagger\\Client\\" : "test/" }
|
||||
}
|
||||
}
|
52
example/clients/php/SwaggerClient-php/docs/Api/GreetApi.md
Normal file
52
example/clients/php/SwaggerClient-php/docs/Api/GreetApi.md
Normal file
@ -0,0 +1,52 @@
|
||||
# Swagger\Client\GreetApi
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**ping**](GreetApi.md#ping) | **GET** /user/ping |
|
||||
|
||||
|
||||
# **ping**
|
||||
> object ping()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\GreetApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $apiInstance->ping();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling GreetApi->ping: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**object**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
204
example/clients/php/SwaggerClient-php/docs/Api/UserApiApi.md
Normal file
204
example/clients/php/SwaggerClient-php/docs/Api/UserApiApi.md
Normal file
@ -0,0 +1,204 @@
|
||||
# Swagger\Client\UserApiApi
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**getUserInfo**](UserApiApi.md#getUserInfo) | **GET** /api/user/{id} | 获取用户信息
|
||||
[**login**](UserApiApi.md#login) | **POST** /api/user/login | 登录
|
||||
[**register**](UserApiApi.md#register) | **POST** /api/user/register | 注册
|
||||
[**searchUser**](UserApiApi.md#searchUser) | **GET** /api/user/search | 用户搜索
|
||||
|
||||
|
||||
# **getUserInfo**
|
||||
> \Swagger\Client\Model\UserInfoReply getUserInfo($id, $body)
|
||||
|
||||
获取用户信息
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\UserApiApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$id = "id_example"; // string |
|
||||
$body = new \Swagger\Client\Model\UserInfoReq(); // \Swagger\Client\Model\UserInfoReq |
|
||||
|
||||
try {
|
||||
$result = $apiInstance->getUserInfo($id, $body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling UserApiApi->getUserInfo: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **string**| |
|
||||
**body** | [**\Swagger\Client\Model\UserInfoReq**](../Model/UserInfoReq.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**\Swagger\Client\Model\UserInfoReply**](../Model/UserInfoReply.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
# **login**
|
||||
> object login($body)
|
||||
|
||||
登录
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\UserApiApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$body = new \Swagger\Client\Model\LoginReq(); // \Swagger\Client\Model\LoginReq |
|
||||
|
||||
try {
|
||||
$result = $apiInstance->login($body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling UserApiApi->login: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\LoginReq**](../Model/LoginReq.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
**object**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
# **register**
|
||||
> object register($body)
|
||||
|
||||
注册
|
||||
|
||||
注册一个用户
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\UserApiApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$body = new \Swagger\Client\Model\RegisterReq(); // \Swagger\Client\Model\RegisterReq |
|
||||
|
||||
try {
|
||||
$result = $apiInstance->register($body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling UserApiApi->register: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\RegisterReq**](../Model/RegisterReq.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
**object**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
# **searchUser**
|
||||
> \Swagger\Client\Model\UserSearchReply searchUser($body)
|
||||
|
||||
用户搜索
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\UserApiApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$body = new \Swagger\Client\Model\UserSearchReq(); // \Swagger\Client\Model\UserSearchReq |
|
||||
|
||||
try {
|
||||
$result = $apiInstance->searchUser($body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling UserApiApi->searchUser: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\UserSearchReq**](../Model/UserSearchReq.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**\Swagger\Client\Model\UserSearchReply**](../Model/UserSearchReply.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
11
example/clients/php/SwaggerClient-php/docs/Model/LoginReq.md
Normal file
11
example/clients/php/SwaggerClient-php/docs/Model/LoginReq.md
Normal file
@ -0,0 +1,11 @@
|
||||
# LoginReq
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**username** | **string** | | [optional]
|
||||
**password** | **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)
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# RegisterReq
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**username** | **string** | | [optional]
|
||||
**password** | **string** | | [optional]
|
||||
**mobile** | **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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# UserInfoReply
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **string** | | [optional]
|
||||
**age** | **int** | | [optional]
|
||||
**birthday** | **string** | | [optional]
|
||||
**description** | **string** | | [optional]
|
||||
**tag** | **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)
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# UserInfoReq
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **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)
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# UserSearchReply
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**key_word** | [**\Swagger\Client\Model\UserInfoReply[]**](UserInfoReply.md) | | [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)
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# UserSearchReq
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**key_word** | **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)
|
||||
|
||||
|
52
example/clients/php/SwaggerClient-php/git_push.sh
Normal file
52
example/clients/php/SwaggerClient-php/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="GIT_USER_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
354
example/clients/php/SwaggerClient-php/lib/Api/GreetApi.php
Normal file
354
example/clients/php/SwaggerClient-php/lib/Api/GreetApi.php
Normal file
@ -0,0 +1,354 @@
|
||||
<?php
|
||||
/**
|
||||
* GreetApi
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Api;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use Swagger\Client\ApiException;
|
||||
use Swagger\Client\Configuration;
|
||||
use Swagger\Client\HeaderSelector;
|
||||
use Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* GreetApi Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class GreetApi
|
||||
{
|
||||
/**
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @var Configuration
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var HeaderSelector
|
||||
*/
|
||||
protected $headerSelector;
|
||||
|
||||
/**
|
||||
* @param ClientInterface $client
|
||||
* @param Configuration $config
|
||||
* @param HeaderSelector $selector
|
||||
*/
|
||||
public function __construct(
|
||||
ClientInterface $client = null,
|
||||
Configuration $config = null,
|
||||
HeaderSelector $selector = null
|
||||
) {
|
||||
$this->client = $client ?: new Client();
|
||||
$this->config = $config ?: new Configuration();
|
||||
$this->headerSelector = $selector ?: new HeaderSelector();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Configuration
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation ping
|
||||
*
|
||||
*
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
* @throws \InvalidArgumentException
|
||||
* @return object
|
||||
*/
|
||||
public function ping()
|
||||
{
|
||||
list($response) = $this->pingWithHttpInfo();
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation pingWithHttpInfo
|
||||
*
|
||||
*
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
* @throws \InvalidArgumentException
|
||||
* @return array of object, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function pingWithHttpInfo()
|
||||
{
|
||||
$returnType = 'object';
|
||||
$request = $this->pingRequest();
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
try {
|
||||
$response = $this->client->send($request, $options);
|
||||
} catch (RequestException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
$e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
|
||||
);
|
||||
}
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$response->getBody()
|
||||
);
|
||||
}
|
||||
|
||||
$responseBody = $response->getBody();
|
||||
if ($returnType === '\SplFileObject') {
|
||||
$content = $responseBody; //stream goes to serializer
|
||||
} else {
|
||||
$content = $responseBody->getContents();
|
||||
if ($returnType !== 'string') {
|
||||
$content = json_decode($content);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = ObjectSerializer::deserialize(
|
||||
$e->getResponseBody(),
|
||||
'object',
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation pingAsync
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function pingAsync()
|
||||
{
|
||||
return $this->pingAsyncWithHttpInfo()
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation pingAsyncWithHttpInfo
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function pingAsyncWithHttpInfo()
|
||||
{
|
||||
$returnType = 'object';
|
||||
$request = $this->pingRequest();
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
$responseBody = $response->getBody();
|
||||
if ($returnType === '\SplFileObject') {
|
||||
$content = $responseBody; //stream goes to serializer
|
||||
} else {
|
||||
$content = $responseBody->getContents();
|
||||
if ($returnType !== 'string') {
|
||||
$content = json_decode($content);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
},
|
||||
function ($exception) {
|
||||
$response = $exception->getResponse();
|
||||
$statusCode = $response->getStatusCode();
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$exception->getRequest()->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$response->getBody()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create request for operation 'ping'
|
||||
*
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
protected function pingRequest()
|
||||
{
|
||||
|
||||
$resourcePath = '/user/ping';
|
||||
$formParams = [];
|
||||
$queryParams = [];
|
||||
$headerParams = [];
|
||||
$httpBody = '';
|
||||
$multipart = false;
|
||||
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
|
||||
if ($multipart) {
|
||||
$headers = $this->headerSelector->selectHeadersForMultipart(
|
||||
['application/json']
|
||||
);
|
||||
} else {
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
['application/json'],
|
||||
['application/json']
|
||||
);
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
// $_tempBody is the method argument, if present
|
||||
$httpBody = $_tempBody;
|
||||
|
||||
if($headers['Content-Type'] === 'application/json') {
|
||||
// \stdClass has no __toString(), so we should encode it manually
|
||||
if ($httpBody instanceof \stdClass) {
|
||||
$httpBody = \GuzzleHttp\json_encode($httpBody);
|
||||
}
|
||||
// array has no __toString(), so we should encode it manually
|
||||
if(is_array($httpBody)) {
|
||||
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
|
||||
}
|
||||
}
|
||||
} elseif (count($formParams) > 0) {
|
||||
if ($multipart) {
|
||||
$multipartContents = [];
|
||||
foreach ($formParams as $formParamName => $formParamValue) {
|
||||
$multipartContents[] = [
|
||||
'name' => $formParamName,
|
||||
'contents' => $formParamValue
|
||||
];
|
||||
}
|
||||
// for HTTP post (form)
|
||||
$httpBody = new MultipartStream($multipartContents);
|
||||
|
||||
} elseif ($headers['Content-Type'] === 'application/json') {
|
||||
$httpBody = \GuzzleHttp\json_encode($formParams);
|
||||
|
||||
} else {
|
||||
// for HTTP post (form)
|
||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$defaultHeaders = [];
|
||||
if ($this->config->getUserAgent()) {
|
||||
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
||||
}
|
||||
|
||||
$headers = array_merge(
|
||||
$defaultHeaders,
|
||||
$headerParams,
|
||||
$headers
|
||||
);
|
||||
|
||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
||||
return new Request(
|
||||
'GET',
|
||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||
$headers,
|
||||
$httpBody
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create http client option
|
||||
*
|
||||
* @throws \RuntimeException on file opening failure
|
||||
* @return array of http client options
|
||||
*/
|
||||
protected function createHttpClientOption()
|
||||
{
|
||||
$options = [];
|
||||
if ($this->config->getDebug()) {
|
||||
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
|
||||
if (!$options[RequestOptions::DEBUG]) {
|
||||
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
1183
example/clients/php/SwaggerClient-php/lib/Api/UserApiApi.php
Normal file
1183
example/clients/php/SwaggerClient-php/lib/Api/UserApiApi.php
Normal file
File diff suppressed because it is too large
Load Diff
121
example/clients/php/SwaggerClient-php/lib/ApiException.php
Normal file
121
example/clients/php/SwaggerClient-php/lib/ApiException.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiException
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class ApiException extends Exception
|
||||
{
|
||||
|
||||
/**
|
||||
* The HTTP body of the server response either as Json or string.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $responseBody;
|
||||
|
||||
/**
|
||||
* The HTTP header of the server response.
|
||||
*
|
||||
* @var string[]|null
|
||||
*/
|
||||
protected $responseHeaders;
|
||||
|
||||
/**
|
||||
* The deserialized response object
|
||||
*
|
||||
* @var $responseObject;
|
||||
*/
|
||||
protected $responseObject;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $message Error message
|
||||
* @param int $code HTTP status code
|
||||
* @param string[]|null $responseHeaders HTTP response header
|
||||
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
|
||||
*/
|
||||
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
$this->responseHeaders = $responseHeaders;
|
||||
$this->responseBody = $responseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP response header
|
||||
*
|
||||
* @return string[]|null HTTP response header
|
||||
*/
|
||||
public function getResponseHeaders()
|
||||
{
|
||||
return $this->responseHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP body of the server response either as Json or string
|
||||
*
|
||||
* @return mixed HTTP body of the server response either as \stdClass or string
|
||||
*/
|
||||
public function getResponseBody()
|
||||
{
|
||||
return $this->responseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deseralized response object (during deserialization)
|
||||
*
|
||||
* @param mixed $obj Deserialized response object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setResponseObject($obj)
|
||||
{
|
||||
$this->responseObject = $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deseralized response object (during deserialization)
|
||||
*
|
||||
* @return mixed the deserialized response object
|
||||
*/
|
||||
public function getResponseObject()
|
||||
{
|
||||
return $this->responseObject;
|
||||
}
|
||||
}
|
429
example/clients/php/SwaggerClient-php/lib/Configuration.php
Normal file
429
example/clients/php/SwaggerClient-php/lib/Configuration.php
Normal file
@ -0,0 +1,429 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* Configuration Class Doc Comment
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
private static $defaultConfiguration;
|
||||
|
||||
/**
|
||||
* Associate array to store API key(s)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $apiKeys = [];
|
||||
|
||||
/**
|
||||
* Associate array to store API prefix (e.g. Bearer)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $apiKeyPrefixes = [];
|
||||
|
||||
/**
|
||||
* Access token for OAuth
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $accessToken = '';
|
||||
|
||||
/**
|
||||
* Username for HTTP basic authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $username = '';
|
||||
|
||||
/**
|
||||
* Password for HTTP basic authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $password = '';
|
||||
|
||||
/**
|
||||
* The host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $host = 'http://localhost';
|
||||
|
||||
/**
|
||||
* User agent of the HTTP request, set to "PHP-Swagger" by default
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userAgent = 'Swagger-Codegen/1.0.0/php';
|
||||
|
||||
/**
|
||||
* Debug switch (default set to false)
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $debug = false;
|
||||
|
||||
/**
|
||||
* Debug file location (log to STDOUT by default)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $debugFile = 'php://output';
|
||||
|
||||
/**
|
||||
* Debug file location (log to STDOUT by default)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tempFolderPath;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->tempFolderPath = sys_get_temp_dir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets API key
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
* @param string $key API key or token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setApiKey($apiKeyIdentifier, $key)
|
||||
{
|
||||
$this->apiKeys[$apiKeyIdentifier] = $key;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets API key
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
*
|
||||
* @return string API key or token
|
||||
*/
|
||||
public function getApiKey($apiKeyIdentifier)
|
||||
{
|
||||
return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the prefix for API key (e.g. Bearer)
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
* @param string $prefix API key prefix, e.g. Bearer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
|
||||
{
|
||||
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets API key prefix
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getApiKeyPrefix($apiKeyIdentifier)
|
||||
{
|
||||
return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the access token for OAuth
|
||||
*
|
||||
* @param string $accessToken Token for OAuth
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccessToken($accessToken)
|
||||
{
|
||||
$this->accessToken = $accessToken;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the access token for OAuth
|
||||
*
|
||||
* @return string Access token for OAuth
|
||||
*/
|
||||
public function getAccessToken()
|
||||
{
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the username for HTTP basic authentication
|
||||
*
|
||||
* @param string $username Username for HTTP basic authentication
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
$this->username = $username;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the username for HTTP basic authentication
|
||||
*
|
||||
* @return string Username for HTTP basic authentication
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for HTTP basic authentication
|
||||
*
|
||||
* @param string $password Password for HTTP basic authentication
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->password = $password;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the password for HTTP basic authentication
|
||||
*
|
||||
* @return string Password for HTTP basic authentication
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the host
|
||||
*
|
||||
* @param string $host Host
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost($host)
|
||||
{
|
||||
$this->host = $host;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the host
|
||||
*
|
||||
* @return string Host
|
||||
*/
|
||||
public function getHost()
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user agent of the api client
|
||||
*
|
||||
* @param string $userAgent the user agent of the api client
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserAgent($userAgent)
|
||||
{
|
||||
if (!is_string($userAgent)) {
|
||||
throw new \InvalidArgumentException('User-agent must be a string.');
|
||||
}
|
||||
|
||||
$this->userAgent = $userAgent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user agent of the api client
|
||||
*
|
||||
* @return string user agent
|
||||
*/
|
||||
public function getUserAgent()
|
||||
{
|
||||
return $this->userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets debug flag
|
||||
*
|
||||
* @param bool $debug Debug flag
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebug($debug)
|
||||
{
|
||||
$this->debug = $debug;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the debug flag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDebug()
|
||||
{
|
||||
return $this->debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the debug file
|
||||
*
|
||||
* @param string $debugFile Debug file
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugFile($debugFile)
|
||||
{
|
||||
$this->debugFile = $debugFile;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the debug file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDebugFile()
|
||||
{
|
||||
return $this->debugFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the temp folder path
|
||||
*
|
||||
* @param string $tempFolderPath Temp folder path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTempFolderPath($tempFolderPath)
|
||||
{
|
||||
$this->tempFolderPath = $tempFolderPath;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the temp folder path
|
||||
*
|
||||
* @return string Temp folder path
|
||||
*/
|
||||
public function getTempFolderPath()
|
||||
{
|
||||
return $this->tempFolderPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default configuration instance
|
||||
*
|
||||
* @return Configuration
|
||||
*/
|
||||
public static function getDefaultConfiguration()
|
||||
{
|
||||
if (self::$defaultConfiguration === null) {
|
||||
self::$defaultConfiguration = new Configuration();
|
||||
}
|
||||
|
||||
return self::$defaultConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the detault configuration instance
|
||||
*
|
||||
* @param Configuration $config An instance of the Configuration Object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setDefaultConfiguration(Configuration $config)
|
||||
{
|
||||
self::$defaultConfiguration = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the essential information for debugging
|
||||
*
|
||||
* @return string The report for debugging
|
||||
*/
|
||||
public static function toDebugReport()
|
||||
{
|
||||
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
|
||||
$report .= ' OS: ' . php_uname() . PHP_EOL;
|
||||
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
|
||||
$report .= ' OpenAPI Spec Version: ' . PHP_EOL;
|
||||
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
|
||||
|
||||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get API key (with prefix if set)
|
||||
*
|
||||
* @param string $apiKeyIdentifier name of apikey
|
||||
*
|
||||
* @return string API key with the prefix
|
||||
*/
|
||||
public function getApiKeyWithPrefix($apiKeyIdentifier)
|
||||
{
|
||||
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
|
||||
$apiKey = $this->getApiKey($apiKeyIdentifier);
|
||||
|
||||
if ($apiKey === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($prefix === null) {
|
||||
$keyWithPrefix = $apiKey;
|
||||
} else {
|
||||
$keyWithPrefix = $prefix . ' ' . $apiKey;
|
||||
}
|
||||
|
||||
return $keyWithPrefix;
|
||||
}
|
||||
}
|
109
example/clients/php/SwaggerClient-php/lib/HeaderSelector.php
Normal file
109
example/clients/php/SwaggerClient-php/lib/HeaderSelector.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiException
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class HeaderSelector
|
||||
{
|
||||
|
||||
/**
|
||||
* @param string[] $accept
|
||||
* @param string[] $contentTypes
|
||||
* @return array
|
||||
*/
|
||||
public function selectHeaders($accept, $contentTypes)
|
||||
{
|
||||
$headers = [];
|
||||
|
||||
$accept = $this->selectAcceptHeader($accept);
|
||||
if ($accept !== null) {
|
||||
$headers['Accept'] = $accept;
|
||||
}
|
||||
|
||||
$headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes);
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $accept
|
||||
* @return array
|
||||
*/
|
||||
public function selectHeadersForMultipart($accept)
|
||||
{
|
||||
$headers = $this->selectHeaders($accept, []);
|
||||
|
||||
unset($headers['Content-Type']);
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the header 'Accept' based on an array of Accept provided
|
||||
*
|
||||
* @param string[] $accept Array of header
|
||||
*
|
||||
* @return string Accept (e.g. application/json)
|
||||
*/
|
||||
private function selectAcceptHeader($accept)
|
||||
{
|
||||
if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
|
||||
return null;
|
||||
} elseif (preg_grep("/application\/json/i", $accept)) {
|
||||
return 'application/json';
|
||||
} else {
|
||||
return implode(',', $accept);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the content type based on an array of content-type provided
|
||||
*
|
||||
* @param string[] $contentType Array fo content-type
|
||||
*
|
||||
* @return string Content-Type (e.g. application/json)
|
||||
*/
|
||||
private function selectContentTypeHeader($contentType)
|
||||
{
|
||||
if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
|
||||
return 'application/json';
|
||||
} elseif (preg_grep("/application\/json/i", $contentType)) {
|
||||
return 'application/json';
|
||||
} else {
|
||||
return implode(',', $contentType);
|
||||
}
|
||||
}
|
||||
}
|
331
example/clients/php/SwaggerClient-php/lib/Model/LoginReq.php
Normal file
331
example/clients/php/SwaggerClient-php/lib/Model/LoginReq.php
Normal file
@ -0,0 +1,331 @@
|
||||
<?php
|
||||
/**
|
||||
* LoginReq
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* LoginReq Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class LoginReq implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'LoginReq';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
'username' => 'string',
|
||||
'password' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
'username' => null,
|
||||
'password' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'username' => 'username',
|
||||
'password' => 'password'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'username' => 'setUsername',
|
||||
'password' => 'setPassword'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'username' => 'getUsername',
|
||||
'password' => 'getPassword'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['username'] = isset($data['username']) ? $data['username'] : null;
|
||||
$this->container['password'] = isset($data['password']) ? $data['password'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets username
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->container['username'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets username
|
||||
*
|
||||
* @param string $username username
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
$this->container['username'] = $username;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->container['password'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets password
|
||||
*
|
||||
* @param string $password password
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->container['password'] = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* ModelInterface
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client\Model
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
/**
|
||||
* Interface abstracting model access.
|
||||
*
|
||||
* @package Swagger\Client\Model
|
||||
* @author Swagger Codegen team
|
||||
*/
|
||||
interface ModelInterface
|
||||
{
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName();
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes();
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats();
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name, and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap();
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters();
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters();
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listInvalidProperties();
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function valid();
|
||||
}
|
361
example/clients/php/SwaggerClient-php/lib/Model/RegisterReq.php
Normal file
361
example/clients/php/SwaggerClient-php/lib/Model/RegisterReq.php
Normal file
@ -0,0 +1,361 @@
|
||||
<?php
|
||||
/**
|
||||
* RegisterReq
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* RegisterReq Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class RegisterReq implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'RegisterReq';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
'username' => 'string',
|
||||
'password' => 'string',
|
||||
'mobile' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
'username' => null,
|
||||
'password' => null,
|
||||
'mobile' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'username' => 'username',
|
||||
'password' => 'password',
|
||||
'mobile' => 'mobile'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'username' => 'setUsername',
|
||||
'password' => 'setPassword',
|
||||
'mobile' => 'setMobile'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'username' => 'getUsername',
|
||||
'password' => 'getPassword',
|
||||
'mobile' => 'getMobile'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['username'] = isset($data['username']) ? $data['username'] : null;
|
||||
$this->container['password'] = isset($data['password']) ? $data['password'] : null;
|
||||
$this->container['mobile'] = isset($data['mobile']) ? $data['mobile'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets username
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->container['username'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets username
|
||||
*
|
||||
* @param string $username username
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
$this->container['username'] = $username;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->container['password'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets password
|
||||
*
|
||||
* @param string $password password
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->container['password'] = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets mobile
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMobile()
|
||||
{
|
||||
return $this->container['mobile'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets mobile
|
||||
*
|
||||
* @param string $mobile mobile
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMobile($mobile)
|
||||
{
|
||||
$this->container['mobile'] = $mobile;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,421 @@
|
||||
<?php
|
||||
/**
|
||||
* UserInfoReply
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* UserInfoReply Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserInfoReply implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'UserInfoReply';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
'name' => 'string',
|
||||
'age' => 'int',
|
||||
'birthday' => 'string',
|
||||
'description' => 'string',
|
||||
'tag' => 'string[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
'name' => null,
|
||||
'age' => 'int32',
|
||||
'birthday' => null,
|
||||
'description' => null,
|
||||
'tag' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'name' => 'name',
|
||||
'age' => 'age',
|
||||
'birthday' => 'birthday',
|
||||
'description' => 'description',
|
||||
'tag' => 'tag'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'name' => 'setName',
|
||||
'age' => 'setAge',
|
||||
'birthday' => 'setBirthday',
|
||||
'description' => 'setDescription',
|
||||
'tag' => 'setTag'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'name' => 'getName',
|
||||
'age' => 'getAge',
|
||||
'birthday' => 'getBirthday',
|
||||
'description' => 'getDescription',
|
||||
'tag' => 'getTag'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
$this->container['age'] = isset($data['age']) ? $data['age'] : null;
|
||||
$this->container['birthday'] = isset($data['birthday']) ? $data['birthday'] : null;
|
||||
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
|
||||
$this->container['tag'] = isset($data['tag']) ? $data['tag'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets age
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAge()
|
||||
{
|
||||
return $this->container['age'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets age
|
||||
*
|
||||
* @param int $age age
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAge($age)
|
||||
{
|
||||
$this->container['age'] = $age;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets birthday
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBirthday()
|
||||
{
|
||||
return $this->container['birthday'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets birthday
|
||||
*
|
||||
* @param string $birthday birthday
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBirthday($birthday)
|
||||
{
|
||||
$this->container['birthday'] = $birthday;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->container['description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets description
|
||||
*
|
||||
* @param string $description description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->container['description'] = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets tag
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
return $this->container['tag'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets tag
|
||||
*
|
||||
* @param string[] $tag tag
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTag($tag)
|
||||
{
|
||||
$this->container['tag'] = $tag;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
301
example/clients/php/SwaggerClient-php/lib/Model/UserInfoReq.php
Normal file
301
example/clients/php/SwaggerClient-php/lib/Model/UserInfoReq.php
Normal file
@ -0,0 +1,301 @@
|
||||
<?php
|
||||
/**
|
||||
* UserInfoReq
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* UserInfoReq Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserInfoReq implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'UserInfoReq';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
'id' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
'id' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'id' => 'id'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'id' => 'setId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'id' => 'getId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param string $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,301 @@
|
||||
<?php
|
||||
/**
|
||||
* UserSearchReply
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* UserSearchReply Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserSearchReply implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'UserSearchReply';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
'key_word' => '\Swagger\Client\Model\UserInfoReply[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
'key_word' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'key_word' => 'KeyWord'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'key_word' => 'setKeyWord'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'key_word' => 'getKeyWord'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['key_word'] = isset($data['key_word']) ? $data['key_word'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets key_word
|
||||
*
|
||||
* @return \Swagger\Client\Model\UserInfoReply[]
|
||||
*/
|
||||
public function getKeyWord()
|
||||
{
|
||||
return $this->container['key_word'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets key_word
|
||||
*
|
||||
* @param \Swagger\Client\Model\UserInfoReply[] $key_word key_word
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setKeyWord($key_word)
|
||||
{
|
||||
$this->container['key_word'] = $key_word;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,301 @@
|
||||
<?php
|
||||
/**
|
||||
* UserSearchReq
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* UserSearchReq Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserSearchReq implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'UserSearchReq';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
'key_word' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
'key_word' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'key_word' => 'keyWord'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'key_word' => 'setKeyWord'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'key_word' => 'getKeyWord'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['key_word'] = isset($data['key_word']) ? $data['key_word'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets key_word
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getKeyWord()
|
||||
{
|
||||
return $this->container['key_word'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets key_word
|
||||
*
|
||||
* @param string $key_word key_word
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setKeyWord($key_word)
|
||||
{
|
||||
$this->container['key_word'] = $key_word;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
322
example/clients/php/SwaggerClient-php/lib/ObjectSerializer.php
Normal file
322
example/clients/php/SwaggerClient-php/lib/ObjectSerializer.php
Normal file
@ -0,0 +1,322 @@
|
||||
<?php
|
||||
/**
|
||||
* ObjectSerializer
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* ObjectSerializer Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class ObjectSerializer
|
||||
{
|
||||
/**
|
||||
* Serialize data
|
||||
*
|
||||
* @param mixed $data the data to serialize
|
||||
* @param string $type the SwaggerType of the data
|
||||
* @param string $format the format of the Swagger type of the data
|
||||
*
|
||||
* @return string|object serialized form of $data
|
||||
*/
|
||||
public static function sanitizeForSerialization($data, $type = null, $format = null)
|
||||
{
|
||||
if (is_scalar($data) || null === $data) {
|
||||
return $data;
|
||||
} elseif ($data instanceof \DateTime) {
|
||||
return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM);
|
||||
} elseif (is_array($data)) {
|
||||
foreach ($data as $property => $value) {
|
||||
$data[$property] = self::sanitizeForSerialization($value);
|
||||
}
|
||||
return $data;
|
||||
} elseif ($data instanceof \stdClass) {
|
||||
foreach ($data as $property => $value) {
|
||||
$data->$property = self::sanitizeForSerialization($value);
|
||||
}
|
||||
return $data;
|
||||
} elseif (is_object($data)) {
|
||||
$values = [];
|
||||
$formats = $data::swaggerFormats();
|
||||
foreach ($data::swaggerTypes() as $property => $swaggerType) {
|
||||
$getter = $data::getters()[$property];
|
||||
$value = $data->$getter();
|
||||
if ($value !== null
|
||||
&& !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
|
||||
&& method_exists($swaggerType, 'getAllowableEnumValues')
|
||||
&& !in_array($value, $swaggerType::getAllowableEnumValues(), true)) {
|
||||
$imploded = implode("', '", $swaggerType::getAllowableEnumValues());
|
||||
throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'");
|
||||
}
|
||||
if ($value !== null) {
|
||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]);
|
||||
}
|
||||
}
|
||||
return (object)$values;
|
||||
} else {
|
||||
return (string)$data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize filename by removing path.
|
||||
* e.g. ../../sun.gif becomes sun.gif
|
||||
*
|
||||
* @param string $filename filename to be sanitized
|
||||
*
|
||||
* @return string the sanitized filename
|
||||
*/
|
||||
public static function sanitizeFilename($filename)
|
||||
{
|
||||
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
|
||||
return $match[1];
|
||||
} else {
|
||||
return $filename;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the path, by url-encoding.
|
||||
*
|
||||
* @param string $value a string which will be part of the path
|
||||
*
|
||||
* @return string the serialized object
|
||||
*/
|
||||
public static function toPathValue($value)
|
||||
{
|
||||
return rawurlencode(self::toString($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the query, by imploding comma-separated if it's an object.
|
||||
* If it's a string, pass through unchanged. It will be url-encoded
|
||||
* later.
|
||||
*
|
||||
* @param string[]|string|\DateTime $object an object to be serialized to a string
|
||||
*
|
||||
* @return string the serialized object
|
||||
*/
|
||||
public static function toQueryValue($object)
|
||||
{
|
||||
if (is_array($object)) {
|
||||
return implode(',', $object);
|
||||
} else {
|
||||
return self::toString($object);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the header. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
*
|
||||
* @param string $value a string which will be part of the header
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
public static function toHeaderValue($value)
|
||||
{
|
||||
return self::toString($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the http body (form parameter). If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
*
|
||||
* @param string|\SplFileObject $value the value of the form parameter
|
||||
*
|
||||
* @return string the form string
|
||||
*/
|
||||
public static function toFormValue($value)
|
||||
{
|
||||
if ($value instanceof \SplFileObject) {
|
||||
return $value->getRealPath();
|
||||
} else {
|
||||
return self::toString($value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the parameter. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
*
|
||||
* @param string|\DateTime $value the value of the parameter
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
public static function toString($value)
|
||||
{
|
||||
if ($value instanceof \DateTime) { // datetime in ISO8601 format
|
||||
return $value->format(\DateTime::ATOM);
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize an array to a string.
|
||||
*
|
||||
* @param array $collection collection to serialize to a string
|
||||
* @param string $collectionFormat the format use for serialization (csv,
|
||||
* ssv, tsv, pipes, multi)
|
||||
* @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false)
|
||||
{
|
||||
if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) {
|
||||
// http_build_query() almost does the job for us. We just
|
||||
// need to fix the result of multidimensional arrays.
|
||||
return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&'));
|
||||
}
|
||||
switch ($collectionFormat) {
|
||||
case 'pipes':
|
||||
return implode('|', $collection);
|
||||
|
||||
case 'tsv':
|
||||
return implode("\t", $collection);
|
||||
|
||||
case 'ssv':
|
||||
return implode(' ', $collection);
|
||||
|
||||
case 'csv':
|
||||
// Deliberate fall through. CSV is default format.
|
||||
default:
|
||||
return implode(',', $collection);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserialize a JSON string into an object
|
||||
*
|
||||
* @param mixed $data object or primitive to be deserialized
|
||||
* @param string $class class name is passed as a string
|
||||
* @param string[] $httpHeaders HTTP headers
|
||||
* @param string $discriminator discriminator if polymorphism is used
|
||||
*
|
||||
* @return object|array|null an single or an array of $class instances
|
||||
*/
|
||||
public static function deserialize($data, $class, $httpHeaders = null)
|
||||
{
|
||||
if (null === $data) {
|
||||
return null;
|
||||
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
|
||||
$inner = substr($class, 4, -1);
|
||||
$deserialized = [];
|
||||
if (strrpos($inner, ",") !== false) {
|
||||
$subClass_array = explode(',', $inner, 2);
|
||||
$subClass = $subClass_array[1];
|
||||
foreach ($data as $key => $value) {
|
||||
$deserialized[$key] = self::deserialize($value, $subClass, null);
|
||||
}
|
||||
}
|
||||
return $deserialized;
|
||||
} elseif (strcasecmp(substr($class, -2), '[]') === 0) {
|
||||
$subClass = substr($class, 0, -2);
|
||||
$values = [];
|
||||
foreach ($data as $key => $value) {
|
||||
$values[] = self::deserialize($value, $subClass, null);
|
||||
}
|
||||
return $values;
|
||||
} elseif ($class === 'object') {
|
||||
settype($data, 'array');
|
||||
return $data;
|
||||
} elseif ($class === '\DateTime') {
|
||||
// Some API's return an invalid, empty string as a
|
||||
// date-time property. DateTime::__construct() will return
|
||||
// the current time for empty input which is probably not
|
||||
// what is meant. The invalid empty string is probably to
|
||||
// be interpreted as a missing field/value. Let's handle
|
||||
// this graceful.
|
||||
if (!empty($data)) {
|
||||
return new \DateTime($data);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
|
||||
settype($data, $class);
|
||||
return $data;
|
||||
} elseif ($class === '\SplFileObject') {
|
||||
/** @var \Psr\Http\Message\StreamInterface $data */
|
||||
|
||||
// determine file name
|
||||
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
||||
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
|
||||
} else {
|
||||
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
||||
}
|
||||
|
||||
$file = fopen($filename, 'w');
|
||||
while ($chunk = $data->read(200)) {
|
||||
fwrite($file, $chunk);
|
||||
}
|
||||
fclose($file);
|
||||
|
||||
return new \SplFileObject($filename, 'r');
|
||||
} elseif (method_exists($class, 'getAllowableEnumValues')) {
|
||||
if (!in_array($data, $class::getAllowableEnumValues(), true)) {
|
||||
$imploded = implode("', '", $class::getAllowableEnumValues());
|
||||
throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'");
|
||||
}
|
||||
return $data;
|
||||
} else {
|
||||
// If a discriminator is defined and points to a valid subclass, use it.
|
||||
$discriminator = $class::DISCRIMINATOR;
|
||||
if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) {
|
||||
$subclass = '\Swagger\Client\Model\\' . $data->{$discriminator};
|
||||
if (is_subclass_of($subclass, $class)) {
|
||||
$class = $subclass;
|
||||
}
|
||||
}
|
||||
$instance = new $class();
|
||||
foreach ($instance::swaggerTypes() as $property => $type) {
|
||||
$propertySetter = $instance::setters()[$property];
|
||||
|
||||
if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$propertyValue = $data->{$instance::attributeMap()[$property]};
|
||||
if (isset($propertyValue)) {
|
||||
$instance->$propertySetter(self::deserialize($propertyValue, $type, null));
|
||||
}
|
||||
}
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
}
|
21
example/clients/php/SwaggerClient-php/phpunit.xml.dist
Normal file
21
example/clients/php/SwaggerClient-php/phpunit.xml.dist
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="./vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
stopOnFailure="false">
|
||||
<testsuites>
|
||||
<testsuite>
|
||||
<directory>./test/Api</directory>
|
||||
<directory>./test/Model</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./lib/Api</directory>
|
||||
<directory suffix=".php">./lib/Model</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* GreetApiTest
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
use \Swagger\Client\Configuration;
|
||||
use \Swagger\Client\ApiException;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* GreetApiTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class GreetApiTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for ping
|
||||
*
|
||||
* .
|
||||
*
|
||||
*/
|
||||
public function testPing()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* UserApiApiTest
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
use \Swagger\Client\Configuration;
|
||||
use \Swagger\Client\ApiException;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* UserApiApiTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserApiApiTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for getUserInfo
|
||||
*
|
||||
* 获取用户信息.
|
||||
*
|
||||
*/
|
||||
public function testGetUserInfo()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for login
|
||||
*
|
||||
* 登录.
|
||||
*
|
||||
*/
|
||||
public function testLogin()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for register
|
||||
*
|
||||
* 注册.
|
||||
*
|
||||
*/
|
||||
public function testRegister()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for searchUser
|
||||
*
|
||||
* 用户搜索.
|
||||
*
|
||||
*/
|
||||
public function testSearchUser()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* LoginReqTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* LoginReqTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description LoginReq
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class LoginReqTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "LoginReq"
|
||||
*/
|
||||
public function testLoginReq()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "username"
|
||||
*/
|
||||
public function testPropertyUsername()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "password"
|
||||
*/
|
||||
public function testPropertyPassword()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* RegisterReqTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* RegisterReqTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description RegisterReq
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class RegisterReqTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "RegisterReq"
|
||||
*/
|
||||
public function testRegisterReq()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "username"
|
||||
*/
|
||||
public function testPropertyUsername()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "password"
|
||||
*/
|
||||
public function testPropertyPassword()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "mobile"
|
||||
*/
|
||||
public function testPropertyMobile()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* UserInfoReplyTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* UserInfoReplyTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description UserInfoReply
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserInfoReplyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "UserInfoReply"
|
||||
*/
|
||||
public function testUserInfoReply()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "name"
|
||||
*/
|
||||
public function testPropertyName()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "age"
|
||||
*/
|
||||
public function testPropertyAge()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "birthday"
|
||||
*/
|
||||
public function testPropertyBirthday()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "description"
|
||||
*/
|
||||
public function testPropertyDescription()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "tag"
|
||||
*/
|
||||
public function testPropertyTag()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* UserInfoReqTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* UserInfoReqTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description UserInfoReq
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserInfoReqTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "UserInfoReq"
|
||||
*/
|
||||
public function testUserInfoReq()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "id"
|
||||
*/
|
||||
public function testPropertyId()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* UserSearchReplyTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* UserSearchReplyTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description UserSearchReply
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserSearchReplyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "UserSearchReply"
|
||||
*/
|
||||
public function testUserSearchReply()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "key_word"
|
||||
*/
|
||||
public function testPropertyKeyWord()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* UserSearchReqTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||
*
|
||||
* OpenAPI spec version:
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.18
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* UserSearchReqTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description UserSearchReq
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class UserSearchReqTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "UserSearchReq"
|
||||
*/
|
||||
public function testUserSearchReq()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "key_word"
|
||||
*/
|
||||
public function testPropertyKeyWord()
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user