Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ use \{{invokerPackage}}\ObjectSerializer;
{
if ($apiClient === null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('{{basePath}}');
}

$this->apiClient = $apiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update |
**additional_metadata** | **string**| Additional data to pass to server | [optional]
**file** | **\SplFileObject****\SplFileObject**| file to upload | [optional]
**file** | **\SplFileObject**| file to upload | [optional]

### Return type

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ClassModel

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_class** | **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)


Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OuterEnum

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function __construct(\Swagger\Client\ApiClient $apiClient = null)
{
if ($apiClient === null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
}

$this->apiClient = $apiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function __construct(\Swagger\Client\ApiClient $apiClient = null)
{
if ($apiClient === null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
}

$this->apiClient = $apiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function __construct(\Swagger\Client\ApiClient $apiClient = null)
{
if ($apiClient === null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
}

$this->apiClient = $apiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function __construct(\Swagger\Client\ApiClient $apiClient = null)
{
if ($apiClient === null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('http://petstore.swagger.io/v2');
}

$this->apiClient = $apiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header
if ($this->config->getCurlTimeout() !== 0) {
curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout());
}
// set connect timeout, if needed
if ($this->config->getCurlConnectTimeout() != 0) {
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout());
}

// return the result on success, rather than just true
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ class Configuration
*/
protected $curlTimeout = 0;

/**
* Timeout (second) of the HTTP connection, by default set to 0, no timeout
*
* @var string
*/
protected $curlConnectTimeout = 0;

/**
* User agent of the HTTP request, set to "PHP-Swagger" by default
*
Expand Down Expand Up @@ -380,6 +387,33 @@ public function getCurlTimeout()
return $this->curlTimeout;
}

/**
* Sets the HTTP connect timeout value
*
* @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout]
*
* @return Configuration
*/
public function setCurlConnectTimeout($seconds)
{
if (!is_numeric($seconds) || $seconds < 0) {
throw new \InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.');
}

$this->curlConnectTimeout = $seconds;
return $this;
}

/**
* Gets the HTTP connect timeout value
*
* @return string HTTP connect timeout value
*/
public function getCurlConnectTimeout()
{
return $this->curlConnectTimeout;
}

/**
* Sets debug flag
*
Expand Down
229 changes: 229 additions & 0 deletions samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<?php
/**
* ClassModel
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author Swaagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/

/**
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
*/

/**
* 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;

/**
* ClassModel Class Doc Comment
*
* @category Class */
// @description Model for testing model with \&quot;_class\&quot; property
/**
* @package Swagger\Client
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class ClassModel implements ArrayAccess
{
const DISCRIMINATOR = null;

/**
* The original name of the model.
* @var string
*/
protected static $swaggerModelName = 'ClassModel';

/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
*/
protected static $swaggerTypes = [
'_class' => 'string'
];

public static function swaggerTypes()
{
return self::$swaggerTypes;
}

/**
* Array of attributes where the key is the local name, and the value is the original name
* @var string[]
*/
protected static $attributeMap = [
'_class' => '_class'
];


/**
* Array of attributes to setter functions (for deserialization of responses)
* @var string[]
*/
protected static $setters = [
'_class' => 'setClass'
];


/**
* Array of attributes to getter functions (for serialization of requests)
* @var string[]
*/
protected static $getters = [
'_class' => 'getClass'
];

public static function attributeMap()
{
return self::$attributeMap;
}

public static function setters()
{
return self::$setters;
}

public static function getters()
{
return self::$getters;
}





/**
* 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['_class'] = isset($data['_class']) ? $data['_class'] : null;
}

/**
* show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalid_properties = [];
return $invalid_properties;
}

/**
* validate all the properties in the model
* return true if all passed
*
* @return bool True if all properteis are valid
*/
public function valid()
{
return true;
}


/**
* Gets _class
* @return string
*/
public function getClass()
{
return $this->container['_class'];
}

/**
* Sets _class
* @param string $_class
* @return $this
*/
public function setClass($_class)
{
$this->container['_class'] = $_class;

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(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
}

return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}


Loading