add php documentation

This commit is contained in:
wing328
2016-03-16 16:14:04 +08:00
parent 7b31dabe77
commit c101c1204e
23 changed files with 571 additions and 417 deletions

View File

@@ -32,6 +32,7 @@ public class CodegenOperation {
public ExternalDocs externalDocs; public ExternalDocs externalDocs;
public Map<String, Object> vendorExtensions; public Map<String, Object> vendorExtensions;
public String nickname; // legacy support public String nickname; // legacy support
public String operationIdLowerCase; // for mardown documentation
/** /**
* Check if there's at least one parameter * Check if there's at least one parameter

View File

@@ -1575,7 +1575,6 @@ public class DefaultCodegen {
// legacy support // legacy support
op.nickname = op.operationId; op.nickname = op.operationId;
if (op.allParams.size() > 0) { if (op.allParams.size() > 0) {
op.hasParams = true; op.hasParams = true;
} }
@@ -2075,6 +2074,7 @@ public class DefaultCodegen {
LOGGER.warn("generated unique operationId `" + uniqueName + "`"); LOGGER.warn("generated unique operationId `" + uniqueName + "`");
} }
co.operationId = uniqueName; co.operationId = uniqueName;
co.operationIdLowerCase = uniqueName.toLowerCase();
opList.add(co); opList.add(co);
co.baseName = tag; co.baseName = tag;
} }

View File

@@ -507,12 +507,12 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
type = p.dataType; type = p.dataType;
} }
if ("String".equals(type)) { if ("String".equalsIgnoreCase(type)) {
if (example == null) { if (example == null) {
example = p.paramName + "_example"; example = p.paramName + "_example";
} }
example = "\"" + escapeText(example) + "\""; example = "\"" + escapeText(example) + "\"";
} else if ("Integer".equals(type)) { } else if ("Integer".equals(type) || "int".equals(type)) {
if (example == null) { if (example == null) {
example = "56"; example = "56";
} }
@@ -533,15 +533,17 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
if (example == null) { if (example == null) {
example = "2013-10-20"; example = "2013-10-20";
} }
example = "new DateTime(\"" + escapeText(example) + "\")"; example = "new \\DateTime(\"" + escapeText(example) + "\")";
} else if ("DateTime".equals(type)) { } else if ("DateTime".equals(type)) {
if (example == null) { if (example == null) {
example = "2013-10-20T19:20:30+01:00"; example = "2013-10-20T19:20:30+01:00";
} }
example = "new DateTime(\"" + escapeText(example) + "\")"; example = "new \\DateTime(\"" + escapeText(example) + "\")";
} else if (!languageSpecificPrimitives.contains(type)) { } else if (!languageSpecificPrimitives.contains(type)) {
// type is a model class, e.g. User // type is a model class, e.g. User
example = "new " + type + "()"; example = "new " + type + "()";
} else {
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
} }
if (example == null) { if (example == null) {

View File

@@ -46,7 +46,7 @@ All URIs are relative to *{{basePath}}*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{nickname}}**]({{apiDocPath}}{{classname}}.md#{{nickname}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
## Documentation For Models ## Documentation For Models

View File

@@ -0,0 +1,72 @@
# {{invokerPackage}}\{{classname}}{{#description}}
{{description}}{{/description}}
All URIs are relative to *{{basePath}}*
Method | HTTP request | Description
------------- | ------------- | -------------
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
{{/operation}}{{/operations}}
{{#operations}}
{{#operation}}
# **{{{operationId}}}**
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{{{summary}}}{{#notes}}
{{{notes}}}{{/notes}}
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
// Configure HTTP basic authorization: {{{name}}}
{{{invokerPackage}}}::getDefaultConfiguration->setUsername('YOUR_USERNAME');
{{{invokerPackage}}}::getDefaultConfiguration->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}}
// Configure API key authorization: {{{name}}}
{{{invokerPackage}}}::getDefaultConfiguration->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
// {{{invokerPackage}}}::getDefaultConfiguration->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
// Configure OAuth2 access token for authorization: {{{name}}}
{{{invokerPackage}}}::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}}
{{/hasAuthMethods}}
$api_instance = new {{invokerPackage}}\{{classname}}();
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
{{/allParams}}
try {
{{#returnType}}$result = {{/returnType}}$api_instance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
print_r($result);{{/returnType}}
} catch (Exception $e) {
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), "\n";
}
?>
```
### Parameters
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{/allParams}}
### Return type
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
### Authorization
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
### HTTP reuqest headers
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
[[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)
{{/operation}}
{{/operations}}

View File

@@ -0,0 +1,11 @@
{{#models}}{{#model}}# {{classname}}
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
{{/vars}}
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
{{/model}}{{/models}}

View File

@@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore
Automatically generated by the Perl Swagger Codegen project: Automatically generated by the Perl Swagger Codegen project:
- Build date: 2016-03-16T14:57:20.078+08:00 - Build date: 2016-03-16T15:35:49.140+08:00
- Build package: class io.swagger.codegen.languages.PerlClientCodegen - Build package: class io.swagger.codegen.languages.PerlClientCodegen
- Codegen version: - Codegen version:

View File

@@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
default => sub { { default => sub { {
app_name => 'Swagger Petstore', app_name => 'Swagger Petstore',
app_version => '1.0.0', app_version => '1.0.0',
generated_date => '2016-03-16T14:57:20.078+08:00', generated_date => '2016-03-16T15:35:49.140+08:00',
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
} }, } },
documentation => 'Information about the application version and the codegen codebase version' documentation => 'Information about the application version and the codegen codebase version'
@@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project:
=over 4 =over 4
=item Build date: 2016-03-16T14:57:20.078+08:00 =item Build date: 2016-03-16T15:35:49.140+08:00
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen =item Build package: class io.swagger.codegen.languages.PerlClientCodegen

View File

@@ -14,11 +14,11 @@ You can install the bindings via [Composer](http://getcomposer.org/). Add this t
"repositories": [ "repositories": [
{ {
"type": "git", "type": "git",
"url": "https://github.com/swagger/swagger-client.git" "url": "https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git"
} }
], ],
"require": { "require": {
"swagger/swagger-client": "*@dev" "YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID": "*@dev"
} }
} }
``` ```
@@ -40,6 +40,99 @@ composer install
./vendor/bin/phpunit lib/Tests ./vendor/bin/phpunit lib/Tests
``` ```
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
*StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
## Documentation For Models
- [Category](docs/Category.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [ModelReturn](docs/ModelReturn.md)
- [Name](docs/Name.md)
- [Order](docs/Order.md)
- [Pet](docs/Pet.md)
- [SpecialModelName](docs/SpecialModelName.md)
- [Tag](docs/Tag.md)
- [User](docs/User.md)
## Documentation For Authorization
## test_api_key_header
- **Type**: API key
- **API key parameter name**: test_api_key_header
- **Location**: HTTP header
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## test_http_basic
- **Type**: HTTP basic authentication
## test_api_client_secret
- **Type**: API key
- **API key parameter name**: x-test_api_client_secret
- **Location**: HTTP header
## test_api_client_id
- **Type**: API key
- **API key parameter name**: x-test_api_client_id
- **Location**: HTTP header
## test_api_key_query
- **Type**: API key
- **API key parameter name**: test_api_key_query
- **Location**: URL query string
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## Author ## Author
apiteam@swagger.io apiteam@swagger.io

View File

@@ -1,5 +1,5 @@
{ {
"name": "swagger/swagger-client", "name": "YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"keywords": [ "keywords": [

View File

@@ -1,9 +1,4 @@
# ::Object::Category # Category
## Load the model package
```perl
use ::Object::Category;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::Object::InlineResponse200 # InlineResponse200
## Load the model package
```perl
use ::Object::InlineResponse200;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::Object::ModelReturn # ModelReturn
## Load the model package
```perl
use ::Object::ModelReturn;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::Object::Name # Name
## Load the model package
```perl
use ::Object::Name;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::Object::Order # Order
## Load the model package
```perl
use ::Object::Order;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::Object::Pet # Pet
## Load the model package
```perl
use ::Object::Pet;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::PetApi # Swagger\Client\PetApi
## Load the API package
```perl
use ::Object::PetApi;
```
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*
@@ -23,28 +18,29 @@ Method | HTTP request | Description
# **addPet** # **addPet**
> addPet(body => $body) > addPet($body)
Add a new pet to the store Add a new pet to the store
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $body = ::Object::\Swagger\Client\Model\Pet->new(); # [\Swagger\Client\Model\Pet] Pet object that needs to be added to the store $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
eval { try {
$api->addPet(body => $body); $api_instance->addPet($body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->addPet: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -69,28 +65,29 @@ void (empty response body)
[[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) [[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)
# **addPetUsingByteArray** # **addPetUsingByteArray**
> addPetUsingByteArray(body => $body) > addPetUsingByteArray($body)
Fake endpoint to test byte array in body parameter for adding a new pet to the store Fake endpoint to test byte array in body parameter for adding a new pet to the store
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $body = ::Object::string->new(); # [string] Pet object in the form of byte array $body = "B"; // string | Pet object in the form of byte array
eval { try {
$api->addPetUsingByteArray(body => $body); $api_instance->addPetUsingByteArray($body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->addPetUsingByteArray: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->addPetUsingByteArray: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -115,29 +112,30 @@ void (empty response body)
[[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) [[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)
# **deletePet** # **deletePet**
> deletePet(pet_id => $pet_id, api_key => $api_key) > deletePet($pet_id, $api_key)
Deletes a pet Deletes a pet
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $pet_id = 789; # [int] Pet id to delete $pet_id = 789; // int | Pet id to delete
my $api_key = api_key_example; # [string] $api_key = "api_key_example"; // string |
eval { try {
$api->deletePet(pet_id => $pet_id, api_key => $api_key); $api_instance->deletePet($pet_id, $api_key);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->deletePet: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -163,29 +161,30 @@ void (empty response body)
[[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) [[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)
# **findPetsByStatus** # **findPetsByStatus**
> \Swagger\Client\Model\Pet[] findPetsByStatus(status => $status) > \Swagger\Client\Model\Pet[] findPetsByStatus($status)
Finds Pets by status Finds Pets by status
Multiple status values can be provided with comma separated strings Multiple status values can be provided with comma separated strings
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $status = (array(available)); # [string[]] Status values that need to be considered for query $status = array("available"); // string[] | Status values that need to be considered for query
eval { try {
my $result = $api->findPetsByStatus(status => $status); $result = $api_instance->findPetsByStatus($status);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->findPetsByStatus: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -210,29 +209,30 @@ Name | Type | Description | Notes
[[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) [[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)
# **findPetsByTags** # **findPetsByTags**
> \Swagger\Client\Model\Pet[] findPetsByTags(tags => $tags) > \Swagger\Client\Model\Pet[] findPetsByTags($tags)
Finds Pets by tags Finds Pets by tags
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $tags = (nil); # [string[]] Tags to filter by $tags = array("tags_example"); // string[] | Tags to filter by
eval { try {
my $result = $api->findPetsByTags(tags => $tags); $result = $api_instance->findPetsByTags($tags);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->findPetsByTags: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -257,33 +257,34 @@ Name | Type | Description | Notes
[[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) [[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)
# **getPetById** # **getPetById**
> \Swagger\Client\Model\Pet getPetById(pet_id => $pet_id) > \Swagger\Client\Model\Pet getPetById($pet_id)
Find pet by ID Find pet by ID
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: api_key // Configure API key authorization: api_key
::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'api_key'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $pet_id = 789; # [int] ID of pet that needs to be fetched $pet_id = 789; // int | ID of pet that needs to be fetched
eval { try {
my $result = $api->getPetById(pet_id => $pet_id); $result = $api_instance->getPetById($pet_id);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->getPetById: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -308,33 +309,34 @@ Name | Type | Description | Notes
[[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) [[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)
# **getPetByIdInObject** # **getPetByIdInObject**
> \Swagger\Client\Model\InlineResponse200 getPetByIdInObject(pet_id => $pet_id) > \Swagger\Client\Model\InlineResponse200 getPetByIdInObject($pet_id)
Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: api_key // Configure API key authorization: api_key
::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'api_key'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $pet_id = 789; # [int] ID of pet that needs to be fetched $pet_id = 789; // int | ID of pet that needs to be fetched
eval { try {
my $result = $api->getPetByIdInObject(pet_id => $pet_id); $result = $api_instance->getPetByIdInObject($pet_id);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->getPetByIdInObject: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->getPetByIdInObject: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -359,33 +361,34 @@ Name | Type | Description | Notes
[[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) [[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)
# **petPetIdtestingByteArraytrueGet** # **petPetIdtestingByteArraytrueGet**
> string petPetIdtestingByteArraytrueGet(pet_id => $pet_id) > string petPetIdtestingByteArraytrueGet($pet_id)
Fake endpoint to test byte array return by 'Find pet by ID' Fake endpoint to test byte array return by 'Find pet by ID'
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: api_key // Configure API key authorization: api_key
::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'api_key'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $pet_id = 789; # [int] ID of pet that needs to be fetched $pet_id = 789; // int | ID of pet that needs to be fetched
eval { try {
my $result = $api->petPetIdtestingByteArraytrueGet(pet_id => $pet_id); $result = $api_instance->petPetIdtestingByteArraytrueGet($pet_id);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->petPetIdtestingByteArraytrueGet: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->petPetIdtestingByteArraytrueGet: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -410,28 +413,29 @@ Name | Type | Description | Notes
[[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) [[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)
# **updatePet** # **updatePet**
> updatePet(body => $body) > updatePet($body)
Update an existing pet Update an existing pet
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $body = ::Object::\Swagger\Client\Model\Pet->new(); # [\Swagger\Client\Model\Pet] Pet object that needs to be added to the store $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
eval { try {
$api->updatePet(body => $body); $api_instance->updatePet($body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->updatePet: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -456,30 +460,31 @@ void (empty response body)
[[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) [[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)
# **updatePetWithForm** # **updatePetWithForm**
> updatePetWithForm(pet_id => $pet_id, name => $name, status => $status) > updatePetWithForm($pet_id, $name, $status)
Updates a pet in the store with form data Updates a pet in the store with form data
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $pet_id = pet_id_example; # [string] ID of pet that needs to be updated $pet_id = "pet_id_example"; // string | ID of pet that needs to be updated
my $name = name_example; # [string] Updated name of the pet $name = "name_example"; // string | Updated name of the pet
my $status = status_example; # [string] Updated status of the pet $status = "status_example"; // string | Updated status of the pet
eval { try {
$api->updatePetWithForm(pet_id => $pet_id, name => $name, status => $status); $api_instance->updatePetWithForm($pet_id, $name, $status);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->updatePetWithForm: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -506,30 +511,31 @@ void (empty response body)
[[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) [[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)
# **uploadFile** # **uploadFile**
> uploadFile(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file) > uploadFile($pet_id, $additional_metadata, $file)
uploads an image uploads an image
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');
my $api = ::PetApi->new(); $api_instance = new Swagger\Client\PetApi();
my $pet_id = 789; # [int] ID of pet to update $pet_id = 789; // int | ID of pet to update
my $additional_metadata = additional_metadata_example; # [string] Additional data to pass to server $additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server
my $file = new Swagger\Client\\SplFileObject(); # [\SplFileObject] file to upload $file = new \SplFileObject(); // \SplFileObject | file to upload
eval { try {
$api->uploadFile(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); $api_instance->uploadFile($pet_id, $additional_metadata, $file);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n";
warn "Exception when calling PetApi->uploadFile: $@\n";
} }
?>
``` ```
### Parameters ### Parameters

View File

@@ -1,9 +1,4 @@
# ::Object::SpecialModelName # SpecialModelName
## Load the model package
```perl
use ::Object::SpecialModelName;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::StoreApi # Swagger\Client\StoreApi
## Load the API package
```perl
use ::Object::StoreApi;
```
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*
@@ -18,25 +13,26 @@ Method | HTTP request | Description
# **deleteOrder** # **deleteOrder**
> deleteOrder(order_id => $order_id) > deleteOrder($order_id)
Delete purchase order by ID Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::StoreApi->new(); $api_instance = new Swagger\Client\StoreApi();
my $order_id = order_id_example; # [string] ID of the order that needs to be deleted $order_id = "order_id_example"; // string | ID of the order that needs to be deleted
eval { try {
$api->deleteOrder(order_id => $order_id); $api_instance->deleteOrder($order_id);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n";
warn "Exception when calling StoreApi->deleteOrder: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -61,35 +57,36 @@ No authorization required
[[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) [[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)
# **findOrdersByStatus** # **findOrdersByStatus**
> \Swagger\Client\Model\Order[] findOrdersByStatus(status => $status) > \Swagger\Client\Model\Order[] findOrdersByStatus($status)
Finds orders by status Finds orders by status
A single status value can be provided as a string A single status value can be provided as a string
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: test_api_client_id // Configure API key authorization: test_api_client_id
::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
# Configure API key authorization: test_api_client_secret // Configure API key authorization: test_api_client_secret
::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
my $api = ::StoreApi->new(); $api_instance = new Swagger\Client\StoreApi();
my $status = placed; # [string] Status value that needs to be considered for query $status = "placed"; // string | Status value that needs to be considered for query
eval { try {
my $result = $api->findOrdersByStatus(status => $status); $result = $api_instance->findOrdersByStatus($status);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling StoreApi->findOrdersByStatus: ', $e->getMessage(), "\n";
warn "Exception when calling StoreApi->findOrdersByStatus: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -121,23 +118,24 @@ Returns pet inventories by status
Returns a map of status codes to quantities Returns a map of status codes to quantities
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: api_key // Configure API key authorization: api_key
::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'api_key'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
my $api = ::StoreApi->new(); $api_instance = new Swagger\Client\StoreApi();
eval { try {
my $result = $api->getInventory(); $result = $api_instance->getInventory();
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), "\n";
warn "Exception when calling StoreApi->getInventory: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -166,23 +164,24 @@ Fake endpoint to test arbitrary object return by 'Get inventory'
Returns an arbitrary object which is actually a map of status codes to quantities Returns an arbitrary object which is actually a map of status codes to quantities
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: api_key // Configure API key authorization: api_key
::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'api_key'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER');
my $api = ::StoreApi->new(); $api_instance = new Swagger\Client\StoreApi();
eval { try {
my $result = $api->getInventoryInObject(); $result = $api_instance->getInventoryInObject();
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling StoreApi->getInventoryInObject: ', $e->getMessage(), "\n";
warn "Exception when calling StoreApi->getInventoryInObject: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -204,35 +203,36 @@ This endpoint does not need any parameter.
[[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) [[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)
# **getOrderById** # **getOrderById**
> \Swagger\Client\Model\Order getOrderById(order_id => $order_id) > \Swagger\Client\Model\Order getOrderById($order_id)
Find purchase order by ID Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: test_api_key_header // Configure API key authorization: test_api_key_header
::Configuration::api_key->{'test_api_key_header'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('test_api_key_header', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'test_api_key_header'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('test_api_key_header', 'BEARER');
# Configure API key authorization: test_api_key_query // Configure API key authorization: test_api_key_query
::Configuration::api_key->{'test_api_key_query'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('test_api_key_query', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'test_api_key_query'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('test_api_key_query', 'BEARER');
my $api = ::StoreApi->new(); $api_instance = new Swagger\Client\StoreApi();
my $order_id = order_id_example; # [string] ID of pet that needs to be fetched $order_id = "order_id_example"; // string | ID of pet that needs to be fetched
eval { try {
my $result = $api->getOrderById(order_id => $order_id); $result = $api_instance->getOrderById($order_id);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), "\n";
warn "Exception when calling StoreApi->getOrderById: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -257,35 +257,36 @@ Name | Type | Description | Notes
[[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) [[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)
# **placeOrder** # **placeOrder**
> \Swagger\Client\Model\Order placeOrder(body => $body) > \Swagger\Client\Model\Order placeOrder($body)
Place an order for a pet Place an order for a pet
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure API key authorization: test_api_client_id // Configure API key authorization: test_api_client_id
::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
# Configure API key authorization: test_api_client_secret // Configure API key authorization: test_api_client_secret
::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY'; Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
#::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER"; // Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
my $api = ::StoreApi->new(); $api_instance = new Swagger\Client\StoreApi();
my $body = ::Object::\Swagger\Client\Model\Order->new(); # [\Swagger\Client\Model\Order] order placed for purchasing the pet $body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
eval { try {
my $result = $api->placeOrder(body => $body); $result = $api_instance->placeOrder($body);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), "\n";
warn "Exception when calling StoreApi->placeOrder: $@\n";
} }
?>
``` ```
### Parameters ### Parameters

View File

@@ -1,9 +1,4 @@
# ::Object::Tag # Tag
## Load the model package
```perl
use ::Object::Tag;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::Object::User # User
## Load the model package
```perl
use ::Object::User;
```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@@ -1,9 +1,4 @@
# ::UserApi # Swagger\Client\UserApi
## Load the API package
```perl
use ::Object::UserApi;
```
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*
@@ -20,25 +15,26 @@ Method | HTTP request | Description
# **createUser** # **createUser**
> createUser(body => $body) > createUser($body)
Create user Create user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $body = ::Object::\Swagger\Client\Model\User->new(); # [\Swagger\Client\Model\User] Created user object $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Created user object
eval { try {
$api->createUser(body => $body); $api_instance->createUser($body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->createUser: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -63,25 +59,26 @@ No authorization required
[[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) [[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)
# **createUsersWithArrayInput** # **createUsersWithArrayInput**
> createUsersWithArrayInput(body => $body) > createUsersWithArrayInput($body)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $body = (::Object::\Swagger\Client\Model\User[]->new()); # [\Swagger\Client\Model\User[]] List of user object $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
eval { try {
$api->createUsersWithArrayInput(body => $body); $api_instance->createUsersWithArrayInput($body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -106,25 +103,26 @@ No authorization required
[[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) [[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)
# **createUsersWithListInput** # **createUsersWithListInput**
> createUsersWithListInput(body => $body) > createUsersWithListInput($body)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $body = (::Object::\Swagger\Client\Model\User[]->new()); # [\Swagger\Client\Model\User[]] List of user object $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
eval { try {
$api->createUsersWithListInput(body => $body); $api_instance->createUsersWithListInput($body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->createUsersWithListInput: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -149,29 +147,30 @@ No authorization required
[[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) [[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)
# **deleteUser** # **deleteUser**
> deleteUser(username => $username) > deleteUser($username)
Delete user Delete user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
# Configure HTTP basic authorization: test_http_basic // Configure HTTP basic authorization: test_http_basic
::Configuration::username = 'YOUR_USERNAME'; Swagger\Client::getDefaultConfiguration->setUsername('YOUR_USERNAME');
::Configuration::password = 'YOUR_PASSWORD'; Swagger\Client::getDefaultConfiguration->setPassword('YOUR_PASSWORD');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $username = username_example; # [string] The name that needs to be deleted $username = "username_example"; // string | The name that needs to be deleted
eval { try {
$api->deleteUser(username => $username); $api_instance->deleteUser($username);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->deleteUser: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -196,26 +195,27 @@ void (empty response body)
[[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) [[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)
# **getUserByName** # **getUserByName**
> \Swagger\Client\Model\User getUserByName(username => $username) > \Swagger\Client\Model\User getUserByName($username)
Get user by user name Get user by user name
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $username = username_example; # [string] The name that needs to be fetched. Use user1 for testing. $username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
eval { try {
my $result = $api->getUserByName(username => $username); $result = $api_instance->getUserByName($username);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->getUserByName: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -240,27 +240,28 @@ No authorization required
[[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) [[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)
# **loginUser** # **loginUser**
> string loginUser(username => $username, password => $password) > string loginUser($username, $password)
Logs user into the system Logs user into the system
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $username = username_example; # [string] The user name for login $username = "username_example"; // string | The user name for login
my $password = password_example; # [string] The password for login in clear text $password = "password_example"; // string | The password for login in clear text
eval { try {
my $result = $api->loginUser(username => $username, password => $password); $result = $api_instance->loginUser($username, $password);
print Dumper($result); print_r($result);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->loginUser: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -293,17 +294,18 @@ Logs out current logged in user session
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
eval { try {
$api->logoutUser(); $api_instance->logoutUser();
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->logoutUser: $@\n";
} }
?>
``` ```
### Parameters ### Parameters
@@ -325,26 +327,27 @@ No authorization required
[[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) [[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)
# **updateUser** # **updateUser**
> updateUser(username => $username, body => $body) > updateUser($username, $body)
Updated user Updated user
This can only be done by the logged in user. This can only be done by the logged in user.
### Example ### Example
```perl ```php
use Data::Dumper; <?php
require_once(__DIR__ . '/vendor/autoload.php');
my $api = ::UserApi->new(); $api_instance = new Swagger\Client\UserApi();
my $username = username_example; # [string] name that need to be deleted $username = "username_example"; // string | name that need to be deleted
my $body = ::Object::\Swagger\Client\Model\User->new(); # [\Swagger\Client\Model\User] Updated user object $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Updated user object
eval { try {
$api->updateUser(username => $username, body => $body); $api_instance->updateUser($username, $body);
}; } catch (Exception $e) {
if ($@) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n";
warn "Exception when calling UserApi->updateUser: $@\n";
} }
?>
``` ```
### Parameters ### Parameters

View File

@@ -245,7 +245,17 @@ class ObjectSerializer
settype($data, 'array'); settype($data, 'array');
$deserialized = $data; $deserialized = $data;
} elseif ($class === '\DateTime') { } elseif ($class === '\DateTime') {
$deserialized = new \DateTime($data); // 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)) {
$deserialized = new \DateTime($data);
} else {
$deserialized = null;
}
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
settype($data, $class); settype($data, $class);
$deserialized = $data; $deserialized = $data;