From adfb03e267ccf05472f98f41a84da2fea97ed8bb Mon Sep 17 00:00:00 2001 From: Carsten Karbach <c.karbach@fz-juelich.de> Date: Mon, 15 Jan 2018 16:19:20 +0100 Subject: [PATCH] Update Api with new event structure --- README.md | 4 +- autoload.php | 2 +- composer.json | 2 +- docs/Model/Application.md | 11 ++ docs/Model/Event.md | 13 +- docs/Model/Project.md | 11 ++ events_api.json | 154 ++++++++++++++++++ lib/Api/EventsApi.php | 2 +- lib/ApiClient.php | 8 +- lib/ApiException.php | 2 +- lib/Configuration.php | 83 +--------- lib/Model/Application.php | 275 +++++++++++++++++++++++++++++++++ lib/Model/Event.php | 155 +++++++++++++++++-- lib/Model/Project.php | 275 +++++++++++++++++++++++++++++++++ lib/ObjectSerializer.php | 2 +- test/Api/EventsApiTest.php | 2 +- test/Model/ApplicationTest.php | 93 +++++++++++ test/Model/EventTest.php | 37 ++++- test/Model/ProjectTest.php | 93 +++++++++++ 19 files changed, 1114 insertions(+), 110 deletions(-) create mode 100644 docs/Model/Application.md create mode 100644 docs/Model/Project.md create mode 100644 events_api.json create mode 100644 lib/Model/Application.php create mode 100644 lib/Model/Project.php create mode 100644 test/Model/ApplicationTest.php create mode 100644 test/Model/ProjectTest.php diff --git a/README.md b/README.md index 634cbf1..125e386 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ No description provided (generated by Swagger Codegen https://github.com/swagger This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API version: 0.0.1 +- API version: 0.1 - Build package: io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -80,7 +80,9 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [Application](docs/Model/Application.md) - [Event](docs/Model/Event.md) + - [Project](docs/Model/Project.md) ## Documentation For Authorization diff --git a/autoload.php b/autoload.php index ce929f5..54b73d6 100644 --- a/autoload.php +++ b/autoload.php @@ -5,7 +5,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * diff --git a/composer.json b/composer.json index 0b71647..a40f67a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "jards/eventsapiclient", + "name": "/", "description": "", "keywords": [ "swagger", diff --git a/docs/Model/Application.md b/docs/Model/Application.md new file mode 100644 index 0000000..fd600bd --- /dev/null +++ b/docs/Model/Application.md @@ -0,0 +1,11 @@ +# Application + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Application / Proposal ID | +**type** | **string** | Proposal type such as extension or new | [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) + + diff --git a/docs/Model/Event.md b/docs/Model/Event.md index 81db203..5bdafca 100644 --- a/docs/Model/Event.md +++ b/docs/Model/Event.md @@ -3,10 +3,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**date** | [**\DateTime**](\DateTime.md) | | -**name** | **string** | | -**description** | **string** | | -**id** | **int** | | [optional] +**date** | [**\DateTime**](\DateTime.md) | Date when the event happened. | +**name** | **string** | Name of the event | +**description** | **string** | Detailled description on what happened during this event | +**id** | **int** | Internal event ID, differs for every EventsAPI instance | [optional] +**source** | **string** | Who has triggered the event? | [optional] +**new_state** | **string** | The new state for the project or application caused by the event | [optional] +**trigger_type** | **string** | Name of the trigger which is activated by this event | [optional] +**project** | [**\Swagger\Client\Model\Project**](Project.md) | | [optional] +**application** | [**\Swagger\Client\Model\Application**](Application.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) diff --git a/docs/Model/Project.md b/docs/Model/Project.md new file mode 100644 index 0000000..ce60387 --- /dev/null +++ b/docs/Model/Project.md @@ -0,0 +1,11 @@ +# Project + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Project ID | +**type** | **string** | Project type such as regular, gcs, test, large-scale | [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) + + diff --git a/events_api.json b/events_api.json new file mode 100644 index 0000000..ad18ec1 --- /dev/null +++ b/events_api.json @@ -0,0 +1,154 @@ +{ + "swagger": "2.0", + "info": { + "version": "0.1", + "title": "Event receiver service. Send any events, which should be handled by this service." + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/events": { + "get": { + "description": "Get a list of all events sent to this service.\n", + "responses": { + "200": { + "description": "Successful response", + "schema": { + "title": "List of events", + "type": "array", + "items": { + "$ref": "#/definitions/Event" + } + } + } + }, + "tags": [ + "Events" + ] + }, + "post":{ + "summary": "", + "description": "Send a new event.", + "parameters": [ + { + "name": "event", + "in": "body", + "description": "The event, which happened and should be handled.", + "required": true, + "schema": { + "$ref": "#/definitions/Event" + } + } + ], + "responses": { + "200": { + "description": "Event was successfully handled.", + "schema": { + "title": "Success message", + "type": "string" + } + }, + "400": { + "description": "Error occurred during event handling.", + "schema": { + "title": "error message", + "type": "string" + } + } + }, + "tags": [ + "Events" + ] + } + } + }, + "definitions": { + "Event": { + "type": "object", + "required": [ + "date", + "name", + "description" + ], + "properties": { + "date": { + "description": "Date when the event happened.", + "type": "string", + "format": "date-time" + }, + "name": { + "description": "Name of the event", + "type": "string" + }, + "description": { + "description": "Detailled description on what happened during this event", + "type": "string" + }, + "id":{ + "description": "Internal event ID, differs for every EventsAPI instance", + "type": "integer" + }, + "source": { + "description": "Who has triggered the event?", + "type": "string" + }, + "newState": { + "description": "The new state for the project or application caused by the event", + "type": "string" + }, + "triggerType": { + "description": "Name of the trigger which is activated by this event", + "type": "string" + }, + "project" : { + "$ref": "#/definitions/Project" + }, + "application" : { + "$ref": "#/definitions/Application" + } + } + }, + "Project": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Project ID", + "type": "string" + }, + "type": { + "description": "Project type such as regular, gcs, test, large-scale", + "type": "string" + } + } + }, + "Application": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Application / Proposal ID", + "type": "integer" + }, + "type": { + "description": "Proposal type such as extension or new", + "type": "string" + } + } + } + }, + "tags": [ + { + "name": "Events", + "description": "Post and list events to this receiver." + } + ] +} \ No newline at end of file diff --git a/lib/Api/EventsApi.php b/lib/Api/EventsApi.php index c58fa01..c312494 100644 --- a/lib/Api/EventsApi.php +++ b/lib/Api/EventsApi.php @@ -14,7 +14,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * diff --git a/lib/ApiClient.php b/lib/ApiClient.php index 36bc858..946589c 100644 --- a/lib/ApiClient.php +++ b/lib/ApiClient.php @@ -15,7 +15,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * @@ -178,12 +178,6 @@ class ApiClient curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); } - - if(! empty($this->config->getCertificate())){ - curl_setopt($curl, CURLOPT_SSLCERT, $this->config->getCertificate()); - curl_setopt($curl, CURLOPT_SSLKEY, $this->config->getCertificateKey()); - curl_setopt($curl, CURLOPT_SSLKEYPASSWD, $this->config->getCertificatePassphrase()); - } if ($this->config->getCurlProxyHost()) { curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); diff --git a/lib/ApiException.php b/lib/ApiException.php index 63fd184..51fc480 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -14,7 +14,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * diff --git a/lib/Configuration.php b/lib/Configuration.php index 040b49b..bd8a234 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -14,7 +14,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * @@ -141,24 +141,6 @@ class Configuration */ protected $sslVerification = true; - /** - * Path to client certificate - * @var string path to client certificate - */ - protected $certificate = null; - - /** - * Path to client certificate key file - * @var string path to client certificate key file - */ - protected $certificateKey = null; - - /** - * passphrase for the certificate key file - * @var string passphrase for the certificate key file - */ - protected $certificatePassphrase = null; - /** * Curl proxy host * @@ -708,67 +690,6 @@ class Configuration { return $this->sslVerification; } - - /** - * Sets certificate file for client certificate - * - * @param string $certificate path to client certificate - * @return Configuration - */ - public function setCertificate($certificate) - { - $this->certificate = $certificate; - return $this; - } - - /** - * - * @return string certificate file for client certificate - */ - public function getCertificate() - { - return $this->certificate; - } - - /** - * Set certificate key file - * @param string $certificatekey certificate key file - * @return \Swagger\Client\Configuration - */ - public function setCertificateKey($certificatekey) - { - $this->certificateKey = $certificatekey; - return $this; - } - - /** - * - * @return string certificate key file - */ - public function getCertificateKey() - { - return $this->certificateKey; - } - - /** - * Set passphrase for client certificate key file - * @param string $passphrase passphrase for client certificate key file - * @return \Swagger\Client\Configuration - */ - public function setCertificatePassphrase($passphrase) - { - $this->certificatePassphrase = $passphrase; - return $this; - } - - /** - * - * @return string passphrase for client certificate key file - */ - public function getCertificatePassphrase() - { - return $this->certificatePassphrase; - } /** * Gets the default configuration instance @@ -806,7 +727,7 @@ class Configuration $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: 0.0.1' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 0.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/Application.php b/lib/Model/Application.php new file mode 100644 index 0000000..451f235 --- /dev/null +++ b/lib/Model/Application.php @@ -0,0 +1,275 @@ +<?php +/** + * Application + * + * PHP version 5 + * + * @category Class + * @package Swagger\Client + * @author Swaagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ + +/** + * Event receiver service. Send any events, which should be handled by this service. + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 0.1 + * + * 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; + +/** + * Application Class Doc Comment + * + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Application implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Application'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'int', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'type' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + 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', + 'type' => 'type' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + 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['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['id'] === null) { + $invalid_properties[] = "'id' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param int $id Application / Proposal ID + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * @param string $type Proposal type such as extension or new + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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)); + } +} + + diff --git a/lib/Model/Event.php b/lib/Model/Event.php index 9853b3c..aa7fde6 100644 --- a/lib/Model/Event.php +++ b/lib/Model/Event.php @@ -15,7 +15,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * @@ -57,7 +57,12 @@ class Event implements ArrayAccess 'date' => '\DateTime', 'name' => 'string', 'description' => 'string', - 'id' => 'int' + 'id' => 'int', + 'source' => 'string', + 'new_state' => 'string', + 'trigger_type' => 'string', + 'project' => '\Swagger\Client\Model\Project', + 'application' => '\Swagger\Client\Model\Application' ]; /** @@ -68,7 +73,12 @@ class Event implements ArrayAccess 'date' => 'date-time', 'name' => null, 'description' => null, - 'id' => null + 'id' => null, + 'source' => null, + 'new_state' => null, + 'trigger_type' => null, + 'project' => null, + 'application' => null ]; public static function swaggerTypes() @@ -89,7 +99,12 @@ class Event implements ArrayAccess 'date' => 'date', 'name' => 'name', 'description' => 'description', - 'id' => 'id' + 'id' => 'id', + 'source' => 'source', + 'new_state' => 'newState', + 'trigger_type' => 'triggerType', + 'project' => 'project', + 'application' => 'application' ]; @@ -101,7 +116,12 @@ class Event implements ArrayAccess 'date' => 'setDate', 'name' => 'setName', 'description' => 'setDescription', - 'id' => 'setId' + 'id' => 'setId', + 'source' => 'setSource', + 'new_state' => 'setNewState', + 'trigger_type' => 'setTriggerType', + 'project' => 'setProject', + 'application' => 'setApplication' ]; @@ -113,7 +133,12 @@ class Event implements ArrayAccess 'date' => 'getDate', 'name' => 'getName', 'description' => 'getDescription', - 'id' => 'getId' + 'id' => 'getId', + 'source' => 'getSource', + 'new_state' => 'getNewState', + 'trigger_type' => 'getTriggerType', + 'project' => 'getProject', + 'application' => 'getApplication' ]; public static function attributeMap() @@ -151,6 +176,11 @@ class Event implements ArrayAccess $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['source'] = isset($data['source']) ? $data['source'] : null; + $this->container['new_state'] = isset($data['new_state']) ? $data['new_state'] : null; + $this->container['trigger_type'] = isset($data['trigger_type']) ? $data['trigger_type'] : null; + $this->container['project'] = isset($data['project']) ? $data['project'] : null; + $this->container['application'] = isset($data['application']) ? $data['application'] : null; } /** @@ -207,7 +237,7 @@ class Event implements ArrayAccess /** * Sets date - * @param \DateTime $date + * @param \DateTime $date Date when the event happened. * @return $this */ public function setDate($date) @@ -228,7 +258,7 @@ class Event implements ArrayAccess /** * Sets name - * @param string $name + * @param string $name Name of the event * @return $this */ public function setName($name) @@ -249,7 +279,7 @@ class Event implements ArrayAccess /** * Sets description - * @param string $description + * @param string $description Detailled description on what happened during this event * @return $this */ public function setDescription($description) @@ -270,7 +300,7 @@ class Event implements ArrayAccess /** * Sets id - * @param int $id + * @param int $id Internal event ID, differs for every EventsAPI instance * @return $this */ public function setId($id) @@ -279,6 +309,111 @@ class Event implements ArrayAccess return $this; } + + /** + * Gets source + * @return string + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * @param string $source Who has triggered the event? + * @return $this + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets new_state + * @return string + */ + public function getNewState() + { + return $this->container['new_state']; + } + + /** + * Sets new_state + * @param string $new_state The new state for the project or application caused by the event + * @return $this + */ + public function setNewState($new_state) + { + $this->container['new_state'] = $new_state; + + return $this; + } + + /** + * Gets trigger_type + * @return string + */ + public function getTriggerType() + { + return $this->container['trigger_type']; + } + + /** + * Sets trigger_type + * @param string $trigger_type Name of the trigger which is activated by this event + * @return $this + */ + public function setTriggerType($trigger_type) + { + $this->container['trigger_type'] = $trigger_type; + + return $this; + } + + /** + * Gets project + * @return \Swagger\Client\Model\Project + */ + public function getProject() + { + return $this->container['project']; + } + + /** + * Sets project + * @param \Swagger\Client\Model\Project $project + * @return $this + */ + public function setProject($project) + { + $this->container['project'] = $project; + + return $this; + } + + /** + * Gets application + * @return \Swagger\Client\Model\Application + */ + public function getApplication() + { + return $this->container['application']; + } + + /** + * Sets application + * @param \Swagger\Client\Model\Application $application + * @return $this + */ + public function setApplication($application) + { + $this->container['application'] = $application; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/lib/Model/Project.php b/lib/Model/Project.php new file mode 100644 index 0000000..e5a7d98 --- /dev/null +++ b/lib/Model/Project.php @@ -0,0 +1,275 @@ +<?php +/** + * Project + * + * PHP version 5 + * + * @category Class + * @package Swagger\Client + * @author Swaagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ + +/** + * Event receiver service. Send any events, which should be handled by this service. + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 0.1 + * + * 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; + +/** + * Project Class Doc Comment + * + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Project implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Project'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'type' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + 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', + 'type' => 'type' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + 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['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['id'] === null) { + $invalid_properties[] = "'id' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id Project ID + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * @param string $type Project type such as regular, gcs, test, large-scale + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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)); + } +} + + diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index b33f256..eb23866 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -15,7 +15,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * diff --git a/test/Api/EventsApiTest.php b/test/Api/EventsApiTest.php index 80e3493..2509e48 100644 --- a/test/Api/EventsApiTest.php +++ b/test/Api/EventsApiTest.php @@ -14,7 +14,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * diff --git a/test/Model/ApplicationTest.php b/test/Model/ApplicationTest.php new file mode 100644 index 0000000..162de67 --- /dev/null +++ b/test/Model/ApplicationTest.php @@ -0,0 +1,93 @@ +<?php +/** + * ApplicationTest + * + * PHP version 5 + * + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ + +/** + * Event receiver service. Send any events, which should be handled by this service. + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 0.1 + * + * 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 + * Please update the test case below to test the model. + */ + +namespace Swagger\Client; + +/** + * ApplicationTest Class Doc Comment + * + * @category Class */ +// * @description Application +/** + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ApplicationTest 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 "Application" + */ + public function testApplication() + { + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + } +} diff --git a/test/Model/EventTest.php b/test/Model/EventTest.php index 51a4c9a..c2bc080 100644 --- a/test/Model/EventTest.php +++ b/test/Model/EventTest.php @@ -15,7 +15,7 @@ * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 0.0.1 + * OpenAPI spec version: 0.1 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * @@ -104,4 +104,39 @@ class EventTest extends \PHPUnit_Framework_TestCase public function testPropertyId() { } + + /** + * Test attribute "source" + */ + public function testPropertySource() + { + } + + /** + * Test attribute "new_state" + */ + public function testPropertyNewState() + { + } + + /** + * Test attribute "trigger_type" + */ + public function testPropertyTriggerType() + { + } + + /** + * Test attribute "project" + */ + public function testPropertyProject() + { + } + + /** + * Test attribute "application" + */ + public function testPropertyApplication() + { + } } diff --git a/test/Model/ProjectTest.php b/test/Model/ProjectTest.php new file mode 100644 index 0000000..70350c2 --- /dev/null +++ b/test/Model/ProjectTest.php @@ -0,0 +1,93 @@ +<?php +/** + * ProjectTest + * + * PHP version 5 + * + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ + +/** + * Event receiver service. Send any events, which should be handled by this service. + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 0.1 + * + * 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 + * Please update the test case below to test the model. + */ + +namespace Swagger\Client; + +/** + * ProjectTest Class Doc Comment + * + * @category Class */ +// * @description Project +/** + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ProjectTest 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 "Project" + */ + public function testProject() + { + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + } +} -- GitLab